Closed Bug 511974 Opened 15 years ago Closed 15 years ago

TM: Treat "continue LABEL;" like "break;"

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: jorendorff, Assigned: jorendorff)

Details

(Keywords: verified1.9.2, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

To avoid tracing into outer loops and all sorts of craziness, we specially detect `break;` in TR::record_JSOP_GOTO and emit an unconditional exit. We need to do the same for `continue LABEL;` where LABEL is a loop that encloses the one we're trying to record. The patch works and the new test passes, but it messes up the goofy case where someone has pointlessly labeled a loop: inner: for (i = 0; i < 9; i++) { if (i == x) continue inner; ... } If we care, I think the way to fix that is to skip emitting the CONT2LABEL source note for that GOTO.
Attached patch v1Splinter Review
Feel free to minus if you think I should fix the silly case before checking this patch in.
Assignee: general → jorendorff
Attachment #395937 - Flags: review?(gal)
Attachment #395937 - Flags: review?(gal) → review+
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
js/src/trace-test/tests/basic/testBreak.js js/src/trace-test/tests/basic/testContinueWithLabel2.js v 1.9.3, 1.9.2
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
Keywords: verified1.9.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: