Closed Bug 1169511 Opened 9 years ago Closed 9 years ago

Split PNK_TYPEOF into one kind for application to names, one kind for application to other expressions

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

PNK_DELETE emboldened me to finish the job and deal with the other single-kind-that-should-be-many.
Attached patch PatchSplinter Review
Attachment #8612682 - Flags: review?(efaustbmo)
Comment on attachment 8612682 [details] [diff] [review]
Patch

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

r=me with comment about unifying the emitter functions answered.

::: js/src/frontend/BytecodeEmitter.cpp
@@ +7012,5 @@
> +    return emit1(JSOP_TYPEOF);
> +}
> +
> +bool
> +BytecodeEmitter::emitTypeofExpr(ParseNode* node)

bool
BytecodeEmitter::emitTypeof(ParseNode* pn, JSOp op)
{
    MOZ_ASSERT(op == JSOP_TYPEOF || op == JSOP_TYPEOFEXPR);

    <Identical code from both methods>

    return emit1(op);
}

Are we building towards making these do different things, or something?

@@ +7495,5 @@
>          break;
>        }
>  
> +      case PNK_TYPEOFNAME:
> +        ok = emitTypeofName(pn);

we can do this |ok =| business, but Jason and I were trying to make new ones |return emitTypeofName(pn)|. What do you think?
Attachment #8612682 - Flags: review?(efaustbmo) → review+
(In reply to Eric Faust [:efaust] from comment #2)
> > +bool
> > +BytecodeEmitter::emitTypeofExpr(ParseNode* node)
> 
> bool
> BytecodeEmitter::emitTypeof(ParseNode* pn, JSOp op)
> {
>     MOZ_ASSERT(op == JSOP_TYPEOF || op == JSOP_TYPEOFEXPR);
> 
>     <Identical code from both methods>
> 
>     return emit1(op);
> }
> 
> Are we building towards making these do different things, or something?

I think so, yes.  That JSOP_TYPEOF and JSOP_TYPEOFEXPR share the same code is pretty bonkers, versus having separate code paths.  But for another day.  I unified for now, it's easy to split these later.

> > +      case PNK_TYPEOFNAME:
> > +        ok = emitTypeofName(pn);
> 
> we can do this |ok =| business, but Jason and I were trying to make new ones
> |return emitTypeofName(pn)|. What do you think?

The code after the overall switch doesn't obviously not apply to these cases, so I left this as-is.
I had to back this out so I could cleanly back out bug 1141865 for bustage. Feel free to reland this as soon as I reopen the tree.
https://hg.mozilla.org/mozilla-central/rev/d86e23a06839
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: