Commit c476e8af authored by mvstanton's avatar mvstanton Committed by Commit bot

[ignition] Use an intrinsic for GeneratorClose.

GeneratorClose is pretty simple, we can handle it in the interpreter.

BUG=v8:6351

Review-Url: https://codereview.chromium.org/2891353002
Cr-Commit-Position: refs/heads/master@{#45434}
parent 930e31e6
...@@ -434,6 +434,18 @@ Node* IntrinsicsGenerator::GeneratorGetResumeMode(Node* args_reg, ...@@ -434,6 +434,18 @@ Node* IntrinsicsGenerator::GeneratorGetResumeMode(Node* args_reg,
return value; return value;
} }
Node* IntrinsicsGenerator::GeneratorClose(Node* args_reg, Node* arg_count,
Node* context) {
Node* generator = __ LoadRegister(args_reg);
Node* const value =
__ LoadObjectField(generator, JSGeneratorObject::kResumeModeOffset);
__ StoreObjectFieldNoWriteBarrier(
generator, JSGeneratorObject::kContinuationOffset,
__ SmiConstant(JSGeneratorObject::kGeneratorClosed));
return value;
}
Node* IntrinsicsGenerator::AsyncGeneratorReject(Node* input, Node* arg_count, Node* IntrinsicsGenerator::AsyncGeneratorReject(Node* input, Node* arg_count,
Node* context) { Node* context) {
return IntrinsicAsBuiltinCall(input, context, return IntrinsicAsBuiltinCall(input, context,
......
...@@ -22,6 +22,7 @@ namespace interpreter { ...@@ -22,6 +22,7 @@ namespace interpreter {
V(GeneratorGetContext, generator_get_context, 1) \ 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(Call, call, -1) \ V(Call, call, -1) \
V(ClassOf, class_of, 1) \ V(ClassOf, class_of, 1) \
V(CreateIterResultObject, create_iter_result_object, 2) \ V(CreateIterResultObject, create_iter_result_object, 2) \
......
...@@ -644,7 +644,7 @@ snippet: " ...@@ -644,7 +644,7 @@ snippet: "
" "
frame size: 15 frame size: 15
parameter count: 2 parameter count: 2
bytecode array length: 590 bytecode array length: 589
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(25), B(JumpIfUndefined), U8(25),
...@@ -877,7 +877,7 @@ bytecodes: [ ...@@ -877,7 +877,7 @@ bytecodes: [
B(Star), R(8), B(Star), R(8),
B(LdaImmutableCurrentContextSlot), U8(5), B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(9), B(Star), R(9),
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(9), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(9), U8(1),
B(Ldar), R(8), B(Ldar), R(8),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(6), B(Ldar), R(6),
...@@ -924,7 +924,7 @@ snippet: " ...@@ -924,7 +924,7 @@ snippet: "
" "
frame size: 17 frame size: 17
parameter count: 2 parameter count: 2
bytecode array length: 696 bytecode array length: 695
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(25), B(JumpIfUndefined), U8(25),
...@@ -1203,7 +1203,7 @@ bytecodes: [ ...@@ -1203,7 +1203,7 @@ bytecodes: [
B(Star), R(7), B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(5), B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(8), B(Star), R(8),
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(8), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(8), U8(1),
B(Ldar), R(7), B(Ldar), R(7),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(5), B(Ldar), R(5),
......
...@@ -13,7 +13,7 @@ snippet: " ...@@ -13,7 +13,7 @@ snippet: "
" "
frame size: 11 frame size: 11
parameter count: 1 parameter count: 1
bytecode array length: 174 bytecode array length: 173
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(25), B(JumpIfUndefined), U8(25),
...@@ -85,7 +85,7 @@ bytecodes: [ ...@@ -85,7 +85,7 @@ bytecodes: [
B(Star), R(5), B(Star), R(5),
B(LdaImmutableCurrentContextSlot), U8(4), B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(6), B(Star), R(6),
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(6), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(6), U8(1),
B(Ldar), R(5), B(Ldar), R(5),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(3), B(Ldar), R(3),
...@@ -114,7 +114,7 @@ snippet: " ...@@ -114,7 +114,7 @@ snippet: "
" "
frame size: 11 frame size: 11
parameter count: 1 parameter count: 1
bytecode array length: 246 bytecode array length: 245
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(25), B(JumpIfUndefined), U8(25),
...@@ -220,7 +220,7 @@ bytecodes: [ ...@@ -220,7 +220,7 @@ bytecodes: [
B(Star), R(5), B(Star), R(5),
B(LdaImmutableCurrentContextSlot), U8(4), B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(6), B(Star), R(6),
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(6), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(6), U8(1),
B(Ldar), R(5), B(Ldar), R(5),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(3), B(Ldar), R(3),
...@@ -250,7 +250,7 @@ snippet: " ...@@ -250,7 +250,7 @@ snippet: "
" "
frame size: 17 frame size: 17
parameter count: 1 parameter count: 1
bytecode array length: 692 bytecode array length: 691
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(25), B(JumpIfUndefined), U8(25),
...@@ -527,7 +527,7 @@ bytecodes: [ ...@@ -527,7 +527,7 @@ bytecodes: [
B(Star), R(7), B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4), B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(8), B(Star), R(8),
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(8), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(8), U8(1),
B(Ldar), R(7), B(Ldar), R(7),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(5), B(Ldar), R(5),
......
...@@ -273,7 +273,7 @@ snippet: " ...@@ -273,7 +273,7 @@ snippet: "
" "
frame size: 14 frame size: 14
parameter count: 1 parameter count: 1
bytecode array length: 332 bytecode array length: 331
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(25), B(JumpIfUndefined), U8(25),
...@@ -414,7 +414,7 @@ bytecodes: [ ...@@ -414,7 +414,7 @@ bytecodes: [
B(Star), R(8), B(Star), R(8),
B(LdaImmutableCurrentContextSlot), U8(4), B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(9), B(Star), R(9),
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(9), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(9), U8(1),
B(Ldar), R(8), B(Ldar), R(8),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(6), B(Ldar), R(6),
...@@ -448,7 +448,7 @@ snippet: " ...@@ -448,7 +448,7 @@ snippet: "
" "
frame size: 13 frame size: 13
parameter count: 1 parameter count: 1
bytecode array length: 439 bytecode array length: 438
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(25), B(JumpIfUndefined), U8(25),
...@@ -635,7 +635,7 @@ bytecodes: [ ...@@ -635,7 +635,7 @@ bytecodes: [
B(Star), R(7), B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4), B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(8), B(Star), R(8),
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(8), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(8), U8(1),
B(Ldar), R(7), B(Ldar), R(7),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(5), B(Ldar), R(5),
......
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