Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index aa56ca92e72b667c4c5f9ad8d5de431abab02d0d..6f87d272cc12e88e1b6a902253d68366eb36e25b 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -163,7 +163,16 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub, |
parameter_count_(0), |
optimization_id_(-1), |
osr_expr_stack_height_(0), |
- function_type_(nullptr) {} |
+ function_type_(nullptr) { |
+ // Parameter count is number of stack parameters. |
+ if (code_stub_ != NULL) { |
+ CodeStubDescriptor descriptor(code_stub_); |
+ parameter_count_ = descriptor.GetStackParameterCount(); |
+ if (descriptor.function_mode() == NOT_JS_FUNCTION_STUB_MODE) { |
+ parameter_count_--; |
+ } |
+ } |
+} |
CompilationInfo::~CompilationInfo() { |