[ignition] Reduce generator switch boilerplate

The SwitchOnGeneratorState bytecode now also falls through if the
generator object is undefined (so that we don't need that jump) and
restores generator context (so that we don't need that PushContext).
This saves 10 bytes per generator.

Change-Id: Ie0872c827119b9f1d1e9244d3be6496a30cd9620
Reviewed-on: https://chromium-review.googlesource.com/867051
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50845}
This commit is contained in:
Leszek Swirski 2018-01-24 11:19:51 +00:00 committed by Commit Bot
parent 3121ffeb55
commit 71f758a2e2
25 changed files with 144 additions and 243 deletions

View File

@ -2828,13 +2828,29 @@ void BytecodeGraphBuilder::VisitSwitchOnGeneratorState() {
Node* generator = Node* generator =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Node* generator_state = Node* generator_is_undefined =
NewNode(javascript()->GeneratorRestoreContinuation(), generator); NewNode(simplified()->ReferenceEqual(), generator,
jsgraph()->UndefinedConstant());
environment()->BindGeneratorState(generator_state); NewBranch(generator_is_undefined);
{
SubEnvironment resume_env(this);
NewIfFalse();
BuildSwitchOnGeneratorState(bytecode_analysis()->resume_jump_targets(), Node* generator_state =
false); NewNode(javascript()->GeneratorRestoreContinuation(), generator);
environment()->BindGeneratorState(generator_state);
Node* generator_context =
NewNode(javascript()->GeneratorRestoreContext(), generator);
environment()->SetContext(generator_context);
BuildSwitchOnGeneratorState(bytecode_analysis()->resume_jump_targets(),
false);
}
// Fallthrough for the first-call case.
NewIfTrue();
} }
void BytecodeGraphBuilder::VisitResumeGenerator() { void BytecodeGraphBuilder::VisitResumeGenerator() {

View File

@ -693,6 +693,10 @@ void JSGenericLowering::LowerJSGeneratorRestoreContinuation(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering. UNREACHABLE(); // Eliminated in typed lowering.
} }
void JSGenericLowering::LowerJSGeneratorRestoreContext(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering.
}
void JSGenericLowering::LowerJSGeneratorRestoreInputOrDebugPos(Node* node) { void JSGenericLowering::LowerJSGeneratorRestoreInputOrDebugPos(Node* node) {
UNREACHABLE(); // Eliminated in typed lowering. UNREACHABLE(); // Eliminated in typed lowering.
} }

View File

@ -49,8 +49,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceAsyncGeneratorYield(node); return ReduceAsyncGeneratorYield(node);
case Runtime::kInlineGeneratorGetResumeMode: case Runtime::kInlineGeneratorGetResumeMode:
return ReduceGeneratorGetResumeMode(node); return ReduceGeneratorGetResumeMode(node);
case Runtime::kInlineGeneratorGetContext:
return ReduceGeneratorGetContext(node);
case Runtime::kInlineIsArray: case Runtime::kInlineIsArray:
return ReduceIsInstanceType(node, JS_ARRAY_TYPE); return ReduceIsInstanceType(node, JS_ARRAY_TYPE);
case Runtime::kInlineIsTypedArray: case Runtime::kInlineIsTypedArray:
@ -198,16 +196,6 @@ Reduction JSIntrinsicLowering::ReduceAsyncGeneratorYield(Node* node) {
0); 0);
} }
Reduction JSIntrinsicLowering::ReduceGeneratorGetContext(Node* node) {
Node* const generator = NodeProperties::GetValueInput(node, 0);
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
Operator const* const op =
simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectContext());
return Change(node, op, generator, effect, control);
}
Reduction JSIntrinsicLowering::ReduceGeneratorGetResumeMode(Node* node) { Reduction JSIntrinsicLowering::ReduceGeneratorGetResumeMode(Node* node) {
Node* const generator = NodeProperties::GetValueInput(node, 0); Node* const generator = NodeProperties::GetValueInput(node, 0);
Node* const effect = NodeProperties::GetEffectInput(node); Node* const effect = NodeProperties::GetEffectInput(node);

View File

@ -44,7 +44,6 @@ class V8_EXPORT_PRIVATE JSIntrinsicLowering final
Reduction ReduceDeoptimizeNow(Node* node); Reduction ReduceDeoptimizeNow(Node* node);
Reduction ReduceCreateJSGeneratorObject(Node* node); Reduction ReduceCreateJSGeneratorObject(Node* node);
Reduction ReduceGeneratorClose(Node* node); Reduction ReduceGeneratorClose(Node* node);
Reduction ReduceGeneratorGetContext(Node* node);
Reduction ReduceGeneratorGetInputOrDebugPos(Node* node); Reduction ReduceGeneratorGetInputOrDebugPos(Node* node);
Reduction ReduceAsyncGeneratorReject(Node* node); Reduction ReduceAsyncGeneratorReject(Node* node);
Reduction ReduceAsyncGeneratorResolve(Node* node); Reduction ReduceAsyncGeneratorResolve(Node* node);

View File

@ -576,6 +576,7 @@ CompareOperationHint CompareOperationHintOf(const Operator* op) {
V(LoadMessage, Operator::kNoThrow | Operator::kNoWrite, 0, 1) \ V(LoadMessage, Operator::kNoThrow | Operator::kNoWrite, 0, 1) \
V(StoreMessage, Operator::kNoRead | Operator::kNoThrow, 1, 0) \ V(StoreMessage, Operator::kNoRead | Operator::kNoThrow, 1, 0) \
V(GeneratorRestoreContinuation, Operator::kNoThrow, 1, 1) \ V(GeneratorRestoreContinuation, Operator::kNoThrow, 1, 1) \
V(GeneratorRestoreContext, Operator::kNoThrow, 1, 1) \
V(GeneratorRestoreInputOrDebugPos, Operator::kNoThrow, 1, 1) \ V(GeneratorRestoreInputOrDebugPos, Operator::kNoThrow, 1, 1) \
V(StackCheck, Operator::kNoWrite, 0, 0) \ V(StackCheck, Operator::kNoWrite, 0, 0) \
V(Debugger, Operator::kNoProperties, 0, 0) \ V(Debugger, Operator::kNoProperties, 0, 0) \

View File

@ -744,6 +744,8 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
// Used to implement Ignition's SwitchOnGeneratorState bytecode. // Used to implement Ignition's SwitchOnGeneratorState bytecode.
const Operator* GeneratorRestoreContinuation(); const Operator* GeneratorRestoreContinuation();
const Operator* GeneratorRestoreContext();
// Used to implement Ignition's ResumeGenerator bytecode. // Used to implement Ignition's ResumeGenerator bytecode.
const Operator* GeneratorRestoreRegister(int index); const Operator* GeneratorRestoreRegister(int index);
const Operator* GeneratorRestoreInputOrDebugPos(); const Operator* GeneratorRestoreInputOrDebugPos();

View File

@ -2069,6 +2069,21 @@ Reduction JSTypedLowering::ReduceJSGeneratorRestoreContinuation(Node* node) {
return Changed(continuation); return Changed(continuation);
} }
Reduction JSTypedLowering::ReduceJSGeneratorRestoreContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSGeneratorRestoreContext, node->opcode());
const Operator* new_op =
simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectContext());
// Mutate the node in-place.
DCHECK(OperatorProperties::HasContextInput(node->op()));
DCHECK(!OperatorProperties::HasContextInput(new_op));
node->RemoveInput(NodeProperties::FirstContextIndex(node));
NodeProperties::ChangeOp(node, new_op);
return Changed(node);
}
Reduction JSTypedLowering::ReduceJSGeneratorRestoreRegister(Node* node) { Reduction JSTypedLowering::ReduceJSGeneratorRestoreRegister(Node* node) {
DCHECK_EQ(IrOpcode::kJSGeneratorRestoreRegister, node->opcode()); DCHECK_EQ(IrOpcode::kJSGeneratorRestoreRegister, node->opcode());
Node* generator = NodeProperties::GetValueInput(node, 0); Node* generator = NodeProperties::GetValueInput(node, 0);
@ -2190,6 +2205,8 @@ Reduction JSTypedLowering::Reduce(Node* node) {
return ReduceJSGeneratorStore(node); return ReduceJSGeneratorStore(node);
case IrOpcode::kJSGeneratorRestoreContinuation: case IrOpcode::kJSGeneratorRestoreContinuation:
return ReduceJSGeneratorRestoreContinuation(node); return ReduceJSGeneratorRestoreContinuation(node);
case IrOpcode::kJSGeneratorRestoreContext:
return ReduceJSGeneratorRestoreContext(node);
case IrOpcode::kJSGeneratorRestoreRegister: case IrOpcode::kJSGeneratorRestoreRegister:
return ReduceJSGeneratorRestoreRegister(node); return ReduceJSGeneratorRestoreRegister(node);
case IrOpcode::kJSGeneratorRestoreInputOrDebugPos: case IrOpcode::kJSGeneratorRestoreInputOrDebugPos:

View File

@ -72,6 +72,7 @@ class V8_EXPORT_PRIVATE JSTypedLowering final
Reduction ReduceJSStoreMessage(Node* node); Reduction ReduceJSStoreMessage(Node* node);
Reduction ReduceJSGeneratorStore(Node* node); Reduction ReduceJSGeneratorStore(Node* node);
Reduction ReduceJSGeneratorRestoreContinuation(Node* node); Reduction ReduceJSGeneratorRestoreContinuation(Node* node);
Reduction ReduceJSGeneratorRestoreContext(Node* node);
Reduction ReduceJSGeneratorRestoreRegister(Node* node); Reduction ReduceJSGeneratorRestoreRegister(Node* node);
Reduction ReduceJSGeneratorRestoreInputOrDebugPos(Node* node); Reduction ReduceJSGeneratorRestoreInputOrDebugPos(Node* node);
Reduction ReduceNumberBinop(Node* node); Reduction ReduceNumberBinop(Node* node);

View File

@ -182,7 +182,6 @@ bool Linkage::NeedsFrameStateInput(Runtime::FunctionId function) {
case Runtime::kInlineClassOf: case Runtime::kInlineClassOf:
case Runtime::kInlineCreateIterResultObject: case Runtime::kInlineCreateIterResultObject:
case Runtime::kInlineGeneratorClose: case Runtime::kInlineGeneratorClose:
case Runtime::kInlineGeneratorGetContext:
case Runtime::kInlineGeneratorGetInputOrDebugPos: case Runtime::kInlineGeneratorGetInputOrDebugPos:
case Runtime::kInlineGeneratorGetResumeMode: case Runtime::kInlineGeneratorGetResumeMode:
case Runtime::kInlineCreateJSGeneratorObject: case Runtime::kInlineCreateJSGeneratorObject:

View File

@ -191,6 +191,7 @@
V(JSStoreModule) \ V(JSStoreModule) \
V(JSGeneratorStore) \ V(JSGeneratorStore) \
V(JSGeneratorRestoreContinuation) \ V(JSGeneratorRestoreContinuation) \
V(JSGeneratorRestoreContext) \
V(JSGeneratorRestoreRegister) \ V(JSGeneratorRestoreRegister) \
V(JSGeneratorRestoreInputOrDebugPos) \ V(JSGeneratorRestoreInputOrDebugPos) \
V(JSStackCheck) \ V(JSStackCheck) \

View File

@ -1822,6 +1822,10 @@ Type* Typer::Visitor::TypeJSGeneratorRestoreContinuation(Node* node) {
return Type::SignedSmall(); return Type::SignedSmall();
} }
Type* Typer::Visitor::TypeJSGeneratorRestoreContext(Node* node) {
return Type::Any();
}
Type* Typer::Visitor::TypeJSGeneratorRestoreRegister(Node* node) { Type* Typer::Visitor::TypeJSGeneratorRestoreRegister(Node* node) {
return Type::Any(); return Type::Any();
} }

View File

@ -831,6 +831,10 @@ void Verifier::Visitor::Check(Node* node, const AllNodes& all) {
CheckTypeIs(node, Type::SignedSmall()); CheckTypeIs(node, Type::SignedSmall());
break; break;
case IrOpcode::kJSGeneratorRestoreContext:
CheckTypeIs(node, Type::Any());
break;
case IrOpcode::kJSGeneratorRestoreRegister: case IrOpcode::kJSGeneratorRestoreRegister:
CheckTypeIs(node, Type::Any()); CheckTypeIs(node, Type::Any());
break; break;

View File

@ -159,7 +159,6 @@ void BytecodeArrayWriter::UpdateExitSeenInBlock(Bytecode bytecode) {
case Bytecode::kJump: case Bytecode::kJump:
case Bytecode::kJumpConstant: case Bytecode::kJumpConstant:
case Bytecode::kSuspendGenerator: case Bytecode::kSuspendGenerator:
case Bytecode::kSwitchOnGeneratorState:
exit_seen_in_block_ = true; exit_seen_in_block_ = true;
break; break;
default: default:

View File

@ -1134,28 +1134,13 @@ void BytecodeGenerator::BuildGeneratorPrologue() {
generator_jump_table_ = generator_jump_table_ =
builder()->AllocateJumpTable(info()->literal()->suspend_count(), 0); builder()->AllocateJumpTable(info()->literal()->suspend_count(), 0);
BytecodeLabel regular_call; // If the generator is not undefined, this is a resume, so perform state
builder() // dispatch.
->LoadAccumulatorWithRegister(generator_object()) builder()->SwitchOnGeneratorState(generator_object(), generator_jump_table_);
.JumpIfUndefined(&regular_call);
// This is a resume call. Restore the current context and the registers, // Otherwise, fall-through to the ordinary function prologue, after which we
// then perform state dispatch. // will run into the generator object creation and other extra code inserted
{ // by the parser.
RegisterAllocationScope register_scope(this);
Register generator_context = register_allocator()->NewRegister();
builder()
->CallRuntime(Runtime::kInlineGeneratorGetContext, generator_object())
.PushContext(generator_context)
.SwitchOnGeneratorState(generator_object(), generator_jump_table_);
// The switch is guaranteed to jump (or abort), so there is no fall-through.
}
// This is a regular call.
builder()->Bind(&regular_call);
// Now fall through to the ordinary function prologue, after which we will run
// into the generator object creation and other extra code inserted by the
// parser.
} }
void BytecodeGenerator::VisitBlock(Block* stmt) { void BytecodeGenerator::VisitBlock(Block* stmt) {

View File

@ -3110,20 +3110,27 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
// SwitchOnGeneratorState <generator> <table_start> <table_length> // SwitchOnGeneratorState <generator> <table_start> <table_length>
// //
// Loads the |generator|'s state and stores it in the accumulator, before // If |generator| is undefined, falls through. Otherwise, loads the
// overwriting it with kGeneratorExecuting. Then, jumps to the appropriate // generator's state (overwriting it with kGeneratorExecuting), sets the context
// resume bytecode, by looking up the generator state in a jump table in the // to the generator's resume context, and performs state dispatch on the
// generator's state by looking up the generator state in a jump table in the
// constant pool, starting at |table_start|, and of length |table_length|. // constant pool, starting at |table_start|, and of length |table_length|.
IGNITION_HANDLER(SwitchOnGeneratorState, InterpreterAssembler) { IGNITION_HANDLER(SwitchOnGeneratorState, InterpreterAssembler) {
Node* generator_reg = BytecodeOperandReg(0); Node* generator_reg = BytecodeOperandReg(0);
Node* generator = LoadRegister(generator_reg); Node* generator = LoadRegister(generator_reg);
Label fallthrough(this);
GotoIf(WordEqual(generator, UndefinedConstant()), &fallthrough);
Node* state = Node* state =
LoadObjectField(generator, JSGeneratorObject::kContinuationOffset); LoadObjectField(generator, JSGeneratorObject::kContinuationOffset);
Node* new_state = SmiConstant(JSGeneratorObject::kGeneratorExecuting); Node* new_state = SmiConstant(JSGeneratorObject::kGeneratorExecuting);
StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
new_state); new_state);
Node* context = LoadObjectField(generator, JSGeneratorObject::kContextOffset);
SetContext(context);
Node* table_start = BytecodeOperandIdx(1); Node* table_start = BytecodeOperandIdx(1);
// TODO(leszeks): table_length is only used for a CSA_ASSERT, we don't // TODO(leszeks): table_length is only used for a CSA_ASSERT, we don't
// actually need it otherwise. // actually need it otherwise.
@ -3141,6 +3148,9 @@ IGNITION_HANDLER(SwitchOnGeneratorState, InterpreterAssembler) {
Node* entry = IntPtrAdd(table_start, case_value); Node* entry = IntPtrAdd(table_start, case_value);
Node* relative_jump = LoadAndUntagConstantPoolEntry(entry); Node* relative_jump = LoadAndUntagConstantPoolEntry(entry);
Jump(relative_jump); Jump(relative_jump);
BIND(&fallthrough);
Dispatch();
} }
// ResumeGenerator <generator> <first output register> <register count> // ResumeGenerator <generator> <first output register> <register count>

View File

@ -391,15 +391,6 @@ Node* IntrinsicsGenerator::CreateJSGeneratorObject(Node* input, Node* arg_count,
Builtins::kCreateGeneratorObject); Builtins::kCreateGeneratorObject);
} }
Node* IntrinsicsGenerator::GeneratorGetContext(Node* args_reg, Node* arg_count,
Node* context) {
Node* generator = __ LoadRegister(args_reg);
Node* const value =
__ LoadObjectField(generator, JSGeneratorObject::kContextOffset);
return value;
}
Node* IntrinsicsGenerator::GeneratorGetInputOrDebugPos(Node* args_reg, Node* IntrinsicsGenerator::GeneratorGetInputOrDebugPos(Node* args_reg,
Node* arg_count, Node* arg_count,
Node* context) { Node* context) {

View File

@ -18,7 +18,6 @@ namespace interpreter {
V(AsyncGeneratorResolve, async_generator_resolve, 3) \ V(AsyncGeneratorResolve, async_generator_resolve, 3) \
V(AsyncGeneratorYield, async_generator_yield, 3) \ V(AsyncGeneratorYield, async_generator_yield, 3) \
V(CreateJSGeneratorObject, create_js_generator_object, 2) \ V(CreateJSGeneratorObject, create_js_generator_object, 2) \
V(GeneratorGetContext, generator_get_context, 1) \
V(GeneratorGetResumeMode, generator_get_resume_mode, 1) \ V(GeneratorGetResumeMode, generator_get_resume_mode, 1) \
V(GeneratorGetInputOrDebugPos, generator_get_input_or_debug_pos, 1) \ V(GeneratorGetInputOrDebugPos, generator_get_input_or_debug_pos, 1) \
V(GeneratorClose, generator_close, 1) \ V(GeneratorClose, generator_close, 1) \

View File

@ -55,12 +55,6 @@ RUNTIME_FUNCTION(Runtime_GeneratorGetReceiver) {
return generator->receiver(); return generator->receiver();
} }
RUNTIME_FUNCTION(Runtime_GeneratorGetContext) {
// Runtime call is implemented in InterpreterIntrinsics and lowered in
// JSIntrinsicLowering
UNREACHABLE();
}
RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) { RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) {
// Runtime call is implemented in InterpreterIntrinsics and lowered in // Runtime call is implemented in InterpreterIntrinsics and lowered in
// JSIntrinsicLowering // JSIntrinsicLowering

View File

@ -245,7 +245,6 @@ namespace internal {
F(GeneratorClose, 1, 1) \ F(GeneratorClose, 1, 1) \
F(GeneratorGetFunction, 1, 1) \ F(GeneratorGetFunction, 1, 1) \
F(GeneratorGetReceiver, 1, 1) \ F(GeneratorGetReceiver, 1, 1) \
F(GeneratorGetContext, 1, 1) \
F(GeneratorGetInputOrDebugPos, 1, 1) \ F(GeneratorGetInputOrDebugPos, 1, 1) \
F(AsyncGeneratorResolve, 3, 1) \ F(AsyncGeneratorResolve, 3, 1) \
F(AsyncGeneratorReject, 2, 1) \ F(AsyncGeneratorReject, 2, 1) \

View File

@ -14,12 +14,8 @@ snippet: "
" "
frame size: 8 frame size: 8
parameter count: 1 parameter count: 1
bytecode array length: 202 bytecode array length: 192
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2), B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1), B(Mov), R(closure), R(1),
B(Mov), R(this), R(2), B(Mov), R(this), R(2),
@ -117,8 +113,8 @@ constant pool: [
Smi [23], Smi [23],
] ]
handlers: [ handlers: [
[30, 147, 155], [20, 137, 145],
[33, 108, 110], [23, 98, 100],
] ]
--- ---
@ -128,12 +124,8 @@ snippet: "
" "
frame size: 8 frame size: 8
parameter count: 1 parameter count: 1
bytecode array length: 246 bytecode array length: 236
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(3), B(SwitchOnGeneratorState), R(0), U8(0), U8(3),
B(Mov), R(closure), R(1), B(Mov), R(closure), R(1),
B(Mov), R(this), R(2), B(Mov), R(this), R(2),
@ -251,8 +243,8 @@ constant pool: [
Smi [23], Smi [23],
] ]
handlers: [ handlers: [
[30, 191, 199], [20, 181, 189],
[33, 152, 154], [23, 142, 144],
] ]
--- ---
@ -262,12 +254,8 @@ snippet: "
" "
frame size: 22 frame size: 22
parameter count: 1 parameter count: 1
bytecode array length: 506 bytecode array length: 496
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(11),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3), B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(11), B(Mov), R(closure), R(11),
B(Mov), R(this), R(12), B(Mov), R(this), R(12),
@ -504,11 +492,11 @@ constant pool: [
Smi [23], Smi [23],
] ]
handlers: [ handlers: [
[30, 451, 459], [20, 441, 449],
[33, 412, 414], [23, 402, 404],
[71, 235, 243], [61, 225, 233],
[74, 195, 197], [64, 185, 187],
[304, 314, 316], [294, 304, 306],
] ]
--- ---
@ -519,12 +507,8 @@ snippet: "
" "
frame size: 17 frame size: 17
parameter count: 1 parameter count: 1
bytecode array length: 492 bytecode array length: 482
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(5), B(SwitchOnGeneratorState), R(0), U8(0), U8(5),
B(Mov), R(closure), R(1), B(Mov), R(closure), R(1),
B(Mov), R(this), R(2), B(Mov), R(this), R(2),
@ -744,7 +728,7 @@ constant pool: [
Smi [23], Smi [23],
] ]
handlers: [ handlers: [
[30, 437, 445], [20, 427, 435],
[33, 398, 400], [23, 388, 390],
] ]

