Closed
Bug 579230
Opened 14 years ago
Closed 14 years ago
Builder pattern refactor of the narcissus parser
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: shu, Unassigned)
References
Details
Attachments
(1 file, 6 obsolete files)
91.65 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; en-US; rv:2.0b2pre) Gecko/20100715 Minefield/4.0b2pre Build Identifier: Refactor of the narcissus parser into the builder pattern so we can interchange the vanilla builder with other builders that do analysis, such as SSA. Reproducible: Always
Reporter | ||
Comment 1•14 years ago
|
||
Current un-niceties: the bottom-up expression parser doesn't play nicely with doing transforms of the AST via the builder.
Comment 2•14 years ago
|
||
make this bug depend on your other bug
Comment 3•14 years ago
|
||
actually other way around, your other bug depends on this one
Comment 4•14 years ago
|
||
Maybe we should use recursive descent for expression parsing. Separate bug. /be
Reporter | ||
Comment 5•14 years ago
|
||
The new expression parser handles the following: - generators and generator expressions - expression closures - destructuring - let
Attachment #457732 -
Attachment is obsolete: true
Attachment #458874 -
Flags: review?(gal)
Reporter | ||
Comment 6•14 years ago
|
||
Previous patch was based against an old TM tree.
Attachment #458883 -
Flags: review?(gal)
Reporter | ||
Updated•14 years ago
|
Attachment #458874 -
Attachment is obsolete: true
Attachment #458874 -
Flags: review?(gal)
Comment 7•14 years ago
|
||
The testing framework does not start up now. Here is the error message: $ python jstests.py -d -j 4 ../njs -m narcissus.list -x narcissus-failures.txt Traceback (most recent call last): File "jstests.py", line 282, in <module> test_list = manifest.parse(OPTIONS.manifest, xul_tester) File "/Users/taustin/mozilla/tracemonkey/js/src/tests/manifest.py", line 104, in parse ans += parse(os.path.join(dir, include_file), xul_tester, include_reldir) File "/Users/taustin/mozilla/tracemonkey/js/src/tests/manifest.py", line 104, in parse ans += parse(os.path.join(dir, include_file), xul_tester, include_reldir) File "/Users/taustin/mozilla/tracemonkey/js/src/tests/manifest.py", line 104, in parse ans += parse(os.path.join(dir, include_file), xul_tester, include_reldir) File "/Users/taustin/mozilla/tracemonkey/js/src/tests/manifest.py", line 104, in parse ans += parse(os.path.join(dir, include_file), xul_tester, include_reldir) File "/Users/taustin/mozilla/tracemonkey/js/src/tests/manifest.py", line 136, in parse if xul_tester.test(cond): File "/Users/taustin/mozilla/tracemonkey/js/src/tests/manifest.py", line 78, in test raise Exception("Failed to test XUL condition '%s'"%cond) Exception: Failed to test XUL condition '!xulRuntime.shell&&xulRuntime.OS=="Linux"&&xulRuntime.XPCOMABI.match(/x86_64/)' Evaluating the condition from the error message gives an error about a missing operand: $ ../njs -e '!xulRuntime.shell&&xulRuntime.OS=="Linux"&&xulRuntime.XPCOMABI.match(/x86_64/)' :1: Missing operand Previously, this gave an error that xulRuntime was not defined: $ ../njs -e '!xulRuntime.shell&&xulRuntime.OS=="Linux"&&xulRuntime.XPCOMABI.match(/x86_64/)' :1: xulRuntime is not defined The regular expression might be the culprit. Removing that gets the same error message as pre-patch: $ ../njs -e '!xulRuntime.shell&&xulRuntime.OS=="Linux"&&xulRuntime.XPCOMABI.match(0)' :1: xulRuntime is not defined
Reporter | ||
Comment 8•14 years ago
|
||
The following tests not in narcissus-failures fail, mostly for reasons not related to parsing. Run out of memory; don't know what's wrong or how to fix. - js1_5/Regress/regress-159334.js - js1_5/Regress/regress-367561-01.js - js1_5/Regress/regress-367561-03.js Array comprehensions not implemented in jsexec.js. - js1_5/Regress/regress-352009.js - js1_7/block/regress-349653.js Destructuring not implemented in jsexec.js. - js1_7/expressions/regress-346203.js - js1_8/regress/regress-459185.js No real decompiler. - js1_5/extensions/regress-355736.js - js1_7/decompilation/regress-352079.js - js1_8_1/decompilation/regress-352011.js - js1_8_1/decompilation/regress-380237-04.js - js1_8_1/regress/regress-452498-038.js Error reporting isn't the same as SpiderMonkey - ecma_3/LexicalConventions/7.9.1.js Array isn't being reflected properly (Array.name is undefined?) - ecma_3_1/Object/regress-444787.js
Attachment #458883 -
Attachment is obsolete: true
Attachment #459276 -
Flags: review?(gal)
Attachment #458883 -
Flags: review?(gal)
Comment 9•14 years ago
|
||
When I run it locally, I don't get the out of memory errors. For the others, can we add them to narcissus-failures.txt?
Reporter | ||
Comment 10•14 years ago
|
||
Flatten the builder structure to avoid scary pinInnerThis magic.
Attachment #459276 -
Attachment is obsolete: true
Attachment #459276 -
Flags: review?(gal)
Reporter | ||
Updated•14 years ago
|
Attachment #460399 -
Flags: review?(gal)
Reporter | ||
Comment 11•14 years ago
|
||
Fixes bugs with parsing lets in for heads.
Attachment #460399 -
Attachment is obsolete: true
Attachment #460438 -
Flags: review?(gal)
Attachment #460399 -
Flags: review?(gal)
Reporter | ||
Comment 12•14 years ago
|
||
Per discussion with gal, applied the following fixes: - Rename COMPREHENSION to COMP - Rename saveRewindPoint to just save - Rename returnsNull/returnsValue to hasEmptyReturn/hasReturnWithValue - Change property name keyword check to use the keywords hash Not fixed: - Move SyntaxError exception checking to the parse function. Exceptions need to be overhauled anyways.
Attachment #460438 -
Attachment is obsolete: true
Attachment #461736 -
Flags: review?(gal)
Attachment #460438 -
Flags: review?(gal)
Updated•14 years ago
|
Attachment #461736 -
Flags: review?(gal) → review+
Reporter | ||
Updated•14 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 14•14 years ago
|
||
The FunctionDefinition function in jsparse is pretty hairy. I've opened bug 584436 with some additional review. Dave
Comment 15•14 years ago
|
||
Lets use 584436 to patch it. shu, want to grab that bug? dherman can review your fixes in that bug.
Reporter | ||
Comment 16•14 years ago
|
||
Sure, I'll reply in that bug.
Comment 17•14 years ago
|
||
Fly-by comment: Why are there JSON-style quoted property names in the Narcissus .jsparse = ... module pattern object initialiser return value? Why jsparse and not parse as the method name? /be
Comment 18•14 years ago
|
||
No good reason on the JSON-style property names. jsparse is an object with the exported properties. Maybe 'parser' would be a better name? Perhaps these changes: Narcissus.jslex -> Narcissus.lexer Narcissus.jsparse -> Narcissus.parser Narcissus.jsexec -> Narcissus.interpreter Narcissus.jsdefs -> Narcissus.definitions
Comment 19•14 years ago
|
||
Yes, nouns for data (and infallible getters), verbs for methods. Thanks, /be
You need to log in
before you can comment on or make changes to this bug.
Description
•