Closed Bug 108257 Opened 24 years ago Closed 24 years ago

source notes broken for functions compiled via JS_CompileUCFunctionForPrincipals

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: rginda, Assigned: rginda)

Details

(Whiteboard: [see Comment #15 for correction to makefile for testcase])

Attachments

(4 files, 1 obsolete file)

Similar to bug 82188, but affects functions compiled via JS_CompileUCFunctionForPrincipals. Patch coming up.
Attached patch proposed patch; testing now (obsolete) — Splinter Review
Summary: source notes broken for functions compiled via JS → source notes broken for functions compiled via JS_CompileUCFunctionForPrincipals
save the makefile and testcase somewhere on your disk, edit the makefile to point to your js/src directory, and make jsnotes. the testcase compiles the same script via JS_CompileScript and JS_CompileFunction. Source notes are dumped for each script, first for CompileScript, then for CompileFunction. Unpatched I get this output... Source notes: 0: 8 [ 8] xdelta 1: 8 [ 0] newline 2: 18 [ 10] xdelta 3: 18 [ 0] newline 4: 28 [ 10] xdelta 5: 28 [ 0] newline Source notes: 0: 8 [ 8] xdelta 1: 8 [ 0] newline 2: 18 [ 10] xdelta 3: 18 [ 0] newline 4: 28 [ 10] xdelta 5: 28 [ 0] newline 6: 38 [ 10] xdelta 7: 38 [ 0] setline lineno 0 Notice the extra 6th and 7th note when CompileFunction is used. With this patch, the testcase produces... Source notes: 0: 8 [ 8] xdelta 1: 8 [ 0] newline 2: 18 [ 10] xdelta 3: 18 [ 0] newline 4: 28 [ 10] xdelta 5: 28 [ 0] newline Source notes: 0: 8 [ 8] xdelta 1: 8 [ 0] newline 2: 18 [ 10] xdelta 3: 18 [ 0] newline 4: 28 [ 10] xdelta 5: 28 [ 0] newline
Status: NEW → ASSIGNED
testing on linux/debug shows no regressions.
Comment on attachment 56298 [details] [diff] [review] proposed patch; testing now How about a comment: /* Code already emitted in Statements' loop body. */ before the new code. js_EmitFunctionBody could be inlined now that it's called in only one place in the whole engine. No worries, I'll clean that later. Comment and sr=brendan@mozilla.org -- thanks, /be
Attachment #56298 - Flags: superreview+
Also, maybe it's time to JS_ASSERT that we never emit a SRC_SETLINE(0). /be
oops, I'll remove the space between JS_ASSERT and (. shaver, care to r=?
Comment on attachment 56324 [details] [diff] [review] patch including brendan's suggestions rginda, please move that ASSERT into UPDATE_LINENO_NOTES -- that's the only place that could do the bad thing. /be
Comment on attachment 56330 [details] [diff] [review] third time's a charm Money, baby! /be
Attachment #56330 - Flags: superreview+
Attachment #56298 - Attachment is obsolete: true
Comment on attachment 56330 [details] [diff] [review] third time's a charm So money. r=shaver
Attachment #56330 - Flags: review+
cha ching.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified Fixed using Rob's testcase on a current Linux debug JS shell. NOTE: Rob found that the makefile for the test, jsnotes.mak, should be corrected as follows in order for the test to compile: The line ending in -DDEBUG -I$(JSDIR) jsnotes.c should end as: -DDEBUG -I$(JSLIBDIR) -I$(JSDIR) jsnotes.c The output of the jsnotes executable is now the same for both JS_CompileScript and JS_CompileFunction: Source notes: 0: 8 [ 8] xdelta 1: 8 [ 0] newline 2: 18 [ 10] xdelta 3: 18 [ 0] newline 4: 28 [ 10] xdelta 5: 28 [ 0] newline Source notes: 0: 8 [ 8] xdelta 1: 8 [ 0] newline 2: 18 [ 10] xdelta 3: 18 [ 0] newline 4: 28 [ 10] xdelta 5: 28 [ 0] newline
Status: RESOLVED → VERIFIED
Whiteboard: [see Comment #15 for correction to makefile for testcase]
Flags: testcase-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: