|
|
|
Lines 452-467
BytecodeEmitter::emitDupAt(unsigned slot
|
Link Here
|
|---|
|
| 452 |
if (!emitN(JSOP_DUPAT, 3, &off)) |
452 |
if (!emitN(JSOP_DUPAT, 3, &off)) |
| 453 |
return false; |
453 |
return false; |
| 454 |
|
454 |
|
| 455 |
jsbytecode* pc = code(off); |
455 |
jsbytecode* pc = code(off); |
| 456 |
SET_UINT24(pc, slotFromTop); |
456 |
SET_UINT24(pc, slotFromTop); |
| 457 |
return true; |
457 |
return true; |
| 458 |
} |
458 |
} |
| 459 |
|
459 |
|
|
|
460 |
bool |
| 461 |
BytecodeEmitter::emitCheckIsObj(CheckIsObjectKind kind) |
| 462 |
{ |
| 463 |
return emit2(JSOP_CHECKISOBJ, uint8_t(kind)); |
| 464 |
} |
| 465 |
|
| 460 |
static const char* |
466 |
static const char* |
| 461 |
StatementName(StmtInfoBCE* stmt) |
467 |
StatementName(StmtInfoBCE* stmt) |
| 462 |
{ |
468 |
{ |
| 463 |
if (!stmt) |
469 |
if (!stmt) |
| 464 |
return js_script_str; |
470 |
return js_script_str; |
| 465 |
|
471 |
|
| 466 |
/* XXX too many "... statement" L10N gaffes -- fix via js.msg! */ |
472 |
/* XXX too many "... statement" L10N gaffes -- fix via js.msg! */ |
| 467 |
static const char* const statementName[] = { |
473 |
static const char* const statementName[] = { |
|
Lines 4142-4157
BytecodeEmitter::emitIteratorNext(ParseN
|
Link Here
|
|---|
|
| 4142 |
if (!emit1(JSOP_DUP)) // ... ITER ITER |
4148 |
if (!emit1(JSOP_DUP)) // ... ITER ITER |
| 4143 |
return false; |
4149 |
return false; |
| 4144 |
if (!emitAtomOp(cx->names().next, JSOP_CALLPROP)) // ... ITER NEXT |
4150 |
if (!emitAtomOp(cx->names().next, JSOP_CALLPROP)) // ... ITER NEXT |
| 4145 |
return false; |
4151 |
return false; |
| 4146 |
if (!emit1(JSOP_SWAP)) // ... NEXT ITER |
4152 |
if (!emit1(JSOP_SWAP)) // ... NEXT ITER |
| 4147 |
return false; |
4153 |
return false; |
| 4148 |
if (!emitCall(JSOP_CALL, 0, pn)) // ... RESULT |
4154 |
if (!emitCall(JSOP_CALL, 0, pn)) // ... RESULT |
| 4149 |
return false; |
4155 |
return false; |
|
|
4156 |
if (!emitCheckIsObj(CheckIsObjectKind::IteratorNext)) // ... RESULT |
| 4157 |
return false; |
| 4150 |
checkTypeSet(JSOP_CALL); |
4158 |
checkTypeSet(JSOP_CALL); |
| 4151 |
return true; |
4159 |
return true; |
| 4152 |
} |
4160 |
} |
| 4153 |
|
4161 |
|
| 4154 |
bool |
4162 |
bool |
| 4155 |
BytecodeEmitter::emitDefault(ParseNode* defaultExpr) |
4163 |
BytecodeEmitter::emitDefault(ParseNode* defaultExpr) |
| 4156 |
{ |
4164 |
{ |
| 4157 |
if (!emit1(JSOP_DUP)) // VALUE VALUE |
4165 |
if (!emit1(JSOP_DUP)) // VALUE VALUE |
|
Lines 7228-7243
BytecodeEmitter::emitYieldStar(ParseNode
|
Link Here
|
|---|
|
| 7228 |
if (!emitAtomOp(cx->names().next, JSOP_CALLPROP)) // RECEIVED ITER ITER NEXT |
7236 |
if (!emitAtomOp(cx->names().next, JSOP_CALLPROP)) // RECEIVED ITER ITER NEXT |
| 7229 |
return false; |
7237 |
return false; |
| 7230 |
if (!emit1(JSOP_SWAP)) // RECEIVED ITER NEXT ITER |
7238 |
if (!emit1(JSOP_SWAP)) // RECEIVED ITER NEXT ITER |
| 7231 |
return false; |
7239 |
return false; |
| 7232 |
if (!emit2(JSOP_PICK, 3)) // ITER NEXT ITER RECEIVED |
7240 |
if (!emit2(JSOP_PICK, 3)) // ITER NEXT ITER RECEIVED |
| 7233 |
return false; |
7241 |
return false; |
| 7234 |
if (!emitCall(JSOP_CALL, 1, iter)) // ITER RESULT |
7242 |
if (!emitCall(JSOP_CALL, 1, iter)) // ITER RESULT |
| 7235 |
return false; |
7243 |
return false; |
|
|
7244 |
if (!emitCheckIsObj(CheckIsObjectKind::IteratorNext)) // ITER RESULT |
| 7245 |
return false; |
| 7236 |
checkTypeSet(JSOP_CALL); |
7246 |
checkTypeSet(JSOP_CALL); |
| 7237 |
MOZ_ASSERT(this->stackDepth == depth); |
7247 |
MOZ_ASSERT(this->stackDepth == depth); |
| 7238 |
|
7248 |
|
| 7239 |
if (!emitJumpTargetAndPatch(checkResult)) // checkResult: |
7249 |
if (!emitJumpTargetAndPatch(checkResult)) // checkResult: |
| 7240 |
return false; |
7250 |
return false; |
| 7241 |
|
7251 |
|
| 7242 |
// if (!result.done) goto tryStart; // ITER RESULT |
7252 |
// if (!result.done) goto tryStart; // ITER RESULT |
| 7243 |
if (!emit1(JSOP_DUP)) // ITER RESULT RESULT |
7253 |
if (!emit1(JSOP_DUP)) // ITER RESULT RESULT |