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

Unified Diff: src/compiler/js-inlining.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/arm64/builtins-arm64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index 7e0aa13411a46d325ad67532815169ac8312dc20..6d8824fbea52ecc4c1e508bb8a55199d839ab3cd 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -61,7 +61,7 @@ class JSCallFunctionAccessor {
namespace {
-// A facade on a JSFunction's graph to facilitate inlining. It assumes the
+// A facade on a JSFunction's graph to facilitate inlining. It assumes
// that the function graph has only one return statement, and provides
// {UnifyReturn} to convert a function graph to that end.
class Inlinee {
@@ -363,6 +363,12 @@ Reduction JSInliner::Reduce(Node* node) {
Node* outer_frame_state = call.frame_state();
// Insert argument adaptor frame if required.
if (call.formal_arguments() != inlinee.formal_parameters()) {
+ // In strong mode, in case of too few arguments we need to throw a
+ // TypeError so we must not inline this call.
+ if (is_strong(info.language_mode()) &&
+ call.formal_arguments() < inlinee.formal_parameters()) {
+ return NoChange();
+ }
outer_frame_state =
CreateArgumentsAdaptorFrameState(&call, function, info.zone());
}
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698