Граф коммитов

3629 Коммитов

Автор SHA1 Сообщение Дата
pschwartau%netscape.com a9e33f26e5 Fixing bug that prevented -p option from working on the Mac. 2001-07-03 00:40:46 +00:00
pschwartau%netscape.com a889741b9e Initial add. 2001-07-02 20:43:49 +00:00
nboyd%atg.com 079d7bea96 Subject:
Re: Bug in RhinoTip
 Resent-Date:
             Sat, 30 Jun 2001 11:45:38 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             Sat, 30 Jun 2001 20:54:21 +0200
        From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
          To:
             nboyd@atg.com
         CC:
             Christopher Oliver <coliver@mminternet.com>, mozilla-jseng@mozilla.org
  References:
             1




Christopher Oliver wrote:

> Hi,
>
> I noticed the following in today's rhinoTip:
>
> js> throw 100
> js: uncaught JavaScript exception: java.lang.Object@5d601f
>
> js> throw 200
> js: uncaught JavaScript exception: java.lang.Object@5d601f
>
> js> throw i = 100
> js: uncaught JavaScript exception: 100



The attached patch to omj/Interpreter.java fixes that: I forgot to check
for stack[stackTop] == DBL_MARK during throw when implemented
interpreter optimization to minimize number of created Double instances.

I think that example should go to the test suite in a form like:
try { throw 100; } catch (ex) { return ex == 100; }

Regards, Igor
2001-07-02 14:00:00 +00:00
nboyd%atg.com 9a8d2c2e41 In case of exceptions creating optimizer, just use interpreter. 2001-07-02 13:59:09 +00:00
nboyd%atg.com 99d9b052fd More liberal rules for default value conversions for java objects. 2001-07-02 13:58:17 +00:00
nboyd%atg.com b7d911651e Subject:
Bugfix to Rhino Debugger
        Date:
             Sat, 30 Jun 2001 06:09:44 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

Attached is a fix to a problem I encountered with the Rhino debugger.
Apparently some recent changes to the engine broke the debugger because
the debugger wasn't  acquiring a Context before making certain engine
calls like ScriptableObject.getIds().  You can see this by stepping
through the "enum.js" example and expanding the variable "elements".
The below exception trace will be printed on the debugger console.  The
attached file should fix this problem.

Chris

Subject:
             Another fix to VariableModel.java
        Date:
             Sat, 30 Jun 2001 07:33:51 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

I modified this file to always call Context.toString() to display a
variable's value in the the tree table.  Previously it only called it
for Scriptables and the toString() method of the object otherwise.  This
caused for example JavaScript "2" to be displayed as "2.0".

Chris
2001-07-02 13:55:20 +00:00
nboyd%atg.com ddaaaa90cc Updates from Christopher Oliver. 2001-07-02 13:50:23 +00:00
cls%seawood.org b0724d0103 Link mozjs before nspr for static irix build.
Thanks to John Mark Vandenberg <johnv@adacel.com.au> for the patch.
Bug #88288 r=cls
2001-07-01 15:02:27 +00:00
cls%seawood.org 66d937045b Landing static build changes for OS2
Thanks to Javier Pedemonte <pedemont@us.ibm.com> for the patch.
Bug #85283 r=mkaply r=waterson
2001-07-01 12:11:13 +00:00
jaggernaut%netscape.com 5a6317b8a5 Bug 88413: Remove |GetUnicode()| from nsString (and replace it with |get()|). r=dbaron, rs=scc.
This removes all call-sites I can currently fix. Tomorrow I'll try to get someone to checkin my changes to security/ and I'll get some help with the Netscape side of things.

nsString::GetUnicode()'s final death-blow will be dealt soon. Please keep this in mind as you add new code :-)
2001-06-30 11:02:25 +00:00
pavel%gingerall.cz 9df1ab2d5c JS.pm works correctly 2001-06-29 10:59:32 +00:00
rginda%netscape.com 0e1ad7ad4e use file:// url as the filename, instead of the native path, when compiling js components.
for bug 85968.  r=dbradley, sr=shaver
2001-06-29 02:20:48 +00:00
nboyd%atg.com a3ebe88fb9 Subject:
Rhino: speed optimization in omj/Interpreter.java
        Date:
             Tue, 26 Jun 2001 21:06:56 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




Hi, Norris!

The attached Interpreter_patch contains a speed optimization patch that
tries to avoid creation of Double objects by keeping a parallel stack
for double values: instead of putting Double to the stack, DBL_MRK is
put and the real value is put to double stack (sDbl). Then when reading
stack with DBL_MRK, the double value from the double stack is used
wrapped to Double object when necessary. In addition local and vars
arrays are merged to stack array.

The attached before.txt and after.txt contain results of typical runs of
mozilla/js/benchmarks/all_bench.js before and after optimization on my
PC: Athlon 650/Red Hat 7.0/JDK 1.3.0 from Sun .

In number of cases the optimization actually slow down the executionby
5-10% (I guess due to the checks for DBL_MRK), but mostly it is a nice
sped up often by factor of 2 ot more with overall optimization win: 267
versus 218 seconds.

I guess it is possible to apply the same optimization to the optimizer
package, but in our browser we use strictly interpreter mode. Also by
changing signature of call/construct methods in Scriptable it is
possible to avoid creation of almost all objects currently allocated
during method calls, but that is for far future.

Regards, Igor
2001-06-28 14:28:19 +00:00
rginda%netscape.com 6a25bb3258 - not built -
Add isValid to jsdIScript
Add jsdIService::isOn
2001-06-28 07:47:22 +00:00
rginda%netscape.com 19f9333338 - not built -
declare and initialize new provate members in jsdScript, copy important script properties at jsdScript creation time, so they're around after Invalidate().
2001-06-28 07:47:04 +00:00
rginda%netscape.com f40fe785c4 - not built -
large changes to fix the following bugs:
82684, crash manually clearing breakpoint
*actually* clearing mValid in jsdScript::Invalidate fixed this one.

