Closed Bug 397289 Opened 17 years ago Closed 17 years ago

removing JSParseNode.pn_ts

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

Attachments

(1 file, 3 obsolete files)

Currently each JSParseNode stores a pointer to JSTokenStream in the pn_ts field. The code uses the pointer only when reporting errors. Thus for the normal case of error-free code the field just wastes the memory. It would be nice to remove the field and replace it via explicit passing of a JSTokenStream pointer to the error reporting function. With bug 397210 fixed that should be sufficiently straightforward since the changes in the bug make JSTokenStream* available from JSParseContex/JSTreeContext/JSCodeGenerator.
Recording the patch dependency
Blocks: 394941
Status: NEW → ASSIGNED
Depends on: 397210
Attached patch v1 (obsolete) (deleted) — Splinter Review
Here is a patch that passes the test suite for jsshell. Since this patch depends on the the patch from bug 397210 attachment 2 [details] [diff] [review], I will ask for a review after resolving that bug.
Attached patch v2 (obsolete) (deleted) — Splinter Review
[This is essentially v1 updated to take advantage of TS macro from bug 397210]. The removal of JSParseNode.pn_ts required to change js_ReportCompileErrorNumber to accept both JSTokenStream and JSParseNode as parameters. The new version of the function always requires non-null JSTokenStream. jsregexp.c is updated to use JS_ReportErrorFlagsAndNumberUC, not js_ReportCompileErrorNumber, when the regexp is created dynamically and does not come from a source literal. The rest of the changes is pretty mechanical.
Attachment #282042 - Attachment is obsolete: true
Attachment #283056 - Flags: review?(brendan)
Attached patch v2b (obsolete) (deleted) — Splinter Review
This is a CVS sync.
Attachment #283056 - Attachment is obsolete: true
Attachment #285540 - Flags: review?(brendan)
Attachment #283056 - Flags: review?(brendan)
Comment on attachment 285540 [details] [diff] [review] v2b s/CG2TS/CG_TS/ -- slightly more readable and consistent with prevailing naming conventions. s/ReportRegexError1/ReportRegExpErrorHelper/ -- ditto s/ReportRegexError/ReportRegExpError/ -- consistency again r=me with these, thanks. I guess my a+ means this can go in after M9 is done. /be
Attachment #285540 - Flags: review?(brendan)
Attachment #285540 - Flags: review+
Attachment #285540 - Flags: approval1.9+
Attached patch v2c (deleted) — Splinter Review
Here is a version with the suggested renames.
Attachment #285540 - Attachment is obsolete: true
Attachment #286067 - Flags: review+
Attachment #286067 - Flags: approval1.9+
I checked in the patch from the comment 6 to the CVS trunk: Checking in jsemit.c; /cvsroot/mozilla/js/src/jsemit.c,v <-- jsemit.c new revision: 3.281; previous revision: 3.280 done Checking in jsfun.c; /cvsroot/mozilla/js/src/jsfun.c,v <-- jsfun.c new revision: 3.228; previous revision: 3.227 done Checking in jsparse.c; /cvsroot/mozilla/js/src/jsparse.c,v <-- jsparse.c new revision: 3.306; previous revision: 3.305 done Checking in jsparse.h; /cvsroot/mozilla/js/src/jsparse.h,v <-- jsparse.h new revision: 3.50; previous revision: 3.49 done Checking in jsregexp.c; /cvsroot/mozilla/js/src/jsregexp.c,v <-- jsregexp.c new revision: 3.165; previous revision: 3.164 done Checking in jsregexp.h; /cvsroot/mozilla/js/src/jsregexp.h,v <-- jsregexp.h new revision: 3.30; previous revision: 3.29 done Checking in jsscan.c; /cvsroot/mozilla/js/src/jsscan.c,v <-- jsscan.c new revision: 3.139; previous revision: 3.138 done Checking in jsscan.h; /cvsroot/mozilla/js/src/jsscan.h,v <-- jsscan.h new revision: 3.53; previous revision: 3.52 done Checking in jsstr.c; /cvsroot/mozilla/js/src/jsstr.c,v <-- jsstr.c new revision: 3.172; previous revision: 3.171 done Checking in jsxml.c; /cvsroot/mozilla/js/src/jsxml.c,v <-- jsxml.c new revision: 3.173; previous revision: 3.172 done Checking in jsxml.h; /cvsroot/mozilla/js/src/jsxml.h,v <-- jsxml.h new revision: 3.23; previous revision: 3.22 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
No longer depends on: 403724
Depends on: 403724
Flags: in-testsuite-
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: