Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: src/compiler/js-intrinsic-lowering.cc

Issue 2862213002: [turbofan] Optimized support for CreateGeneratorObject. (Closed)
Patch Set: Add control input. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698