85636, assertions on quiting venkman
jsdService::Off now disconnects the hooks into JSD, to avoid calling back into js after that.  It also processes any pending script delete events that occurred during the last GC. The code to process the gPendingScripts list has been factored out of the gc callback.  Processing the dead script list allows us to properly finalize all of the jsdIScript object, which seems to clear up the "gc roots exist at shutdown" assertions.  In effect, these changes get rid of *all* of the jsd related assertions on exit.

Added isOn attribute to jsdIService.
Added isValid attribute to jsdIScript.  We now prefetch appropriate properties from the underlying JSDScript, so that it's available after the script is Invalidate()d

moved jsdService constructor to jsd_xpc.h

Save the runtime passed to OnForRuntime so we can use it to clear the GC Gallback in Off().
2001-06-28 07:46:36 +00:00
pschwartau%netscape.com 9c7a5c99bf Fixing bug that prevented -p option from working (user-specified path to test directory) 2001-06-25 21:04:02 +00:00
pschwartau%netscape.com b157dbb66e Added more cases to test. Also improved readability. 2001-06-23 19:22:07 +00:00
pschwartau%netscape.com a0bd092d95 Show "$0" for the global match. Also minor changes to improve readability. 2001-06-23 19:21:05 +00:00
pschwartau%netscape.com 872b7a18e4 Minor formatting change - 2001-06-23 00:48:31 +00:00
pschwartau%netscape.com a75120a825 Initial add. Regression test for bug 87231. 2001-06-23 00:42:39 +00:00
pschwartau%netscape.com 5298a496bc Replacing a return with a continue. Further readability improvements. 2001-06-23 00:41:58 +00:00
pschwartau%netscape.com d44f753a83 Added array-length check. Also improved readability; cleaned up whitespace. 2001-06-22 20:12:01 +00:00
waterson%netscape.com b74d6e1c8b Land STATIC_BUILD_20010612_BRANCH, which supports building mozilla with components statically linked into the executable, as well as 'meta modules' that combine components into uber-DLLs. 2001-06-20 20:21:49 +00:00
rginda%netscape.com 12ea62d4af bug 85355, XPCWrappedNative::ToString should sometimes yield '[object Foo]'. patch=dbradley, r=beard+me, sr=jst, a=dbaron.
Make .toString print [object <class>] instead of [object wrapped <classname>] for xpc wrapped objects with scriptable info.
2001-06-20 00:04:36 +00:00
rginda%netscape.com 6dda9ad7d9 bug 83864 "Access to Components.interfaces denied sometimes", patch=jband, r=dbradley+mstoltz, sr=jst, a=blizzard
Allow xpc wrappers to be created by default, relying on security checks to happen at call-time instead.
2001-06-19 23:39:30 +00:00
rginda%netscape.com 5a37561605 bug 85572, "Javascript Error for each message sent"; patch=jband, r=me, sr=vidur, a=asa
xpconnect had been printing it's large "js component threw exception" whenever chatzilla's socket code threw NS_BASE_STREAM_WOULD_BLOCK from it's streamprovider (a non-error nsresult, bah.)  This patch adds the exception to the "suppression list", to quiet the debug message.
2001-06-19 22:53:36 +00:00
nboyd%atg.com 83d7acfbb7 Hi Norris, Simon,
I looked into this somewhat and I noticed the following:

