Commit 814d08a6 authored by jarin's avatar jarin Committed by Commit Bot

Move closing of generators upon final return to the generator-resume builtin.

Review-Url: https://codereview.chromium.org/2936813002
Cr-Commit-Position: refs/heads/master@{#45906}
parent 322b2d7d
...@@ -26,8 +26,6 @@ class GeneratorBuiltinsAssembler : public CodeStubAssembler { ...@@ -26,8 +26,6 @@ class GeneratorBuiltinsAssembler : public CodeStubAssembler {
void GeneratorBuiltinsAssembler::GeneratorPrototypeResume( void GeneratorBuiltinsAssembler::GeneratorPrototypeResume(
Node* receiver, Node* value, Node* context, Node* receiver, Node* value, Node* context,
JSGeneratorObject::ResumeMode resume_mode, char const* const method_name) { JSGeneratorObject::ResumeMode resume_mode, char const* const method_name) {
Node* closed = SmiConstant(JSGeneratorObject::kGeneratorClosed);
// Check if the {receiver} is actually a JSGeneratorObject. // Check if the {receiver} is actually a JSGeneratorObject.
Label if_receiverisincompatible(this, Label::kDeferred); Label if_receiverisincompatible(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &if_receiverisincompatible); GotoIf(TaggedIsSmi(receiver), &if_receiverisincompatible);
...@@ -41,6 +39,7 @@ void GeneratorBuiltinsAssembler::GeneratorPrototypeResume( ...@@ -41,6 +39,7 @@ void GeneratorBuiltinsAssembler::GeneratorPrototypeResume(
LoadObjectField(receiver, JSGeneratorObject::kContinuationOffset); LoadObjectField(receiver, JSGeneratorObject::kContinuationOffset);
Label if_receiverisclosed(this, Label::kDeferred), Label if_receiverisclosed(this, Label::kDeferred),
if_receiverisrunning(this, Label::kDeferred); if_receiverisrunning(this, Label::kDeferred);
Node* closed = SmiConstant(JSGeneratorObject::kGeneratorClosed);
GotoIf(SmiEqual(receiver_continuation, closed), &if_receiverisclosed); GotoIf(SmiEqual(receiver_continuation, closed), &if_receiverisclosed);
DCHECK_LT(JSGeneratorObject::kGeneratorExecuting, DCHECK_LT(JSGeneratorObject::kGeneratorExecuting,
JSGeneratorObject::kGeneratorClosed); JSGeneratorObject::kGeneratorClosed);
...@@ -56,18 +55,27 @@ void GeneratorBuiltinsAssembler::GeneratorPrototypeResume( ...@@ -56,18 +55,27 @@ void GeneratorBuiltinsAssembler::GeneratorPrototypeResume(
// Make sure we close the generator if there was an exception. // Make sure we close the generator if there was an exception.
GotoIfException(result, &if_exception, &var_exception); GotoIfException(result, &if_exception, &var_exception);
// If the generator is not suspended (i.e., it's state is 'closed'), // If the generator is not suspended (i.e., its state is 'executing'),
// wrap the return value in IteratorResult. // close it and wrap the return value in IteratorResult.
Node* result_continuation = Node* result_continuation =
LoadObjectField(receiver, JSGeneratorObject::kContinuationOffset); LoadObjectField(receiver, JSGeneratorObject::kContinuationOffset);
GotoIf(SmiEqual(result_continuation, closed), &if_final_return);
// The generator function should not close the generator by itself, let's
// check it is indeed not closed yet.
CSA_ASSERT(this, SmiNotEqual(result_continuation, closed));
Node* executing = SmiConstant(JSGeneratorObject::kGeneratorExecuting);
GotoIf(SmiEqual(result_continuation, executing), &if_final_return);
Return(result); Return(result);
Callable create_iter_result_object = Callable create_iter_result_object =
Builtins::CallableFor(isolate(), Builtins::kCreateIterResultObject); Builtins::CallableFor(isolate(), Builtins::kCreateIterResultObject);
BIND(&if_final_return); BIND(&if_final_return);
{ {
// Close the generator.
StoreObjectFieldNoWriteBarrier(
receiver, JSGeneratorObject::kContinuationOffset, closed);
// Return the wrapped result. // Return the wrapped result.
Return( Return(
CallStub(create_iter_result_object, context, result, TrueConstant())); CallStub(create_iter_result_object, context, result, TrueConstant()));
......
...@@ -2249,8 +2249,13 @@ void BytecodeGenerator::BuildReturn() { ...@@ -2249,8 +2249,13 @@ void BytecodeGenerator::BuildReturn() {
if (info()->literal()->feedback_vector_spec()->HasTypeProfileSlot()) { if (info()->literal()->feedback_vector_spec()->HasTypeProfileSlot()) {
builder()->CollectTypeProfile(info()->literal()->return_position()); builder()->CollectTypeProfile(info()->literal()->return_position());
} }
if (IsGeneratorFunction(info()->literal()->kind())) { if (IsAsyncGeneratorFunction(info()->literal()->kind())) {
// Mark the generator as closed if returning from a generator function. // Mark the generator as closed if returning from an async generator
// function. Note that non-async generators are closed by the
// generator-resume builtin.
// TODO(jarin,caitp) Move the async generator closing to the resume
// builtin.
RegisterAllocationScope register_scope(this); RegisterAllocationScope register_scope(this);
Register result = register_allocator()->NewRegister(); Register result = register_allocator()->NewRegister();
builder() builder()
......
...@@ -386,14 +386,6 @@ bool Rewriter::Rewrite(ParseInfo* info, Isolate* isolate) { ...@@ -386,14 +386,6 @@ bool Rewriter::Rewrite(ParseInfo* info, Isolate* isolate) {
int pos = kNoSourcePosition; int pos = kNoSourcePosition;
Expression* result_value = Expression* result_value =
processor.factory()->NewVariableProxy(result, pos); processor.factory()->NewVariableProxy(result, pos);
if (scope->is_module_scope()) {
auto args = new (info->zone()) ZoneList<Expression*>(2, info->zone());
args->Add(result_value, info->zone());
args->Add(processor.factory()->NewBooleanLiteral(true, pos),
info->zone());
result_value = processor.factory()->NewCallRuntime(
Runtime::kInlineCreateIterResultObject, args, pos);
}
Statement* result_statement = Statement* result_statement =
processor.factory()->NewReturnStatement(result_value, pos); processor.factory()->NewReturnStatement(result_value, pos);
body->Add(result_statement, info->zone()); body->Add(result_statement, info->zone());
......
...@@ -643,7 +643,7 @@ snippet: " ...@@ -643,7 +643,7 @@ snippet: "
" "
frame size: 20 frame size: 20
parameter count: 2 parameter count: 2
bytecode array length: 370 bytecode array length: 358
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(11), B(Mov), R(new_target), R(11),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -682,7 +682,6 @@ bytecodes: [ ...@@ -682,7 +682,6 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(14), B(Ldar), R(14),
/* 11 E> */ B(Throw), /* 11 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(11), U8(1),
B(Ldar), R(14), B(Ldar), R(14),
/* 55 S> */ B(Return), /* 55 S> */ B(Return),
B(LdaZero), B(LdaZero),
...@@ -794,14 +793,11 @@ bytecodes: [ ...@@ -794,14 +793,11 @@ bytecodes: [
B(Ldar), R(15), B(Ldar), R(15),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(14),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(11), U8(1),
B(Ldar), R(14),
/* 55 S> */ B(Return), /* 55 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [53], Smi [53],
Smi [14], Smi [10],
Smi [7], Smi [7],
SYMBOL_TYPE, SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
...@@ -814,9 +810,9 @@ constant pool: [ ...@@ -814,9 +810,9 @@ constant pool: [
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
] ]
handlers: [ handlers: [
[108, 226, 232], [104, 222, 228],
[111, 190, 192], [107, 186, 188],
[292, 302, 304], [288, 298, 300],
] ]
--- ---
...@@ -828,7 +824,7 @@ snippet: " ...@@ -828,7 +824,7 @@ snippet: "
" "
frame size: 20 frame size: 20
parameter count: 2 parameter count: 2
bytecode array length: 453 bytecode array length: 437
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(10), B(Mov), R(new_target), R(10),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -867,7 +863,6 @@ bytecodes: [ ...@@ -867,7 +863,6 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(13), B(Ldar), R(13),
/* 11 E> */ B(Throw), /* 11 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(10), U8(1),
B(Ldar), R(13), B(Ldar), R(13),
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
B(LdaZero), B(LdaZero),
...@@ -1003,22 +998,18 @@ bytecodes: [ ...@@ -1003,22 +998,18 @@ bytecodes: [
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(13), B(Ldar), R(13),
B(SwitchOnSmiNoFeedback), U8(16), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(16), U8(2), I8(0),
B(Jump), U8(12), B(Jump), U8(8),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(10), U8(1),
B(Ldar), R(14), B(Ldar), R(14),
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
B(Ldar), R(14), B(Ldar), R(14),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(10), U8(1),
B(Ldar), R(13),
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [53], Smi [53],
Smi [117], Smi [113],
Smi [14], Smi [10],
Smi [7], Smi [7],
SYMBOL_TYPE, SYMBOL_TYPE,
Smi [87], Smi [87],
...@@ -1033,12 +1024,12 @@ constant pool: [ ...@@ -1033,12 +1024,12 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [6], Smi [6],
Smi [13], Smi [9],
] ]
handlers: [ handlers: [
[108, 298, 304], [104, 294, 300],
[111, 262, 264], [107, 258, 260],
[365, 375, 377], [361, 371, 373],
] ]
--- ---
......
...@@ -13,7 +13,7 @@ snippet: " ...@@ -13,7 +13,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 104 bytecode array length: 92
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(1), B(Mov), R(new_target), R(1),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -48,18 +48,14 @@ bytecodes: [ ...@@ -48,18 +48,14 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(3), B(Ldar), R(3),
/* 11 E> */ B(Throw), /* 11 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(1), U8(1),
B(Ldar), R(3), B(Ldar), R(3),
/* 16 S> */ B(Return), /* 16 S> */ B(Return),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(1), U8(1),
B(Ldar), R(3),
/* 16 S> */ B(Return), /* 16 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [45], Smi [45],
Smi [14], Smi [10],
Smi [7], Smi [7],
] ]
handlers: [ handlers: [
...@@ -72,7 +68,7 @@ snippet: " ...@@ -72,7 +68,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 1 parameter count: 1
bytecode array length: 158 bytecode array length: 142
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(1), B(Mov), R(new_target), R(1),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -107,7 +103,6 @@ bytecodes: [ ...@@ -107,7 +103,6 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3), B(Ldar), R(3),
/* 11 E> */ B(Throw), /* 11 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(1), U8(1),
B(Ldar), R(3), B(Ldar), R(3),
/* 25 S> */ B(Return), /* 25 S> */ B(Return),
/* 16 S> */ B(LdaSmi), I8(42), /* 16 S> */ B(LdaSmi), I8(42),
...@@ -128,21 +123,17 @@ bytecodes: [ ...@@ -128,21 +123,17 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(3), B(Ldar), R(3),
/* 16 E> */ B(Throw), /* 16 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(1), U8(1),
B(Ldar), R(3), B(Ldar), R(3),
/* 25 S> */ B(Return), /* 25 S> */ B(Return),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(1), U8(1),
B(Ldar), R(3),
/* 25 S> */ B(Return), /* 25 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [45], Smi [45],
Smi [99], Smi [95],
Smi [14], Smi [10],
Smi [7], Smi [7],
Smi [14], Smi [10],
Smi [7], Smi [7],
] ]
handlers: [ handlers: [
...@@ -155,7 +146,7 @@ snippet: " ...@@ -155,7 +146,7 @@ snippet: "
" "
frame size: 19 frame size: 19
parameter count: 1 parameter count: 1
bytecode array length: 447 bytecode array length: 431
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(10), B(Mov), R(new_target), R(10),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -190,7 +181,6 @@ bytecodes: [ ...@@ -190,7 +181,6 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(12), B(Ldar), R(12),
/* 11 E> */ B(Throw), /* 11 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(10), U8(1),
B(Ldar), R(12), B(Ldar), R(12),
/* 44 S> */ B(Return), /* 44 S> */ B(Return),
B(LdaZero), B(LdaZero),
...@@ -326,22 +316,18 @@ bytecodes: [ ...@@ -326,22 +316,18 @@ bytecodes: [
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(12), B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(17), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(17), U8(2), I8(0),
B(Jump), U8(12), B(Jump), U8(8),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(10), U8(1),
B(Ldar), R(13), B(Ldar), R(13),
/* 44 S> */ B(Return), /* 44 S> */ B(Return),
B(Ldar), R(13), B(Ldar), R(13),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(10), U8(1),
B(Ldar), R(12),
/* 44 S> */ B(Return), /* 44 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [45], Smi [45],
Smi [111], Smi [107],
Smi [14], Smi [10],
Smi [7], Smi [7],
TUPLE2_TYPE, TUPLE2_TYPE,
SYMBOL_TYPE, SYMBOL_TYPE,
...@@ -357,12 +343,12 @@ constant pool: [ ...@@ -357,12 +343,12 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [6], Smi [6],
Smi [13], Smi [9],
] ]
handlers: [ handlers: [
[100, 292, 298], [96, 288, 294],
[103, 256, 258], [99, 252, 254],
[359, 369, 371], [355, 365, 367],
] ]
--- ---
...@@ -373,7 +359,7 @@ snippet: " ...@@ -373,7 +359,7 @@ snippet: "
" "
frame size: 15 frame size: 15
parameter count: 1 parameter count: 1
bytecode array length: 500 bytecode array length: 476
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(9), B(Mov), R(new_target), R(9),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -408,7 +394,6 @@ bytecodes: [ ...@@ -408,7 +394,6 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(11), B(Ldar), R(11),
/* 38 E> */ B(Throw), /* 38 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(9), U8(1),
B(Ldar), R(11), B(Ldar), R(11),
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
/* 43 S> */ B(LdaUndefined), /* 43 S> */ B(LdaUndefined),
...@@ -445,8 +430,8 @@ bytecodes: [ ...@@ -445,8 +430,8 @@ bytecodes: [
B(JumpIfTrue), U8(39), B(JumpIfTrue), U8(39),
B(LdaSmi), I8(2), B(LdaSmi), I8(2),
B(TestEqualStrict), R(11), U8(28), B(TestEqualStrict), R(11), U8(28),
B(JumpIfTrue), U8(78), B(JumpIfTrue), U8(74),
B(Jump), U8(236), B(Jump), U8(232),
B(LdaNamedProperty), R(4), U8(7), U8(13), B(LdaNamedProperty), R(4), U8(7), U8(13),
B(Star), R(12), B(Star), R(12),
B(CallProperty1), R(12), R(4), R(1), U8(11), B(CallProperty1), R(12), R(4), R(1), U8(11),
...@@ -455,12 +440,11 @@ bytecodes: [ ...@@ -455,12 +440,11 @@ bytecodes: [
B(JumpIfToBooleanFalse), U8(4), B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7), B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(3), U8(1), B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(3), U8(1),
B(Jump), U8(208), B(Jump), U8(204),
B(LdaNamedProperty), R(4), U8(8), U8(16), B(LdaNamedProperty), R(4), U8(8), U8(16),
B(Star), R(3), B(Star), R(3),
B(TestUndetectable), B(TestUndetectable),
B(JumpIfFalse), U8(9), B(JumpIfFalse), U8(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(9), U8(1),
B(Ldar), R(1), B(Ldar), R(1),
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
B(Mov), R(3), R(12), B(Mov), R(3), R(12),
...@@ -552,31 +536,25 @@ bytecodes: [ ...@@ -552,31 +536,25 @@ bytecodes: [
B(Star), R(1), B(Star), R(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(2), B(Star), R(2),
B(Wide), B(JumpLoop), U16(327), I16(0), B(Wide), B(JumpLoop), U16(323), I16(0),
B(LdaSmi), I8(1), B(LdaSmi), I8(1),
B(TestEqualStrict), R(2), U8(31), B(TestEqualStrict), R(2), U8(31),
B(JumpIfFalse), U8(15), B(JumpIfFalse), U8(7),
B(LdaNamedProperty), R(3), U8(14), U8(32), B(LdaNamedProperty), R(3), U8(14), U8(32),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(9), U8(1),
B(Ldar), R(11),
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
B(LdaNamedProperty), R(3), U8(14), U8(34), B(LdaNamedProperty), R(3), U8(14), U8(34),
B(Star), R(8), B(Star), R(8),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(9), U8(1),
B(Ldar), R(11),
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [45], Smi [45],
Smi [115], Smi [111],
Smi [14], Smi [10],
Smi [7], Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
SYMBOL_TYPE, SYMBOL_TYPE,
Smi [300], Smi [296],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["throw"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["throw"],
...@@ -587,6 +565,6 @@ constant pool: [ ...@@ -587,6 +565,6 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
] ]
handlers: [ handlers: [
[310, 320, 322], [302, 312, 314],
] ]
...@@ -13,7 +13,7 @@ snippet: " ...@@ -13,7 +13,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 120 bytecode array length: 111
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -59,10 +59,6 @@ bytecodes: [ ...@@ -59,10 +59,6 @@ bytecodes: [
B(Ldar), R(3), B(Ldar), R(3),
B(StaCurrentContextSlot), U8(5), B(StaCurrentContextSlot), U8(5),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 13 S> */ B(Return), /* 13 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -80,7 +76,7 @@ snippet: " ...@@ -80,7 +76,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 120 bytecode array length: 111
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -126,10 +122,6 @@ bytecodes: [ ...@@ -126,10 +122,6 @@ bytecodes: [
B(Ldar), R(3), B(Ldar), R(3),
B(StaCurrentContextSlot), U8(5), B(StaCurrentContextSlot), U8(5),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 24 S> */ B(Return), /* 24 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -149,7 +141,7 @@ snippet: " ...@@ -149,7 +141,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 164 bytecode array length: 155
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -214,10 +206,6 @@ bytecodes: [ ...@@ -214,10 +206,6 @@ bytecodes: [
B(StaContextSlot), R(3), U8(5), U8(0), B(StaContextSlot), R(3), U8(5), U8(0),
B(PopContext), R(3), B(PopContext), R(3),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 64 S> */ B(Return), /* 64 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -239,7 +227,7 @@ snippet: " ...@@ -239,7 +227,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 162 bytecode array length: 153
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -303,10 +291,6 @@ bytecodes: [ ...@@ -303,10 +291,6 @@ bytecodes: [
B(StaContextSlot), R(3), U8(5), U8(0), B(StaContextSlot), R(3), U8(5), U8(0),
B(PopContext), R(3), B(PopContext), R(3),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -327,7 +311,7 @@ snippet: " ...@@ -327,7 +311,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 166 bytecode array length: 157
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -393,10 +377,6 @@ bytecodes: [ ...@@ -393,10 +377,6 @@ bytecodes: [
B(StaContextSlot), R(3), U8(5), U8(0), B(StaContextSlot), R(3), U8(5), U8(0),
B(PopContext), R(3), B(PopContext), R(3),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -417,7 +397,7 @@ snippet: " ...@@ -417,7 +397,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 170 bytecode array length: 161
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -483,10 +463,6 @@ bytecodes: [ ...@@ -483,10 +463,6 @@ bytecodes: [
B(StaContextSlot), R(3), U8(5), U8(0), B(StaContextSlot), R(3), U8(5), U8(0),
B(PopContext), R(3), B(PopContext), R(3),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 51 S> */ B(Return), /* 51 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -505,7 +481,7 @@ snippet: " ...@@ -505,7 +481,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 131 bytecode array length: 122
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -555,10 +531,6 @@ bytecodes: [ ...@@ -555,10 +531,6 @@ bytecodes: [
B(CreateClosure), U8(4), U8(3), U8(0), B(CreateClosure), U8(4), U8(3), U8(0),
B(StaModuleVariable), I8(1), U8(0), B(StaModuleVariable), I8(1), U8(0),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 32 S> */ B(Return), /* 32 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -577,7 +549,7 @@ snippet: " ...@@ -577,7 +549,7 @@ snippet: "
" "
frame size: 8 frame size: 8
parameter count: 2 parameter count: 2
bytecode array length: 164 bytecode array length: 155
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -639,10 +611,6 @@ bytecodes: [ ...@@ -639,10 +611,6 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1), B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(StaModuleVariable), I8(1), U8(0), B(StaModuleVariable), I8(1), U8(0),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 26 S> */ B(Return), /* 26 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -661,7 +629,7 @@ snippet: " ...@@ -661,7 +629,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 120 bytecode array length: 111
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -707,10 +675,6 @@ bytecodes: [ ...@@ -707,10 +675,6 @@ bytecodes: [
B(Ldar), R(3), B(Ldar), R(3),
B(StaCurrentContextSlot), U8(5), B(StaCurrentContextSlot), U8(5),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 30 S> */ B(Return), /* 30 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -728,7 +692,7 @@ snippet: " ...@@ -728,7 +692,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 120 bytecode array length: 111
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -774,10 +738,6 @@ bytecodes: [ ...@@ -774,10 +738,6 @@ bytecodes: [
B(Ldar), R(3), B(Ldar), R(3),
B(StaCurrentContextSlot), U8(5), B(StaCurrentContextSlot), U8(5),
B(LdaCurrentContextSlot), U8(5), B(LdaCurrentContextSlot), U8(5),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 19 S> */ B(Return), /* 19 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -796,7 +756,7 @@ snippet: " ...@@ -796,7 +756,7 @@ snippet: "
" "
frame size: 7 frame size: 7
parameter count: 2 parameter count: 2
bytecode array length: 158 bytecode array length: 149
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(0), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -856,10 +816,6 @@ bytecodes: [ ...@@ -856,10 +816,6 @@ bytecodes: [
/* 31 E> */ B(CallProperty2), R(3), R(4), R(5), R(6), U8(3), /* 31 E> */ B(CallProperty2), R(3), R(4), R(5), R(6), U8(3),
B(StaCurrentContextSlot), U8(6), B(StaCurrentContextSlot), U8(6),
B(LdaCurrentContextSlot), U8(6), B(LdaCurrentContextSlot), U8(6),
B(Star), R(3),
B(LdaTrue),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
/* 45 S> */ B(Return), /* 45 S> */ B(Return),
] ]
constant pool: [ constant pool: [
......
...@@ -273,7 +273,7 @@ snippet: " ...@@ -273,7 +273,7 @@ snippet: "
" "
frame size: 11 frame size: 11
parameter count: 1 parameter count: 1
bytecode array length: 184 bytecode array length: 172
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(7), B(Mov), R(new_target), R(7),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -308,7 +308,6 @@ bytecodes: [ ...@@ -308,7 +308,6 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(9), B(Ldar), R(9),
/* 11 E> */ B(Throw), /* 11 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(7), U8(1),
B(Ldar), R(9), B(Ldar), R(9),
/* 62 S> */ B(Return), /* 62 S> */ B(Return),
/* 31 S> */ B(LdaZero), /* 31 S> */ B(LdaZero),
...@@ -350,14 +349,11 @@ bytecodes: [ ...@@ -350,14 +349,11 @@ bytecodes: [
B(Jump), U8(5), B(Jump), U8(5),
B(JumpLoop), U8(68), I8(0), B(JumpLoop), U8(68), I8(0),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(9),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(7), U8(1),
B(Ldar), R(9),
/* 62 S> */ B(Return), /* 62 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [45], Smi [45],
Smi [14], Smi [10],
Smi [7], Smi [7],
] ]
handlers: [ handlers: [
...@@ -372,7 +368,7 @@ snippet: " ...@@ -372,7 +368,7 @@ snippet: "
" "
frame size: 11 frame size: 11
parameter count: 1 parameter count: 1
bytecode array length: 276 bytecode array length: 260
bytecodes: [ bytecodes: [
B(Mov), R(new_target), R(6), B(Mov), R(new_target), R(6),
B(Ldar), R(new_target), B(Ldar), R(new_target),
...@@ -407,7 +403,6 @@ bytecodes: [ ...@@ -407,7 +403,6 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(8), B(Ldar), R(8),
/* 11 E> */ B(Throw), /* 11 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(6), U8(1),
B(Ldar), R(8), B(Ldar), R(8),
/* 56 S> */ B(Return), /* 56 S> */ B(Return),
/* 31 S> */ B(LdaZero), /* 31 S> */ B(LdaZero),
...@@ -440,7 +435,7 @@ bytecodes: [ ...@@ -440,7 +435,7 @@ bytecodes: [
/* 36 E> */ B(TestLessThan), R(0), U8(5), /* 36 E> */ B(TestLessThan), R(0), U8(5),
B(JumpIfFalse), U8(4), B(JumpIfFalse), U8(4),
B(Jump), U8(4), B(Jump), U8(4),
B(Jump), U8(107), B(Jump), U8(103),
B(Ldar), R(7), B(Ldar), R(7),
B(SwitchOnSmiNoFeedback), U8(5), U8(1), I8(1), B(SwitchOnSmiNoFeedback), U8(5), U8(1), I8(1),
B(LdaSmi), I8(-2), B(LdaSmi), I8(-2),
...@@ -451,7 +446,7 @@ bytecodes: [ ...@@ -451,7 +446,7 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kAbort), R(8), U8(1), B(CallRuntime), U16(Runtime::kAbort), R(8), U8(1),
B(LdaSmi), I8(1), B(LdaSmi), I8(1),
B(TestEqual), R(5), U8(6), B(TestEqual), R(5), U8(6),
B(JumpIfFalse), U8(67), B(JumpIfFalse), U8(63),
/* 18 E> */ B(StackCheck), /* 18 E> */ B(StackCheck),
/* 47 S> */ B(LdaSmi), I8(1), /* 47 S> */ B(LdaSmi), I8(1),
B(Mov), R(0), R(8), B(Mov), R(0), R(8),
...@@ -470,33 +465,29 @@ bytecodes: [ ...@@ -470,33 +465,29 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(6), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(6), U8(2), I8(0),
B(Ldar), R(8), B(Ldar), R(8),
/* 47 E> */ B(Throw), /* 47 E> */ B(Throw),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(6), U8(1),
B(Ldar), R(8), B(Ldar), R(8),
/* 56 S> */ B(Return), /* 56 S> */ B(Return),
B(LdaZero), B(LdaZero),
B(Star), R(5), B(Star), R(5),
B(Mov), R(0), R(3), B(Mov), R(0), R(3),
B(Ldar), R(3), B(Ldar), R(3),
B(JumpLoop), U8(90), I8(1), B(JumpLoop), U8(86), I8(1),
B(LdaSmi), I8(1), B(LdaSmi), I8(1),
/* 54 E> */ B(TestEqual), R(5), U8(7), /* 54 E> */ B(TestEqual), R(5), U8(7),
B(JumpIfFalse), U8(4), B(JumpIfFalse), U8(4),
B(Jump), U8(5), B(Jump), U8(5),
B(JumpLoop), U8(160), I8(0), B(JumpLoop), U8(156), I8(0),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(8),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(6), U8(1),
B(Ldar), R(8),
/* 56 S> */ B(Return), /* 56 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [45], Smi [45],
Smi [86], Smi [82],
Smi [14], Smi [10],
Smi [7], Smi [7],
Smi [56], Smi [56],
Smi [48], Smi [48],
Smi [14], Smi [10],
Smi [7], Smi [7],
] ]
handlers: [ handlers: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment