Closed Bug 383188 Opened 17 years ago Closed 17 years ago

Declare extra slot for post++/-- in jsopcode.tbl to replace explicit max stack updates

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)

This is a follow-up for bug 381973 to replace the explicit max stack checks to reserve an extra slot for post ++/-- via JOF_TMPSLOT introduced in that bug.
Attached patch implementation v0.9 (obsolete) — Splinter Review
This is a quilt patch that depends on the patch from bug 383188 comment 5.
Attached patch implementation v0.91 (obsolete) — Splinter Review
The prev patch can not even compiled.
Attachment #267187 - Attachment is obsolete: true
Comment on attachment 267188 [details] [diff] [review] implementation v0.91 >+ * Post-incremens requires an an extra slot for GC protection in case typo: "incremens" "an an" doubling >+ * the initial value being post-incremented or -decremented is not a >+ * number, but converts to a jsdouble. In the TOK_NAME cases, op has >+ * 0 operand uses and 1 definition, so we don't need an extra stack >+ * slot -- we can use the one allocated for the def. > */ >- if (pn2->pn_type != TOK_NAME && >- (js_CodeSpec[op].format & JOF_POST) && >- (uintN)depth == cg->maxStackDepth) { >- ++cg->maxStackDepth; >- } >+ JS_ASSERT((js_CodeSpec[op].format >> JOF_TMPSLOT_SHIFT) == >+ ((js_CodeSpec[op].format & JOF_POST) >+ && pn2->pn_type != TOK_NAME) ? 1 : 0); Nit: && at end of previous line. Also I am ok with using C booleans directly as ints instead of b?1:0. /be
Attached patch implementation v1 (obsolete) — Splinter Review
This is a previous patch + nit addressed + forgotten "& 1" added to the assert.
Attachment #267188 - Attachment is obsolete: true
Attachment #267193 - Flags: review+
Attachment #267193 - Flags: review+ → review?(brendan)
The new version fixes English grammar in comments.
Attachment #267193 - Attachment is obsolete: true
Attachment #267194 - Flags: review?(brendan)
Attachment #267193 - Flags: review?(brendan)
Comment on attachment 267194 [details] [diff] [review] implementation v1b r=me, thanks. /be
Attachment #267194 - Flags: review?(brendan) → review+
I committed the patch from comment 5 to the trunk: Checking in jsemit.c; /cvsroot/mozilla/js/src/jsemit.c,v <-- jsemit.c new revision: 3.254; previous revision: 3.253 done Checking in jsopcode.tbl; /cvsroot/mozilla/js/src/jsopcode.tbl,v <-- jsopcode.tbl new revision: 3.96; previous revision: 3.95 done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Depends on: 383255
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: