Closed Bug 548461 Opened 12 years ago Closed 11 years ago

Implement JSSourceCompiler and JSAstCompiler

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dherman, Assigned: dherman)

References

Details

Attachments

(1 file, 2 obsolete files)

The emitter assumes it has access to a token stream; in order to implement AST reflection, refactor the compiler so that it's possible to emit code from an AST that doesn't have an associated token stream.

struct JSSourceCompiler : JSCompiler
struct JSAstCompiler : JSCompiler

Patch forthcoming.
First attempt. Currently breaks tests:

    ecma_5/strict/11.3.1.js
    ecma_5/strict/11.3.2.js
    ecma_5/strict/11.4.4.js
    ecma_5/strict/11.4.5.js
    ecma_5/strict/11.13.1.js
    ecma_5/strict/11.13.2.js
    ecma_5/strict/12.2.1.js
    ecma_5/strict/12.14.1.js
    ecma_5/strict/13.1.js
    ecma_5/strict/regress-532254.js
    js1_5/Regress/regress-352197.js
    js1_8_1/strict/12.2.1.js
    js1_8_1/strict/generator-eval-arguments.js
    js1_8_1/strict/let-block-eval-arguments.js

Most of these problems seem to be one bug: it's not enabling strict mode correctly.
Attachment #428967 - Flags: review?(gal)
All tests pass now. Still seems to have an error-display bug: doesn't print out the source line of the error anymore.
Attachment #428967 - Attachment is obsolete: true
Attachment #428997 - Flags: review?(gal)
Attachment #428967 - Flags: review?(gal)
Attachment #428997 - Attachment is patch: true
Attachment #428997 - Attachment mime type: application/octet-stream → text/plain
OK, fixed the bug where it wasn't reporting the source line of errors. And got rid of some dead comments.

There's one XXX_dherman for review: I'm not sure what the proper ownership story is for JSCodeGenerator::filename.
Attachment #428997 - Attachment is obsolete: true
Attachment #429010 - Flags: review?(gal)
Attachment #428997 - Flags: review?(gal)
uh, I didn't realize this was a 300k patch. We should probably run it through the benchmark Leary put together in bug 548621, just to be safe.
No argument here; I definitely want my work checked.

Thanks,
Dave
Depends on: 550629
Depends on: 550630
Depends on: 518055
Depends on: 550350
My apologies for the portly patch. I'm splitting this up into a number of smaller patches-- note the new dependencies on bug 518055, bug 550629, bug 550350, and bug 550630.

Dave
Depends on: 551021
Obsoleted by bug 558437.

Dave
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Attachment #429010 - Flags: review?(gal)
You need to log in before you can comment on or make changes to this bug.