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

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

Issue 2950773002: [turbofan] Introduce new JSCallWithArrayLike operator. (Closed)
Patch Set: REBASE 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 e2be72764a5aac4934bc78966e1e9503782c63ef..d9789d16d08d2346a940c5d63556c3906c297f2c 100644
--- a/src/builtins/builtins-call-gen.cc
+++ b/src/builtins/builtins-call-gen.cc
@@ -107,6 +107,21 @@ void CallOrConstructBuiltinsAssembler::CallOrConstructWithArrayLike(
if_holey_array(this, Label::kDeferred),
if_runtime(this, Label::kDeferred);
+ // Perform appropriate checks on {target} (and {new_target} first).
+ if (new_target == nullptr) {
+ // Check that {target} is Callable.
+ Label if_target_callable(this),
+ if_target_not_callable(this, Label::kDeferred);
+ GotoIf(TaggedIsSmi(target), &if_target_not_callable);
+ Branch(IsCallable(target), &if_target_callable, &if_target_not_callable);
+ BIND(&if_target_not_callable);
+ {
+ CallRuntime(Runtime::kThrowApplyNonFunction, context, target);
+ Unreachable();
+ }
+ BIND(&if_target_callable);
+ }
+
GotoIf(TaggedIsSmi(arguments_list), &if_runtime);
Node* arguments_list_map = LoadMap(arguments_list);
Node* native_context = LoadNativeContext(context);
« 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