1) There is a bug in Interpreter.java, line 1695. It sets the variable "i" to
the line number of the special call, but overwrites it on line 1699.  It then
passes this value to ScriptRuntime.callSpecial
2) In "generateScriptICode" in Interpreter.java the variable
itsData.itsSourceFile fails to be set to itsSourceFile.  This causes a null
source file name to be passed to handleCompilationDone when "Widget.js" is
compiled.  That is why you
initially see "<stdin>, line 6" when the debugger comes up (the debugger
interprets a null source name as "stdin").  I simply modified it as follows
(this might not be the right thing to do?):

  private InterpretedScript generateScriptICode(Context cx,
                                                  Scriptable scope,
                                                  Node tree,
                                                  Object securityDomain)
    {
        itsSourceFile = (String) tree.getProp(Node.SOURCENAME_PROP);
        itsData.itsSourceFile = itsSourceFile;
        ...

and that corrected the problem.

However there seems to be no way for the debugger to detect that the script
passed to handleCompilationDone() is the argument of an "eval()". So I modifed
NativeGlobal.evalSpecial() to munge the filename to indicate this (by appending
"(eval)" to it).  That way a separate window is created in the debugger to hold
the compiled eval code.  This is probably not be the best way to solve the
problem.

I have attached the files I modified.

Cheers,

Chris

Simon Massey wrote:

> Christopher,
>
> Attached is the code that trips the debugger up. The debugger comes up. You
minimize the console to reveal Widget.js file window. You click 'Go'. The
Widget.js window looses all the code in it and is just replaced by the evaluated
code:
>
>   this.invokedByEval()
>
> The rhino tip I have is rhino15R2pre.zip
>
> I am running it with the command:
>
> start javaw org.mozilla.javascript.tools.debugger.JSDebugger -f Widget.js -f
Main.js
>
> using the JVM:
>
>   java version "1.3.0"
>   Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
>   Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
>
> on Win2k.
>
> Just in case you are wondering why on earth my code wants to do this, it is
because I want to do some introspection. The real Widget invokes all its methods
that have a particular substring in their names:
>
>         for( key in this ){
>                 if( key.indexOf('reflect') == 0 ){
>                         var evalStr = "this."+key+"()";
>                         eval(evalStr);
>                 }
>         }
>
> Thanks for the great code. I have the real Widget stabilized and am happily
using the debugger on my other files.
>
> Thanks again!
>
> Simon Massey
>
2001-06-19 19:27:21 +00:00
cls%seawood.org bf5fb48486 Replaced NO_SHARED_LIB & NO_STATIC_LIB with BUILD_SHARED_LIBS, BUILD_STATIC_LIBS, FORCE_STATIC_LIB & FORCE_SHARED_LIB. Added FORCE_USE_PIC.
Changes allow us to have a finer control over which parts of the tree are built with PIC.  Part of the static build branch landing.
Bug #46775 r=mcafee a=leaf
2001-06-18 22:10:38 +00:00
pschwartau%netscape.com 691e16fb4d Further improvements to readability. 2001-06-17 23:31:11 +00:00
pschwartau%netscape.com 373ea16a0f Improved readability. 2001-06-17 23:12:31 +00:00
pschwartau%netscape.com 1c9b18876e Whitespace cleanup - 2001-06-14 19:53:47 +00:00
pschwartau%netscape.com 5801aec282 Adding another case to the test. 2001-06-14 18:27:06 +00:00
pschwartau%netscape.com 1c13d9e2da Initial add. Regression test for bug 85880 against Rhino. 2001-06-14 18:03:42 +00:00
nboyd%atg.com 114f43ccd6 Replace instances of append("x") with append('x') on StringBuffers,
removing the need for String object instances.
2001-06-14 17:42:44 +00:00
nboyd%atg.com e361382eb3 Mark deprecated. 2001-06-14 17:40:00 +00:00
nboyd%atg.com 2b5795b8f3 Subject:
jsdoc.js - added simple support for methods
   Date:
        Thu, 14 Jun 2001 09:12:26 +0100 (GMT Daylight Time)
   From:
        Simon Massey <simon_massey@hotmail.com>
     To:
        <nboyd@atg.com>






First off let me say thanks a lot for rhino. It is a really excellent piece
of software.

I am writing a large piece of js for making Excel2000 htm interactive on IE
and other browser such as Netscape6. Use a alot of code OO using methods
along the lines of:

  /**
   * Constructor
   */
  function Type(x){
   this.x = x;
  }

  /**
   * Method
   */
  Type.prototype.getX = function(){
   return x;
  }

  var type = new Type('a');
  var a = type.getX();

I have added to jsdoc.js so that finds and documents the method
declarations.

Attached is my modified jsdoc.js and a sample of the html that it generates
for the some of our proprietry :-( "Axel" code.

As an aside have you seen the job that www.blox.com have done on making a
dhtml spreadsheet? Bet they wished they could use exceptions in Netscape4!

Looking forward to the production JSDebugger. The tip version is great. It
does however seem to trash the view that it has of a file when an eval call
is made in that file. Is there a work around or will I have to wait till
the production version?

Thanks Again!

Simon Massey
2001-06-14 17:38:37 +00:00
nboyd%atg.com 374c7af66a Fix bug 85880 2001-06-14 17:37:18 +00:00
jband%netscape.com 8c82e35ad2 fix SunOs bustage with a .get() on AutoMarkingPtr 2001-06-13 02:16:29 +00:00
jband%netscape.com 623c123aab fix bug 59751 and bug 84600. This adds an AutoMarkingPtr scheme to protect partially built objects from gc. Also make sure we don't allow JS object to implement non-scriptable interfaces. r=dbradley sr=brendan a=drivers 2001-06-13 01:22:32 +00:00
Xiaobin.Lu%eng.Sun.com 49d51102b3 Fix for bug 74482, Calling top.window.close does not work
work done by Nikolay and me
r=beard sr=brendan a=asa
2001-06-13 01:04:29 +00:00
Xiaobin.Lu%eng.Sun.com 0c12dc94c8 Fix for bug 74482, Calling top.window.close() does not work
Work done by Nikolay and me
r=beard sr=brendan a=asa
2001-06-13 01:03:25 +00:00
nboyd%atg.com c6c8d7500a Names should be final. 2001-06-12 20:35:48 +00:00
nboyd%atg.com bf31ffb5f8 Add archive info 2001-06-11 14:16:18 +00:00
pschwartau%netscape.com 11b72244c8 Allow user-defined exit codes: fixed bug that was preventing this from working. 2001-06-08 22:05:32 +00:00
Xiaobin.Lu%eng.Sun.com 82a75c2a2f Fix for bug 77600
r=beard, sr=brendan, a=blizzard
2001-06-07 16:20:50 +00:00
nboyd%atg.com 665e7e9e9e This adds the hasFeature method to Context and modifies
NativeDate.getYear to use
cx.hasFeature(Context.FEATURE_NON_ECMA_GET_YEAR) for the behavior check.
2001-06-07 16:09:57 +00:00
nboyd%atg.com 1e71ac75ba Clean up classloader usage to use the thread's context class loader. 2001-06-07 16:04:33 +00:00
brendan%mozilla.org 3dced335a3 Fix duplicate switch case detector bugs (83532, rogerl's patch, sr=jband, sr=brendan, a=chofmann). 2001-06-06 23:28:29 +00:00
pschwartau%netscape.com 1108eb2b5f Thanks to rginda, a better fix for the previous issue - 2001-06-06 22:15:13 +00:00
pschwartau%netscape.com b72d3721bf Improvement on last patch: make distinction between HTML vs. console failure output. 2001-06-06 16:52:20 +00:00
valeski%netscape.com 5892765fc6 r=chak, sr=vidur, a=tor. 82000. removing unused arg from nsICategoryManager. 2001-06-05 21:25:57 +00:00
pschwartau%netscape.com 8cc759fb23 Initial add. 2001-06-05 20:56:40 +00:00
pschwartau%netscape.com 80f20e863c Making test a little more demanding - 2001-06-05 20:56:07 +00:00
nboyd%atg.com fb69c14ae4 Patches from Igor:
-----
The patch adds to NativeArray.put a check for (this == start) so the
length field or a dense array element would not be updated if this !=
start. The following script exposes the problem:


function Test() { }

var array = new Array(0, 0); // Trigger dense mode
Test.prototype = array;

var test = new Test();

array[0] = 1;
test[0] = 2;

print(array[0]); // Should print 1, not 2
-----
When initially I switched NativeDate to use IdScritable, I made
toGMTString just an alias to toUTCString. Later I realized that it could
cause troubles if someone would check Date.prototype.toGMTString.name to
get "toUTCString" so I made the code to allocate a separated IdFunction
to toUTCString. Now when I read ecma 3 appendixes I see that the initial
behavior is what actually Ecma 3 requires. Here is an extract from B.2.6:

The Function object that is the initial value of
Date.prototype.toGMTString is the same Function
object that is the initial value of Date.prototype.toUTCString.

Sometimes doing nothing is the best solution...

The attached patch fixes that and inlines many 1-3 lines functions as
optimization that java compilers typically do not want to do...
2001-06-05 17:39:58 +00:00
pschwartau%netscape.com 971aeaeabb Initial add. 2001-06-05 01:28:04 +00:00
pschwartau%netscape.com f553a16ec4 Added two new sections to the test. 2001-06-05 01:26:59 +00:00
jband%netscape.com 2544c71288 fix bug 84020 - don't override the context global, bug 83367 - add deferred Release of natives of wrappednatives to avoid nesting into js_AllocGCThing during JS gc, and bug 82274 - fix a little leak (patch from dbradley). sr=jst r=dbradley a=drivers 2001-06-05 00:59:53 +00:00
jband%netscape.com ea41e651fd fix bug 78428 by making sure to use the lesser of the freeslot or nslots value when marking slots. This is necessary because objects can now be in an initial state where the freeslots is a larger number than the nslots - and the actual number of slots in the array. sr=brendan r=beard a=drivers 2001-06-05 00:47:56 +00:00
jband%netscape.com 6de619c0b1 fix bug 82034 by making wrapped Java objects be not JS natives again but with their own slot accessors. This should bring JS -> Java communication back to life. sr=brendan r=beard a=drivers 2001-06-05 00:39:13 +00:00
cls%seawood.org 2d4ce763e3 Handle cygwin & mks uname output on win32.
Bug #72154 r=pschwartau@netscape.com a=asa@mozilla.org
2001-06-05 00:08:21 +00:00
nboyd%atg.com 8214f675ca The patch applies the following optimization to TokenStream:
1. Keyword search via Java Hahstable is replaced by explicit "switch"
code generated by idswitch tool. It not only speed up keyword search and
eliminates all Integer objects created to hold keyword tokens and
corresponding Hahstable structures, but it also reduces code size due to
very poor array initialization support in JVM.

2. It replaces the isXDigit method by xDigitToInt that either converts
its argument to 0..15 or returns -1 if it is not a hex digit and updates
the method usage accordingly The patch updates NativeGlobal.js_unescape
to reflect this usage change.
2001-06-04 13:59:30 +00:00
nboyd%atg.com 1f68a2a9d8 Have doc reference nested apidocs. 2001-06-04 13:58:51 +00:00
nboyd%atg.com 65691a4f92 Add skip for bug 83051 2001-06-04 13:55:22 +00:00
pschwartau%netscape.com 63594bdfb4 Intial add. Regression test for bug 83532. 2001-06-01 23:56:58 +00:00
nboyd%atg.com 9249a305b5 Add new CounterTest example. 2001-06-01 15:26:45 +00:00
jband%netscape.com e86547342e NOT PART OF ANY BUILD - adding a test case for use in demonstrating a crash to be fixed 2001-05-31 18:13:26 +00:00
nboyd%atg.com 69580206c7 Patch from Igor:
In the attached patch I added documentation, did some inlining in the
get method implementation to gain some speed and overrode defineProperty
so it plays better with id-based properties.
2001-05-31 14:44:21 +00:00
pschwartau%netscape.com 064cfddeff Improving the error-reporting mechanism to include bug number and status lines. 2001-05-31 00:17:45 +00:00
pschwartau%netscape.com 6137d538b5 In this test, it's important to reportCompare() the other cases before the last case is attempted. Do not store results in an array. 2001-05-30 23:29:29 +00:00
pschwartau%netscape.com 72612b689d Initial add. Regression test for bug 83293. 2001-05-30 22:10:37 +00:00
nboyd%atg.com 1be6c5fc8f For backwards compatibility keep an old method name used by
Batik and possibly others.
2001-05-30 17:29:42 +00:00
pschwartau%netscape.com bc9dcf60de Correcting error in InLeapYear() function. 2001-05-29 16:27:45 +00:00
pschwartau%netscape.com 2d07cee32a Correcting mistake in InLeapYear() function. 2001-05-29 16:22:23 +00:00
pschwartau%netscape.com 071bfdca3c Correcting mistake in InLeapYear() function. 2001-05-29 16:13:56 +00:00
pschwartau%netscape.com 660421114a Correcting a mistake in InLeapYear() function. 2001-05-29 16:10:58 +00:00
nboyd%atg.com 481aa41f03 Add new FAQ, remove obsolete one. 2001-05-29 15:11:17 +00:00
nboyd%atg.com 8b34980fb3 Patches from Igor:
-----
The patch fixes a bug in getIds method where the assignment "result =
tmp" was missed, adds the public method activateIdMap(int maxId) to
IdScriptable and changes setAttributes method not to allow setting of
attributes that are less restrictive then ones returned by
getIdDefaultAttributes. That was supposed to be the case and the patch
makes it explicit.
-----
The patch makes BaseFunction.setImmunePrototypeProperty public so it can
be called from other packages (regexp).
-----
The patch switches NativeRegExp and NativeRegExpCtor to use
IdScriptable. It also changes code in a few places to passes Context and
RegExpImpl directly instead of using Context.getCurrentContext().

The patch also fixes a bug when

for (var i in RegExp) { print(i); }

would not include $1..$9 in the output in violation with Ecma. It was
caused by not overriding ScriptableObject.getIds in
NativeRegExpCtor.
2001-05-29 14:07:49 +00:00
beard%netscape.com ab5da9f316 Added mozilla/js/rhino/src/org/mozilla/javascript/BaseFunction.java source file. 2001-05-29 13:48:46 +00:00
pschwartau%netscape.com 23f4943fd8 Minor whitespace fix. 2001-05-28 22:47:14 +00:00
pschwartau%netscape.com 708ad8da18 Initial add. 2001-05-28 22:46:31 +00:00
nboyd%atg.com d589083a1e Patches from Igor:
-----
The patch changes NativeCall to use IdScriptable. This is done mostly
for uniformity with other Native* classes plus it would allow to call
NativeCall.init directly and make NativeCall package private.
-----
The patch changes NativeScript to use id-based properties. Due to
inheritance from NativeFunction, id support requires to take into
account the fact that there are instance ids available from
BaseFunction. This is the reason to use "int prototypeIdShift" instead
of "boolean prototypeFlag" so it can store instance id offset.

The patch updates ScriptRuntime.callOrNewSpecial to check against
IdFunction and not FunctionObject for the Script exec method where it
also add finally clause to make sure that Context.exit would always be
called after Context.enter in the evalScript method.
-----
After converting NativeScript and NativeFunction to use IdScriptable,
they get scope argument directly as a parameter of execMethod call, so
cx.ctorScope is not used any more. The patch removes code to set/unset
cx.ctorScope.
-----
[This patch depends on conversion of NativeScript and NativeCall to use
IdScriptable and the patch to remove access of ctorScope from
FunctionObject]

The patch changes Context.initStandardObjects to call NativeCall.init
and NativeScript.init directly plus it unrolls the lazily initialization
loop. Due to rather poor support of an array initialization in Java byte
code, it actually decreases code size while eliminating are creation of
array object. The patch also removes ctorScope field as unused.
-----
The patch makes sure that ids used by NativeGlobal are visible only in
the object instance that initializes global scope and removes some junk
white space at line ends.
-----
To use the idswitch tool to generate map for strings that can not be
part of Id_ Java identifier like $*, I added code to the tool to look
for "// #string=...#" in the id definition line. The attached README
file also contains some documentation about the tool and should go to
idswitch directory.

The patch was made from toolsrc/org/mozilla/javascript/tools via:
cvs diff -u > idswitch_patch
2001-05-25 13:24:17 +00:00
brendan%mozilla.org 769e09a93e - Add a generation number to JSDHashTable that counts entryStore changes due
to grows, shrinks, and compresses.  This helps JS_DHashTableOperate callers
  who hold returned entry pointers to validate those pointers and avoid having
  to re-lookup an entry by its key.
- Balance that addition by removing JSDHashTable.sizeMask, which is induced by
  JSDHashTable.sizeLog2 at the cost of two typically single-cycle instructions.
- Use JSDHashTable.generation in jsobj.c to avoid unsafely dereferencing an
  entry pointer held across calls to JSClass.resolve from js_LookupProperty,
  which may recur and add entries to cx->resolving, growing that table and
  invalidating entry pointers held by earlier js_LookupProperty activations.
(bug 78121, r=jst@netscape.com, sr=jband@netscape.com, a=asa@mozilla.org)
2001-05-25 03:05:38 +00:00
nboyd%atg.com c23c5d3729 Patches from Igor:
----
The patch changes Notification to extend from BaseFunction and adjusts
Context, FunctionObject and NativeScript accordingly.
----
The patch changes BaseFunction.jsConstructor to use the scope argument
passed to execMethod instead of using cx.ctorScope. This argument is
null in this case because when calling execMethod IdFunction.construct
does not set cx.ctorScope because scope is passed to execMethod as argument.
2001-05-24 13:38:12 +00:00
pschwartau%netscape.com 4c787095dc Adding attribution to Mike Epstein, creator of this test. 2001-05-23 23:01:08 +00:00
pschwartau%netscape.com bd8d3a3346 Initial add. Regression test for bug 82306. 2001-05-23 22:47:48 +00:00
brendan%mozilla.org 3ce3840561 Fix failure to round up in chunked realloc test in AddCharsToURI (82306, r=rginda, sr=scc). 2001-05-23 06:49:19 +00:00
brendan%mozilla.org 80d36b42b2 Add intern help message, caught by epstein@tellme.com (not part of build). 2001-05-23 06:13:13 +00:00
brendan%mozilla.org 8952a0a28f Lazily pin the less likely atoms when resolving standard class names (77861, r=jst, sr=jband). 2001-05-23 04:02:06 +00:00
jband%netscape.com 1f119bd32a fix bug 82220. enumeration of Components.interfaces should only include scriptable interfaces. r=vidur sr=jst 2001-05-23 00:12:04 +00:00
rginda%netscape.com 3fac831047 create a dummy stack frame before calling out to the new-script-hook. The dummy frame prevents the script from being affected by any GC the hook may trigger. See bug 77636. author=shaver, r=me, sr=brendan 2001-05-22 23:57:37 +00:00
brendan%mozilla.org e46d5f7fc4 Warning abatement (r=polarbear, sr=lumpy). 2001-05-22 23:25:18 +00:00
nboyd%atg.com 0aa0daf081 This patch renames in IdFunction the methodName field into functionName
and ads getFunctionName method to match NativeFunction.
2001-05-22 12:51:21 +00:00
nboyd%atg.com a388953fef This patch fixes the bug when global With object was set to With
prototype and not With constructor, makes id for constructor property
visible only in a prototype instance and removes the unused scopeInit
function.
2001-05-22 12:51:02 +00:00
nboyd%atg.com 357263c927 The patch adds new class org.mozilla.javascript.BaseFunction as a base
for classes implementing the Function interface and switch
IdFunction.java to use it. The code in BaseFunction to serve as
Function.prototype is not used yet. The patch modifies NativeCall so it
can be used against BaseFunction.

The patch was made from org/mozilla directory via
diff -uN javascript.0 javascript > BaseFunction_patch
2001-05-22 12:50:26 +00:00
scc%mozilla.org ced4be648e ok, but make this local bustage fix into a global one 2001-05-22 08:43:30 +00:00
scc%mozilla.org 63395b4d88 Fixing AIX/BeOS bustage. The statically determined length of the string was |0|, and on these ports, that was erroneously considered a candidate for conversion to a pointer, which made selection of the appropriate constructor for |nsDependentString| ambiguous ... go figure. 2001-05-22 08:02:58 +00:00
scc%mozilla.org c9eeb0d1ec Fixing AIX/BeOS bustage. The statically determined length of the string was |0|, and on these ports, that was erroneously considered a candidate for conversion to a pointer, which made selection of the appropriate constructor for |nsDependentString| ambiguous ... go figure. 2001-05-22 07:25:25 +00:00
jband%netscape.com 90b7fefa54 - Fix bug 81341. Force creation of a WrappedJS around the JSObject of
aWrappedNative when doing aggregation. r=dradley sr=jst.
- Fix bug 81877. Avoid infinite recursion when reporting threadsafety
error. r=perterv,dradley sr=jst.
- Fix bug 81882. Use JS_AddNamedRootRT in XPCWrappedNative::AddRef to avoid
the unnecessary cost of creating an XPCCallContext in this frequently called
method. r=dbaron,dbradley sr=jst.
2001-05-21 22:45:14 +00:00
nboyd%atg.com e4294421c9 This patch changes NativeError.java to store message and name properties
in fields of the object itself instead of using the standard property
hashtable in ScriptableObject.java. This saves 3 object instances per
NativeError (2 slot entries and hashtable array itself) and given the
fact that NativeGlobal defines a few permanent Error instances, it is
visible saving even after taking into account code size increase.

The change also gives a good test of IdScriptable implementation.

-----

This patch introduces the uniform decompile method for NativeFunction
and IdFunction with the signature:

public String decompile(Context cx, int indent, boolean justbody)

instead of NativeFunction.decompile(int indent, boolean toplevel,
boolean justbody) and IdScriptable.toStringForScript(Context cx) and
replaces the special treatment of NativeJavaMethod in
NativeFunction.jsFunction_toString by overriding decompile in
NativeJavaMethod

-----

This patch adds getFunctionName to NativeFunction to return function
name and replaces few places with jsGet_name usage by getFunctionName

The patch was made via
diff -ru javascript.0 javascript > name_patch
from org/mozilla directory
2001-05-21 15:04:54 +00:00
rginda%netscape.com 8a96b5310f - not built -
add enumerateScripts() method to jsdIDebugger service
don't create a new debugger context if the user trys to call on[ForRuntime]() multiple times
2001-05-21 07:18:10 +00:00
rginda%netscape.com faa84321f8 - not built -
add onForRuntime() method to jsdIDebuggerService to let native code turn on the deubgger (on() can only be called from js)
register an app-start observer so we can turn on the debugger at startup if "js.debugger.autostart" pref is true.
r=peterv, bug 81840
2001-05-21 06:00:12 +00:00
nboyd%atg.com 35caf7c2bb Subject:
Rhino: behavior update for IdScriptable subclasses
        Date:
             Fri, 18 May 2001 11:45:00 +0200
       From:
             Igor Bukanov <igor.bukanov@windriver.com>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The attached patch introduces separation between id-base properties in
prototype instances and the rest of objects so it is possible to
allocate some ids for each instance and the rest only for prototype. The
patch adds to each descendants of IdScriptable a special prototypeFlag
which set to true only if object serves as a global prototype and all
methods that check/return ids first check for that flag. (This is the
reason for the patch size: diff is not very well in dealing with
indentation changes.)

In this way ids for prototype properties are completely hidden from
potential subclasses and there is no need to define methods like
getMaximumId in most cases, only if some ids present in each instance,
IdScriptable.maxInstanceId should be overridden to return max id present
in each instance.

The patch also replaces 2 boolean fields in IdScriptable by bit masks in
the setupFlag field.
2001-05-19 17:39:50 +00:00
jst%netscape.com 77aeecc056 scc checking in from jst's account. bug #75220: sr=jst, rs=brendan. renaming |nsPromiseC?Concatenation| to |nsDependentC?Concatenation|; |nsPromiseC?Substring| to |nsDependentC?Substring|; |nsLiteralC?String| and |nsLocalC?String| to |nsDependentC?String|, as these new names better reflect clients obligations to instances. 2001-05-19 11:27:30 +00:00
jband%netscape.com a698fad77c fix bug 49017. This extends our mapping of idl [function] interfaces so that they will try to treat the JSObject as a callable function (as before), but if the JSObject is *not* a function object then xpconnect will fall back to the non-[function] behaviour of trying to lookup a named function on the JSObject and then call that. r=jst sr=brendan,vidur,jst,(and everyone else I guess) 2001-05-18 23:35:03 +00:00
jband%netscape.com 040526f65b fix bug 81542. Reorder interface methods so that they do not break compatibility with previously deployed plugins that work with previous versions of our software. The error was that I moved some around at all rather than just adding them to the end of the interfaces! Also, I added back in one method and marked it deprecated. r=dbradley sr=jst 2001-05-18 23:30:28 +00:00
jband%netscape.com 15b0e60bb7 fix bug 81436. Some Solaris compilers screwup symbol resolution if there is a file scope var that is also declared as extern. So we'll just make it not declare these two static (thses are not names that is going to conflict with anything!) r=timeless rs=jband 2001-05-18 23:24:19 +00:00
pschwartau%netscape.com d52ddf6b10 Improve code by using the apply method of Object.prototype.toString. 2001-05-18 23:20:25 +00:00
nboyd%atg.com 81543cd446 Fix problem in the following mail:
Subject:
             Embedding Rhino in an Applet
 Resent-Date:
             Thu, 17 May 2001 14:53:05 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             Thu, 17 May 2001 16:39:14 -0700
        From:
             "Chester Kustarz II" <chester@monkey.org>
 Organization:
             monkey.org
          To:
             mozilla-jseng@mozilla.org
  Newsgroups:
             netscape.public.mozilla.jseng




Hello, I am trying to find a scripting language with an interpreter that I
can embed in an applet in order to run test scripts inside the applet. I
have already tried TCL-based Jacl and they do not support running inside an
applet. I then downloaded the Rhino/JS interpreter but am having trouble
getting it to run inside the browser (IE 5.5). Here is the exception I am
getting:

com.ms.security.SecurityExceptionEx[org/mozilla/javascript/ScriptRuntime.<cl
init>]: Reflective access to class java.lang.Thread prohibited.
 at com/ms/security/permissions/ReflectionPermission.check
 at com/ms/security/PolicyEngine.deepCheck
 at com/ms/security/PolicyEngine.checkPermission
 at com/ms/security/StandardSecurityManager.chk
 at com/ms/security/StandardSecurityManager.checkMemberAccess
 at java/lang/Class.checkMemberAccess
 at java/lang/Class.getDeclaredMethod
 at org/mozilla/javascript/ScriptRuntime.<clinit>
 at org/mozilla/javascript/ScriptableObject.getExclusionList
 at org/mozilla/javascript/ScriptableObject.defineClass
 at org/mozilla/javascript/Context.initStandardObjects
 at org/mozilla/javascript/Context.initStandardObjects
 at RhinoShellApplet.init
 at com/ms/applet/AppletPanel.securedCall0
 at com/ms/applet/AppletPanel.securedCall
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.run
 at java/lang/Thread.run
com.ms.security.SecurityExceptionEx[org/mozilla/javascript/Context.initStand
ardObjects]: Unable to access system property:
org.mozilla.javascript.JavaAdapter
 at com/ms/security/permissions/PropertyPermission.check
 at com/ms/security/PolicyEngine.shallowCheck
 at com/ms/security/PolicyEngine.checkCallersPermission
 at com/ms/security/StandardSecurityManager.chk
 at com/ms/security/StandardSecurityManager.checkPropertyAccess
 at java/lang/System.getProperty
 at org/mozilla/javascript/Context.initStandardObjects
 at org/mozilla/javascript/Context.initStandardObjects
 at RhinoShellApplet.init
 at com/ms/applet/AppletPanel.securedCall0
 at com/ms/applet/AppletPanel.securedCall
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.run
 at java/lang/Thread.run
2001-05-18 15:31:49 +00:00
rogerl%netscape.com 0569433dd3 Fix bug #76054. sr=brendan, r=beard. Generate lower case tags for all the
string tagify'ing helper functions like 'big()' etc. to be XHTML compliant.
2001-05-17 21:37:33 +00:00
nboyd%atg.com 26ebaa0c66 Fix bug 80322. 2001-05-17 19:02:55 +00:00
pschwartau%netscape.com 33c326091d Skipping two new tests with large switch statements. See bug 81086. 2001-05-17 18:52:43 +00:00
nboyd%atg.com f269df764c Mail gateway info. 2001-05-17 18:36:59 +00:00
jband%netscape.com c787e7883d fix bug 81117. allow unsecure access to creating xpconnect wrappers around nsXPCException objects and expose the 'code' property. This saves us from cryptic errors in the JSConsole and DOMExceptions that don't work. r=mstoltz sr=jst 2001-05-17 18:25:06 +00:00
nboyd%atg.com 9214262d1e Just remove commented-out "final". 2001-05-17 17:29:19 +00:00
beard%netscape.com 931e7db74c bug #77856, r/sr=brendan. 2001-05-17 05:45:51 +00:00
beard%netscape.com 342ec29546 bug #77247, r/sr=brendan 2001-05-17 05:42:18 +00:00
vidur%netscape.com 9cbca7b906 Reverting bogus assert. r/sr=brendan,jband 2001-05-17 04:55:49 +00:00
brendan%mozilla.org a10d5eb5aa Unified resolve recursion damping (70358) and resolve-from-js_SetProperty (72354), r/sr=jband,jst,shaver. 2001-05-17 01:43:58 +00:00
brendan%mozilla.org 768db649d4 STORE_NUMBER's final param must be a jsdouble; fix INTEGER_OPs (81245, r=rogerl, sr=jband). 2001-05-17 01:40:32 +00:00
pschwartau%netscape.com 2f26b642b4 Whitespace cleanup. 2001-05-16 22:45:11 +00:00
brendan%mozilla.org 69dc0b2e55 Fix ChangeTable and how it's called (74883, r=gordon, sr=waterson, mcafee approved). 2001-05-16 21:41:52 +00:00
pschwartau%netscape.com 5c77296fee Initial add. Regression test for bug 76054 in SpiderMonkey and bug 78706 in Rhino. 2001-05-16 19:01:42 +00:00
nboyd%atg.com e4c32e2c7b Fix bug 78706 2001-05-16 14:07:00 +00:00
Xiaobin.Lu%eng.Sun.com f56cbe2af5 r=timeless sr=shaver
bug 72807 "c++ style comment warning"
2001-05-16 02:24:44 +00:00
beard%netscape.com 57509c3b22 Removed:
ScopeInitializer.java
2001-05-16 01:10:19 +00:00
nboyd%atg.com 937f24e4f6 2 additional issues:
1. In that patch I forgot to remove "import org.mozilla.classfile.*" and
simply catch Exception in newInvokerMaster which is not a good practice.
The attached patch FunctionObject_patch fixes that and removes other
unused imports.

2. In org.mozilla.classfile.DefiningClassLoader defineClass method first
tries to call via ClassManager the defineClass method in a class loader
that loaded DefiningClassLoader itself. But this would define new
classes in that class loader so they would not be subject of the garbage
collection until a classloader that loads DefiningClassLoader would go
away even if a DefiningClassLoader instance is gone. The
DefiningClassLoader_patch removes that and simply calls super.defineClass.

The patch also change the order of class search in loadClass so the
loader first looks for a class among its defined classes and only after
that in parent loaders.

Regards, Igor
2001-05-16 00:24:37 +00:00
pschwartau%netscape.com 8cd2f18bd6 Initial add. Regression test for bug 74474. 2001-05-15 22:01:39 +00:00
pschwartau%netscape.com 6f0798186c Renaming this file as regress-74474-001.js 2001-05-15 22:00:42 +00:00
brendan%mozilla.org 38fa3fed08 Add optional JSDHashTableOps.initEntry hook, spruce up comments (74883, r=waterson, sr=shaver). 2001-05-15 21:07:10 +00:00
sfraser%netscape.com 55b0ea662e Testing, NOT PART OF ANYTHING 2001-05-15 20:57:01 +00:00
rginda%netscape.com 067d9585e8 bug 76050, use the same module name across the module. Fix senna bustage. r=cls 2001-05-15 20:40:43 +00:00
rginda%netscape.com 9950211597 bug 76050, fix REQUIRES for jsd unix makefile. r=cls 2001-05-15 20:39:35 +00:00
rginda%netscape.com 0bcd7aac66 bug 76050, build js/jsd from toplevel makefile so we're sure we've got an xpidl compiler. r=cls 2001-05-15 20:38:26 +00:00
brendan%mozilla.org 1f8f87f711 Re-init pinned atoms after 1=>0=>1 contexts-in-runtime transition (80619, sr=jband&shaver). 2001-05-15 19:39:16 +00:00
jband%netscape.com d1b40ba84e remove commented out code 2001-05-15 19:15:30 +00:00
nboyd%atg.com f7417f7060 2 additional issues:
1. In that patch I forgot to remove "import org.mozilla.classfile.*" and
simply catch Exception in newInvokerMaster which is not a good practice.
The attached patch FunctionObject_patch fixes that and removes other
unused imports.

2. In org.mozilla.classfile.DefiningClassLoader defineClass method first
tries to call via ClassManager the defineClass method in a class loader
that loaded DefiningClassLoader itself. But this would define new
classes in that class loader so they would not be subject of the garbage
collection until a classloader that loads DefiningClassLoader would go
away even if a DefiningClassLoader instance is gone. The
DefiningClassLoader_patch removes that and simply calls super.defineClass.

The patch also change the order of class search in loadClass so the
loader first looks for a class among its defined classes and only after
that in parent loaders.

Regards, Igor
2001-05-15 16:58:08 +00:00
beard%netscape.com 389c07ab3f Removed: src/org/mozilla/javascript/optimizer/JavaScriptClassLoader.java Added: src/org/mozilla/javascript/optimizer/InvokerImpl.java src/org/mozilla/classfile/DefiningClassLoader.java 2001-05-15 15:41:44 +00:00
nboyd%atg.com 1f98cf7a77 New file, mostly moved from org.mozilla.javascript.optimizer.JavaScriptClassLoader 2001-05-15 13:12:43 +00:00
nboyd%atg.com 0068a15b8a Norris Boyd wrote:
> Igor Bukanov wrote:
>
>
>>Norris Boyd wrote:
>>
>>
>>>The intention was to keep classfile and JavaAdapter optional. Those
>>>dependencies crept in. We can use Invoker optionally--perhaps I should do
>>>some performance numbers to see if it's worth it.
>>>
>>I implemented that patch, it splits Invoker.java into Invoker.java and
>>its implementation in optimizer/InvokerImpl.java The reason to put it
>>into optimizer package is that Invoker is very similar in spirit to
>>NativeScript: it generates classes to speed up access and in this way
>>there is no need to have separated option not to use: one can simply
>>remove optimizer all together.
>>
>
> Yes, that sounds great.
>
>
>>
>>I noticed during implementation that JavaAdapter.DefiningClassLoader and
>>optimizer/JavaScriptClassLoader contains the same code, so maybe they
>>can be moved to org.mozilla.classfile package under one name?
>>
>
> Yes, that sounds like a good change too. Thanks for noticing that.


The update is pretty messy: it touches FunctionObject which I changed to
remove the special treatment of NativeWith in the previous patch, and it
also add/removes files.

Here is a description:
DefiningClassLoader.java should go to org/mozilla/classfile. It is the
same code that was in omj/optimizer/JavaScriptClassLoader.java with
class rename and adding public attribute and correspondingly
omj.optimizer/JavaScriptClassLoader.java should be removed. I guess it
would be nice to preserve logs/history in CVS during the move.

InvokerImpl.java should go to omj/optimizer. It is mostly what
omj.Invoker was.

invoker_changes_patch was generated via
cvs diff -u Invoker.java JavaAdapter.java optimizer/Codegen.java
and contains changes against the current CVS

FunctionObject_invoker_patch was generated via
diff -u ../../mozilla.1/javascript/FunctionObject.java FunctionObject.java
and contains changes against that With patch.

Igor
2001-05-15 13:10:38 +00:00
rginda%netscape.com b5b65abbac fix to help senna tinderbox find PRClist 2001-05-15 07:55:34 +00:00
rginda%netscape.com 28c2019557 fix ports bustage 2001-05-15 07:42:58 +00:00
rginda%netscape.com c652047340 disable js debugger until I can figure out what's going on with shrike 2001-05-15 07:07:36 +00:00
rginda%netscape.com cb7748f0f6 bug 76050, js debugger unix make system changes, r=cls 2001-05-15 05:48:08 +00:00
nboyd%atg.com 928693eace The attached patch makes NativeWith to use IdFunction for its
constructor, removes the special treatment of the With object from
IdScriptable and FunctionObject, adds to IdFunction the
initAsConstructor method similar in spirit to
FunctionObject.addAsConstructor (it is called now from IdScriptable and
NativeWith) and replaces in Context.java lazy initialization of
NativeWith by direct call of NativeWith.scopeInit.
2001-05-15 01:17:51 +00:00
pschwartau%netscape.com fe98044ab1 Whitespace cleanup - 2001-05-15 00:08:27 +00:00
rginda%netscape.com 61cec05b74 - not built -
add required libraries to unix make
2001-05-14 21:59:01 +00:00
beard%netscape.com 0e8873338f Added idswitch tool sources. 2001-05-14 06:52:39 +00:00
beard%netscape.com 541d6af0f6 Added IdFunctionMaster.java to keep Mac build working. 2001-05-14 06:48:07 +00:00
rginda%netscape.com aecc360194 - not built -
check for valid PC in ClearBreakpoint
Lock script subsystem while clearing all breakpoints
2001-05-13 21:08:06 +00:00