View File

@ -16,12 +16,8 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 1 parameter count: 1
bytecode array length: 524 bytecode array length: 514
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3), B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(12), B(Mov), R(closure), R(12),
B(Mov), R(this), R(13), B(Mov), R(this), R(13),
@ -257,11 +253,11 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[36, 483, 491], [26, 473, 481],
[39, 441, 443], [29, 431, 433],
[45, 224, 232], [35, 214, 222],
[48, 184, 186], [38, 174, 176],
[292, 341, 343], [282, 331, 333],
] ]
--- ---
@ -273,12 +269,8 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 1 parameter count: 1
bytecode array length: 553 bytecode array length: 543
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3), B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(12), B(Mov), R(closure), R(12),
B(Mov), R(this), R(13), B(Mov), R(this), R(13),
@ -527,11 +519,11 @@ constant pool: [
Smi [22], Smi [22],
] ]
handlers: [ handlers: [
[36, 499, 507], [26, 489, 497],
[39, 456, 458], [29, 446, 448],
[45, 226, 234], [35, 216, 224],
[48, 186, 188], [38, 176, 178],
[295, 344, 346], [285, 334, 336],
] ]
--- ---
@ -546,12 +538,8 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 1 parameter count: 1
bytecode array length: 542 bytecode array length: 532
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3), B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(12), B(Mov), R(closure), R(12),
B(Mov), R(this), R(13), B(Mov), R(this), R(13),
@ -795,11 +783,11 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[36, 501, 509], [26, 491, 499],
[39, 459, 461], [29, 449, 451],
[45, 242, 250], [35, 232, 240],
[48, 202, 204], [38, 192, 194],
[310, 359, 361], [300, 349, 351],
] ]
--- ---

