Implement JSSourceCompiler and JSAstCompiler

RESOLVED WONTFIX

Status

()

Core
JavaScript Engine
RESOLVED WONTFIX
9 years ago
6 years ago

People

(Reporter: dherman, Assigned: dherman)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

9 years ago
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.
(Assignee)

Comment 1

9 years ago
Created attachment 428967 [details] [diff] [review]
first attempt at JSSourceCompiler refactoring

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)
(Assignee)

Comment 2

9 years ago
Created attachment 428997 [details] [diff] [review]
second try (fixed error-generation logic bug)

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)

Updated

9 years ago
Attachment #428997 - Attachment is patch: true
Attachment #428997 - Attachment mime type: application/octet-stream → text/plain
(Assignee)

Comment 3

9 years ago
Created attachment 429010 [details] [diff] [review]
restored missing error source-line reporting

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)

Comment 4

9 years ago
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.
(Assignee)

Comment 5

9 years ago
No argument here; I definitely want my work checked.

Thanks,
Dave
(Assignee)

Updated

9 years ago
Depends on: 550629
(Assignee)

Updated

9 years ago
Depends on: 550630
(Assignee)

Updated

9 years ago
Depends on: 518055
(Assignee)

Updated

9 years ago
Depends on: 550350
(Assignee)

Comment 6

9 years ago
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
(Assignee)

Updated

9 years ago
Depends on: 551021
(Assignee)

Comment 7

8 years ago
Obsoleted by bug 558437.

Dave
Status: NEW → RESOLVED
Last Resolved: 8 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.