Commit Graph

5273 Commits

Author SHA1 Message Date
igor%mir2.org
a803853242 Fixing line-table initialization issue: set itsLineNumberTableTop to 0 at the end of stopMethod so generation of multiple methods with source line information would work. 2003-08-22 09:10:14 +00:00
caillon%returnzero.com
f8e8aed8a7 Backing out the patch to bug 83536.
I will reland this when 1.6a re-opens.
r+sr=jst@netscape.com
a=chofmann
2003-08-22 03:06:53 +00:00
igor%mir2.org
9983fdb0e8 Cosmetics: removal of end-of-line blanks 2003-08-20 11:11:00 +00:00
igor%mir2.org
9be83bb44c Splitting Codegen into 2 Codegen and BodyCodegen where the second class contains code to generate butecode for the body of script. 2003-08-20 10:52:54 +00:00
igor%mir2.org
b6c1d3644c 1. Codegen.classNameToSignature is removed and call to the methods are replaced by cfw.classNameToSignature.
2. Calls to ClassFileWriter.fullyQualifiedForm are removed since all ClassFileWriter API accepts both dotted and slashed forms of Java class names.

3. Few identation fixes
2003-08-20 07:36:33 +00:00
igor%mir2.org
43cbf72f08 1. Added ClassFileWriter.classNameToSignature to convert Java class name into JVM signature.
2. The public method getFullyQualifieedForm that was used to replace . to / is removed since all classname API accepts both form of class names and convertion to the internal /-form can be done in ClassFileWriter in a more efficient way.
2003-08-20 07:32:48 +00:00
pschwartau%netscape.com
60a8469472 Correcting a typo. 2003-08-19 16:45:03 +00:00
pschwartau%netscape.com
19674c814c Initial add. Regression test for bug 216591. 2003-08-19 16:36:54 +00:00
igor%mir2.org
040923febc More renames and preparations for code split. 2003-08-19 15:37:50 +00:00
igor%mir2.org
32e0764d1c More preparations for separating code to generate main script method and the rest of methods. 2003-08-19 13:19:57 +00:00
igor%mir2.org
bd2594e6eb 1. Renaming Codegen.classFile to Codegen.cfw and removal of methods like push/load/store in favour of directly calling ClassFileMethods.
2. Move all code related to generating of prologue for main function implementation to Codegen.generatePrologue.

In this way the following patch to split Codegen into 2 classes to factor away all generation code for the main function will look smaller.
2003-08-19 08:21:36 +00:00
igor%mir2.org
810aa53fd8 Renaming [ilfda]load/store into add[ILFDA]Load/Store for consistency and moving package-private functions from ByteCode to ClassFileWriter so JVM does not need to load ByteCode since it includes only constants. 2003-08-19 08:15:33 +00:00
igor%mir2.org
ed64a67527 Replace few usages of Node.cloneNode by a more explicit code to create a fesh childless node copy. 2003-08-18 14:27:51 +00:00
igor%mir2.org
abefa99b1e Using simple Token.<op> instead of (Token.EQOP, Token.<op>) to denote parser nodes for equality operations. It allowed to remove sharing of Node.intValue to mean line number and operation type so it was renamed to Node.lineno. 2003-08-18 11:53:00 +00:00
igor%mir2.org
5f6517906c Added store/load function to shortcut add(ByteCode.x, i) 2003-08-18 11:49:39 +00:00
igor%mir2.org
041149139b Using simple Token.<op> instead of (Token.RELOP, Token.<op>) to denote parser nodes for relational operation. 2003-08-18 09:55:19 +00:00
igor%mir2.org
5be8c599eb Move code to classify binary and relation operation tokens to IRFactory so parser does not need to know about details of tree implementation. 2003-08-18 08:05:06 +00:00
igor%mir2.org
0ee771b8c2 Changing order of parameters in ScriptRuntime.instanceOf to match order in ScriptRuntime.in to use simpler code in optimizer. 2003-08-18 08:00:55 +00:00
igor%mir2.org
7c70d93492 Removal of unnecessary instanceOf: Scriptable does not have such method and Undefined does not need to override it. 2003-08-18 07:57:40 +00:00
cls%seawood.org
1b51ba858c Set MODULE in makefiles at the top of a heirarchy so that module-deps lists are more precise and builds will have the proper order if some subdirs contain other modules. 2003-08-16 00:42:35 +00:00
igor%mir2.org
fe402a8124 Make all convertions from == to === to support JavaScript 1.2 to single place in Parser 2003-08-15 16:48:56 +00:00
igor%mir2.org
b96ac683c8 Added explicit IRFactory.createIncDec to create ++/-- subtree which removed need to have Token.PRE/Token.POST. 2003-08-15 11:19:47 +00:00
igor%mir2.org
9fce703481 Removal of Token.UNARYOP: after the previous patches parse tree used Token.UNARYOP only to group Token.TYPEOF and Token.VOID into the same node type. Since they are very different, it is simpler to use the tokens directly as node type.
To remove ambiguity caused by re-use of Token.VOID to denote no-operation node, a new Token.EMPTY is added to denote the former usage.
2003-08-15 10:21:09 +00:00
igor%mir2.org
b63333276d Added Token.TYPEOFNAME to denote explicitly parser nodes for typeof(name) to make code more explicit about this case compared with typeof(expression) which is denote by Token.TYPEOF. Previously the ambiguity was resolved by using (Token.UNARY.OP, Token.TYPEOF) for parser tree nodes denoting the later and simple Token.TYPEOF for the former. 2003-08-15 09:00:42 +00:00
igor%mir2.org
7fdd9e85d1 Another replace of (Token.UNARYOP, Token.X) -> Token.X: this time it is for Token.BITNOT and Token.NOT 2003-08-15 08:11:32 +00:00
igor%mir2.org
09c327adc3 Changing Token.POS, Token.NEG to represent their parser tree nodes by the token themselves, not via pair Token.UNARYOP, POS/NEG. It simplifies code especially in optimizer/Optimizer.java 2003-08-15 07:15:07 +00:00
igor%mir2.org
9a1fbf3def Removal of Token.TONUMBER: it had exactly the same semantics as Token.POS, that is to convert its argument to number. 2003-08-15 06:08:44 +00:00
rginda%netscape.com
8f4d8cb810 bug 216112, "add ability to disable object tracking in jsd"
r=caillon, sr=brendan, a=asa

