Rename JSOP_PUSH to JSOP_UNDEFINED at some point

RESOLVED FIXED

Status

()

Core
JavaScript Engine
--
minor
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Waldo, Assigned: evilpie)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

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.
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.
Assignee: general → evilpies
Status: NEW → ASSIGNED
Attachment #579844 - Flags: review?(jwalden+bmo)
Attachment #579844 - Flags: review?(jwalden+bmo)
Blocks: 708428
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",
Attachment #579844 - Attachment is obsolete: true
Attachment #579861 - Flags: review?(jwalden+bmo)
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.
Attachment #579861 - Flags: review?(jwalden+bmo) → review+
http://hg.mozilla.org/mozilla-central/rev/467197e8063f
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.