View File

@ -619,12 +619,8 @@ snippet: "
" "
frame size: 19 frame size: 19
parameter count: 2 parameter count: 2
bytecode array length: 308 bytecode array length: 298
bytecodes: [ bytecodes: [
B(Ldar), R(3),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(3), U8(1),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(3), U8(0), U8(1), B(SwitchOnGeneratorState), R(3), U8(0), U8(1),
B(CreateFunctionContext), U8(1), B(CreateFunctionContext), U8(1),
B(PushContext), R(12), B(PushContext), R(12),
@ -764,9 +760,9 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
] ]
handlers: [ handlers: [
[66, 184, 192], [56, 174, 182],
[69, 148, 150], [59, 138, 140],
[252, 262, 264], [242, 252, 254],
] ]
--- ---
@ -778,12 +774,8 @@ snippet: "
" "
frame size: 18 frame size: 18
parameter count: 2 parameter count: 2
bytecode array length: 352 bytecode array length: 342
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(11),
B(SwitchOnGeneratorState), R(2), U8(0), U8(2), B(SwitchOnGeneratorState), R(2), U8(0), U8(2),
B(CreateFunctionContext), U8(1), B(CreateFunctionContext), U8(1),
B(PushContext), R(11), B(PushContext), R(11),
@ -944,9 +936,9 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[66, 221, 229], [56, 211, 219],
[69, 185, 187], [59, 175, 177],
[290, 300, 302], [280, 290, 292],
] ]
--- ---
@ -1156,12 +1148,8 @@ snippet: "
" "
frame size: 24 frame size: 24
parameter count: 2 parameter count: 2
bytecode array length: 433 bytecode array length: 423
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(1), B(SwitchOnGeneratorState), R(2), U8(0), U8(1),
B(CreateFunctionContext), U8(1), B(CreateFunctionContext), U8(1),
B(PushContext), R(12), B(PushContext), R(12),
@ -1361,10 +1349,10 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[44, 392, 400], [34, 382, 390],
[47, 350, 352], [37, 340, 342],
[53, 210, 218], [43, 200, 208],
[56, 170, 172], [46, 160, 162],
[278, 288, 290], [268, 278, 280],
] ]

