Index: src/compiler/frame-states.cc |
diff --git a/src/compiler/frame-states.cc b/src/compiler/frame-states.cc |
index c5fab683d9d84736abc21ca2d2fe00a733b8b8d9..759fc557a720191d25b9d061990a3f741cdd3298 100644 |
--- a/src/compiler/frame-states.cc |
+++ b/src/compiler/frame-states.cc |
@@ -113,11 +113,11 @@ Node* CreateBuiltinContinuationFrameStateCommon( |
FrameStateType frame_type = |
function.is_null() ? FrameStateType::kBuiltinContinuation |
: FrameStateType::kJavaScriptBuiltinContinuation; |
- Handle<SharedFunctionInfo> shared( |
- Handle<SharedFunctionInfo>(function->shared())); |
const FrameStateFunctionInfo* state_info = |
- common->CreateFrameStateFunctionInfo(frame_type, parameter_count, 0, |
- shared); |
+ common->CreateFrameStateFunctionInfo( |
+ frame_type, parameter_count, 0, |
+ function.is_null() ? Handle<SharedFunctionInfo>() |
+ : Handle<SharedFunctionInfo>(function->shared())); |
const Operator* op = common->FrameState( |
bailout_id, OutputFrameStateCombine::Ignore(), state_info); |
@@ -143,8 +143,12 @@ Node* CreateStubBuiltinContinuationFrameState(JSGraph* js_graph, |
CallInterfaceDescriptor descriptor = callable.descriptor(); |
std::vector<Node*> actual_parameters; |
- // Stack parameters first |
- for (int i = 0; i < descriptor.GetStackParameterCount(); ++i) { |
+ // Stack parameters first. If the deoptimization is LAZY, the final parameter |
+ // is added by the deoptimizer and isn't explicitly passed in the frame state. |
+ int stack_parameter_count = |
+ descriptor.GetRegisterParameterCount() - |
+ (mode == ContinuationFrameStateMode::LAZY ? 1 : 0); |
+ for (int i = 0; i < stack_parameter_count; ++i) { |
actual_parameters.push_back( |
parameters[descriptor.GetRegisterParameterCount() + i]); |
} |
@@ -155,7 +159,7 @@ Node* CreateStubBuiltinContinuationFrameState(JSGraph* js_graph, |
} |
return CreateBuiltinContinuationFrameStateCommon( |
- js_graph, name, context, &actual_parameters[0], |
+ js_graph, name, context, actual_parameters.data(), |
static_cast<int>(actual_parameters.size()), outer_frame_state, |
Handle<JSFunction>()); |
} |