Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 9bdc070300512b44f0c6ea5ba292b8530655ef9f..de603d8cb9a684fe9e3e349436a4e806fbdacb76 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8121,6 +8121,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). |