View File

@ -13,12 +13,8 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 54 bytecode array length: 44
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1), B(Mov), R(closure), R(1),
B(Mov), R(this), R(2), B(Mov), R(this), R(2),
@ -52,12 +48,8 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 90 bytecode array length: 80
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2), B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1), B(Mov), R(closure), R(1),
B(Mov), R(this), R(2), B(Mov), R(this), R(2),
@ -108,12 +100,8 @@ snippet: "
" "
frame size: 17 frame size: 17
parameter count: 1 parameter count: 1
bytecode array length: 346 bytecode array length: 336
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(11),
B(SwitchOnGeneratorState), R(2), U8(0), U8(2), B(SwitchOnGeneratorState), R(2), U8(0), U8(2),
B(Mov), R(closure), R(11), B(Mov), R(closure), R(11),
B(Mov), R(this), R(12), B(Mov), R(this), R(12),
@ -271,9 +259,9 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[58, 215, 223], [48, 205, 213],
[61, 179, 181], [51, 169, 171],
[284, 294, 296], [274, 284, 286],
] ]
--- ---
@ -284,12 +272,8 @@ snippet: "
" "
frame size: 9 frame size: 9
parameter count: 1 parameter count: 1
bytecode array length: 227 bytecode array length: 217
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2), B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1), B(Mov), R(closure), R(1),
B(Mov), R(this), R(2), B(Mov), R(this), R(2),

