Last Comment Bug 706924 - Rename JSOP_PUSH to JSOP_UNDEFINED at some point
: Rename JSOP_PUSH to JSOP_UNDEFINED at some point
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- minor (vote)
: ---
Assigned To: AWAY Tom Schuster [:evilpie]
:
:
Mentors:
Depends on:
Blocks: 708428
  Show dependency treegraph
 
Reported: 2011-12-01 11:58 PST by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2011-12-13 11:58 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (11.48 KB, patch)
2011-12-07 14:46 PST, AWAY Tom Schuster [:evilpie]
no flags Details | Diff | Splinter Review
v1.1 (11.47 KB, patch)
2011-12-07 15:11 PST, AWAY Tom Schuster [:evilpie]
jwalden+bmo: review+
Details | Diff | Splinter Review

Description Jeff Walden [:Waldo] (remove +bmo to email) 2011-12-01 11:58:20 PST
One would expect an opcode named "push" would take a value somehow and put it on the stack, but really it always pushes |undefined|.  That's not really clued by the name, I think.  For consistency with JSOP_STRING, JSOP_ZERO, JSOP_INT8, JSOP_INT32, JSOP_HOLE, and the other ops that push a value on the stack, I think we should name it JSOP_UNDEFINED, naming what it pushes rather than incompletely describing the action it performs.  It should be "undefined" and not "void" for consistency with JS::Value, since we seem to be incrementally moving away from the "void" name.
Comment 1 AWAY Tom Schuster [:evilpie] 2011-12-07 14:46:11 PST
Created attachment 579844 [details] [diff] [review]
v1

Yaay, code removal. I am pretty sure this is dead code, because the opposite part in EmitGroupAssignment should never emit that. Still pretty weird d'oh.
Comment 2 AWAY Tom Schuster [:evilpie] 2011-12-07 15:11:55 PST
Created attachment 579861 [details] [diff] [review]
v1.1

Forgot the last refresh, essentially, we need to make JSOP_UNDEFINED, decompile to "". We should never actually use the "", besides checking in return/yield if there is no actual return value. I guess after bug 708428 we would check against "undefined",
Comment 3 Jeff Walden [:Waldo] (remove +bmo to email) 2011-12-08 10:05:42 PST
Comment on attachment 579861 [details] [diff] [review]
v1.1

Review of attachment 579861 [details] [diff] [review]:
-----------------------------------------------------------------

\o/

::: js/src/frontend/BytecodeEmitter.cpp
@@ +6901,5 @@
>           * interpose the lambda-initialized method read barrier -- see the code
>           * in jsinterp.cpp for JSOP_LAMBDA followed by JSOP_{SET,INIT}PROP.
>           *
>           * Then (or in a call case that has no explicit reference-base
> +         * object) we emit JSOP_UNDEFINED to produce the undefined |this| value required

This might need rewrapping to fit in 79 characters, at a glance.
Comment 4 AWAY Tom Schuster [:evilpie] 2011-12-13 11:25:04 PST
http://hg.mozilla.org/mozilla-central/rev/467197e8063f

Note You need to log in before you can comment on or make changes to this bug.