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 1993073003: [turbofan] Implement intrinsic lowering of %_GeneratorClose. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@gen-turbo
Patch Set: bytecode expectations rebaseline Created 4 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/parsing/parser.cc » ('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 70bcda5991de542c6724ee8d096428576934ff1b..fb4d95d134ffb10db094fca6ef76c9db1bd93efe 100644
--- a/src/compiler/js-intrinsic-lowering.cc
+++ b/src/compiler/js-intrinsic-lowering.cc
@@ -40,6 +40,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceDoubleHi(node);
case Runtime::kInlineDoubleLo:
return ReduceDoubleLo(node);
+ case Runtime::kInlineGeneratorClose:
+ return ReduceGeneratorClose(node);
case Runtime::kInlineIsArray:
return ReduceIsInstanceType(node, JS_ARRAY_TYPE);
case Runtime::kInlineIsTypedArray:
@@ -152,6 +154,19 @@ Reduction JSIntrinsicLowering::ReduceDoubleLo(Node* node) {
return Change(node, machine()->Float64ExtractLowWord32());
}
+Reduction JSIntrinsicLowering::ReduceGeneratorClose(Node* node) {
+ Node* const generator = NodeProperties::GetValueInput(node, 0);
+ Node* const effect = NodeProperties::GetEffectInput(node);
+ Node* const control = NodeProperties::GetControlInput(node);
+ Node* const closed = jsgraph()->Constant(JSGeneratorObject::kGeneratorClosed);
+ Node* const undefined = jsgraph()->UndefinedConstant();
+ Operator const* const op = simplified()->StoreField(
+ AccessBuilder::ForJSGeneratorObjectContinuation());
+
+ ReplaceWithValue(node, undefined, node);
+ NodeProperties::RemoveType(node);
+ return Change(node, op, generator, closed, effect, control);
+}
Reduction JSIntrinsicLowering::ReduceIsInstanceType(
Node* node, InstanceType instance_type) {
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698