View File

@ -13,12 +13,8 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 72 bytecode array length: 62
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(4), B(Star), R(4),
@ -58,12 +54,8 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 72 bytecode array length: 62
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(4), B(Star), R(4),
@ -105,12 +97,8 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 102 bytecode array length: 92
bytecodes: [ bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1), B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(5), B(Star), R(5),
@ -166,12 +154,8 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 100 bytecode array length: 90
bytecodes: [ bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1), B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(5), B(Star), R(5),
@ -225,12 +209,8 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 106 bytecode array length: 96
bytecodes: [ bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1), B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(5), B(Star), R(5),
@ -287,12 +267,8 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 110 bytecode array length: 100
bytecodes: [ bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1), B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(5), B(Star), R(5),
@ -347,12 +323,8 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 85 bytecode array length: 75
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(4), B(Star), R(4),
@ -398,12 +370,8 @@ snippet: "
" "
frame size: 7 frame size: 7
parameter count: 2 parameter count: 2
bytecode array length: 106 bytecode array length: 96
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(4), B(Star), R(4),
@ -459,12 +427,8 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 72 bytecode array length: 62
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(4), B(Star), R(4),
@ -504,12 +468,8 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 72 bytecode array length: 62
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(4), B(Star), R(4),
@ -550,12 +510,8 @@ snippet: "
" "
frame size: 8 frame size: 8
parameter count: 2 parameter count: 2
bytecode array length: 99 bytecode array length: 89
bytecodes: [ bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(5), B(Star), R(5),

View File

@ -272,12 +272,8 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 77 bytecode array length: 67
bytecodes: [ bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(2), U8(0), U8(1), B(SwitchOnGeneratorState), R(2), U8(0), U8(1),
B(Mov), R(closure), R(3), B(Mov), R(closure), R(3),
B(Mov), R(this), R(4), B(Mov), R(this), R(4),
@ -324,12 +320,8 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 109 bytecode array length: 99
bytecodes: [ bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(1), U8(0), U8(2), B(SwitchOnGeneratorState), R(1), U8(0), U8(2),
B(Mov), R(closure), R(2), B(Mov), R(closure), R(2),
B(Mov), R(this), R(3), B(Mov), R(this), R(3),
@ -480,12 +472,8 @@ snippet: "
" "
frame size: 11 frame size: 11
parameter count: 1 parameter count: 1
bytecode array length: 198 bytecode array length: 188
bytecodes: [ bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1), B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(Mov), R(closure), R(3), B(Mov), R(closure), R(3),
B(Mov), R(this), R(4), B(Mov), R(this), R(4),
@ -579,7 +567,7 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[36, 157, 165], [26, 147, 155],
[39, 115, 117], [29, 105, 107],
] ]