Index: src/compiler/js-intrinsic-lowering.cc |
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc |
index 6f916bed6d7f064c0029ea45759f8b86d4d16112..b9ee8a4ed6cd3d93fdcbacf0ee6f4fd3f42ed758 100644 |
--- a/src/compiler/js-intrinsic-lowering.cc |
+++ b/src/compiler/js-intrinsic-lowering.cc |
@@ -38,6 +38,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { |
return ReduceDeoptimizeNow(node); |
case Runtime::kInlineGeneratorClose: |
return ReduceGeneratorClose(node); |
+ case Runtime::kInlineCreateJSGeneratorObject: |
+ return ReduceCreateJSGeneratorObject(node); |
case Runtime::kInlineGeneratorGetInputOrDebugPos: |
return ReduceGeneratorGetInputOrDebugPos(node); |
case Runtime::kInlineAsyncGeneratorGetAwaitInputOrDebugPos: |
@@ -159,6 +161,19 @@ Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) { |
return Changed(node); |
} |
+Reduction JSIntrinsicLowering::ReduceCreateJSGeneratorObject(Node* node) { |
+ Node* const closure = NodeProperties::GetValueInput(node, 0); |
+ Node* const receiver = NodeProperties::GetValueInput(node, 1); |
+ Node* const context = NodeProperties::GetContextInput(node); |
+ Node* const effect = NodeProperties::GetEffectInput(node); |
+ Node* const control = NodeProperties::GetControlInput(node); |
+ Operator const* const op = javascript()->CreateGeneratorObject(); |
+ Node* create_generator = |
+ graph()->NewNode(op, closure, receiver, context, effect, control); |
+ ReplaceWithValue(node, create_generator, create_generator); |
+ return Changed(create_generator); |
+} |
+ |
Reduction JSIntrinsicLowering::ReduceGeneratorClose(Node* node) { |
Node* const generator = NodeProperties::GetValueInput(node, 0); |
Node* const effect = NodeProperties::GetEffectInput(node); |