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

Unified Diff: src/hydrogen.cc

Issue 1115263004: [strong] Check arity of functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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-inlining.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 77890f6fbf8f3aca926641450cbe885d14277ecd..dcecb89e22f8634236f1d32c7acff57f297ae4d8 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8123,6 +8123,15 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
return false;
}
+ // In strong mode it is an error to call a function with too few arguments.
+ // In that case do not inline because then the arity check would be skipped.
+ if (is_strong(function->language_mode()) &&
+ arguments_count < function->parameter_count()) {
+ TraceInline(target, caller,
+ "too few arguments passed to a strong function");
+ return false;
+ }
+
// ----------------------------------------------------------------
// After this point, we've made a decision to inline this function (so
// TryInline should always return true).
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698