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

Unified Diff: src/builtins/builtins-call-gen.cc

Issue 2949813002: [turbofan] Introduce new JSConstructWithArrayLike operator. (Closed)
Patch Set: Address feedback. Created 3 years, 6 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/builtins/arm64/builtins-arm64.cc ('k') | src/builtins/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-call-gen.cc
diff --git a/src/builtins/builtins-call-gen.cc b/src/builtins/builtins-call-gen.cc
index d9789d16d08d2346a940c5d63556c3906c297f2c..6aede19f490f9cecccb988b2a59df72bd9ffb8d8 100644
--- a/src/builtins/builtins-call-gen.cc
+++ b/src/builtins/builtins-call-gen.cc
@@ -120,6 +120,32 @@ void CallOrConstructBuiltinsAssembler::CallOrConstructWithArrayLike(
Unreachable();
}
BIND(&if_target_callable);
+ } else {
+ // Check that {target} is a Constructor.
+ Label if_target_constructor(this),
+ if_target_not_constructor(this, Label::kDeferred);
+ GotoIf(TaggedIsSmi(target), &if_target_not_constructor);
+ Branch(IsConstructor(target), &if_target_constructor,
+ &if_target_not_constructor);
+ BIND(&if_target_not_constructor);
+ {
+ CallRuntime(Runtime::kThrowNotConstructor, context, target);
+ Unreachable();
+ }
+ BIND(&if_target_constructor);
+
+ // Check that {new_target} is a Constructor.
+ Label if_new_target_constructor(this),
+ if_new_target_not_constructor(this, Label::kDeferred);
+ GotoIf(TaggedIsSmi(new_target), &if_new_target_not_constructor);
+ Branch(IsConstructor(new_target), &if_new_target_constructor,
+ &if_new_target_not_constructor);
+ BIND(&if_new_target_not_constructor);
+ {
+ CallRuntime(Runtime::kThrowNotConstructor, context, new_target);
+ Unreachable();
+ }
+ BIND(&if_new_target_constructor);
}
GotoIf(TaggedIsSmi(arguments_list), &if_runtime);
« no previous file with comments | « src/builtins/arm64/builtins-arm64.cc ('k') | src/builtins/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698