Index: src/compiler/osr.cc |
diff --git a/src/compiler/osr.cc b/src/compiler/osr.cc |
index 55431c201c69250984daf1f7c051950d359da6f5..86a71430f1aa406c670205da3ac5fdb9a5794671 100644 |
--- a/src/compiler/osr.cc |
+++ b/src/compiler/osr.cc |
@@ -24,10 +24,16 @@ namespace internal { |
namespace compiler { |
OsrHelper::OsrHelper(CompilationInfo* info) |
- : parameter_count_(info->scope()->num_parameters()), |
- stack_slot_count_(info->scope()->num_stack_slots() + |
- info->osr_expr_stack_height()) {} |
- |
+ : parameter_count_( |
+ info->is_optimizing_from_bytecode() |
+ ? info->shared_info()->bytecode_array()->parameter_count() |
+ : info->scope()->num_parameters()), |
+ stack_slot_count_( |
+ info->is_optimizing_from_bytecode() |
+ ? info->shared_info()->bytecode_array()->register_count() + |
+ InterpreterFrameConstants::kExtraSlotCount |
+ : info->scope()->num_stack_slots() + |
+ info->osr_expr_stack_height()) {} |
#ifdef DEBUG |
#define TRACE_COND (FLAG_trace_turbo_graph && FLAG_trace_osr) |