adds the ability to turn off the object tracking without having to disable the debugger.  should make a dormant venkman less of a performance impact.
2003-08-14 22:49:09 +00:00
igor%mir2.org
e1290d4dbb Removal of Token.PRIMARY: it was used in parser to group primary tokens such as false, true, null, this but since the semantic of them is very different it is simpler to create parse tree nodes directly from tokens and check only for node type, not for type and operation. 2003-08-14 14:49:46 +00:00
igor%mir2.org
13865e4143 Parser tree nodes of Token.CONVERT type are replaced by Token.TONUMBER and additional optimizer nodes to convert to double or object eliminating the need to distinguish them by Node.TYPE_PROPERTY. 2003-08-14 11:21:46 +00:00
igor%mir2.org
0dec223435 Removal of TypeEvent since its essential functionality beyond the declaration of few constants was used only to implement OptLocalVariable.assignType. Inlining that code eliminated need in TypeEvent. 2003-08-14 06:03:22 +00:00
brendan%mozilla.org
165194b972 One more comment tweak. 2003-08-14 01:19:30 +00:00
brendan%mozilla.org
1ba5b62aa7 Followup to last checkin to better comment the dependency I missed. 2003-08-14 01:17:27 +00:00
igor%mir2.org
a5f9d59614 Change TokenStream to return operational tokens as is without grouping them through Token.UNARY, Token.PRIMARY etc. Instead do grouping only in parser. In this way exceptional cases when grouping of tokens has to be changed by parser (like reinterpretation of Token.IN) it is easy to deal with. Another advantage is decompiler simplification since it does not need to perform nested switches to unwrap tokens. 2003-08-13 14:21:39 +00:00
igor%mir2.org
6fa381d49b I replaced Token.ADD/Token.SUB by Token.POS/Token.NEG as operands of UNARY operation nodes in parse tree. This is mostly for readability and to catch ADD/SUB misuse earlier. 2003-08-13 11:57:33 +00:00
igor%mir2.org
593784cb96 Cosmetics: nodeOp as variable name is replaced by assignOp in methods related to construction of assignment nodes. 2003-08-13 11:53:14 +00:00
igor%mir2.org
a4742a5fe9 Change Parser to use IRFactory.createAssignment to create assignment nodes instead of calling createBinary only to handle assignments explicitly in IRFactory later. 2003-08-13 10:51:38 +00:00
brendan%mozilla.org
1ed53e7ef1 Really fix 215878, with great help from darin. 2003-08-13 06:54:13 +00:00
igor%mir2.org
a692d990fc Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=215923 :
Search prototype chain of JS this until wrapped Java object is found that is compatible with Java this.
2003-08-13 06:04:41 +00:00
brendan%mozilla.org
f2e719a0e8 Restore next-to-last rev, which is harmless. 2003-08-13 05:25:04 +00:00
darin%meer.net
37619fcb6b backing out changes for bug 215878 to clear tinderbox orange (startup crash) 2003-08-13 05:17:14 +00:00
brendan%mozilla.org
09094b8f3b Fix js_FinishTakingSrcNotes 'logic gap' bug (215878, r=shaver, a=dveditz). 2003-08-12 23:42:55 +00:00
igor%mir2.org
9c0e1f0749 Making Decompiler.decompile public and changing NativeFunction.getSourceFunction() to return Object so it is easy to implement alternative presentation of encoded source. 2003-08-12 13:12:39 +00:00
igor%mir2.org
08560c4e86 Encoded source presentation changes.
Now encoded source does not encode sources of nested functions as external references. Rather they are encoded as any other source elements and to implement function.toString() runtime stores starting and ending offsets for function encoded source.

In this way decompiler is separated from the rest of runtime and external applications can access the encoded source with less efforts.
2003-08-12 11:50:48 +00:00
igor%mir2.org
a9944948f9 Using ScriptRuntime.emptyStrings to return emoty var array 2003-08-12 11:50:45 +00:00
igor%mir2.org
e725b9c0be Switching to use ClassFileWriter.addPush(String) instead of ClassFileWriter.addLoadConstant(String) to support string constants with JVM UTF8 encoding exceeding 64k. 2003-08-11 14:54:19 +00:00
igor%mir2.org
93e05fffaa Fixing bugs in the initial implementation of ClassFileWriter.addPush(String): now it works 2003-08-11 14:14:12 +00:00
igor%mir2.org
3594eb4b6b Use special token to encode function escape in Decompiler instead of using elaborated code to distinguish between start of function and function escape. 2003-08-11 11:06:21 +00:00
igor%mir2.org
8a8ca75068 Adding readFile function to the shell to read file context. 2003-08-11 10:54:40 +00:00
igor%mir2.org
af20fbe788 making decompiler class public so public method Parser.parser still can be called from outside omj. 2003-08-08 16:42:41 +00:00