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

Unified Diff: src/compiler/frame-states.cc

Issue 2890363002: Fix deoptmization of inlined TF InstanceOf to call ToBoolean (Closed)
Patch Set: Add test flag Created 3 years, 6 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
Index: src/compiler/frame-states.cc
diff --git a/src/compiler/frame-states.cc b/src/compiler/frame-states.cc
index c5fab683d9d84736abc21ca2d2fe00a733b8b8d9..4687cd6d236d1410d9ba499ed1f291865d2cb5b8 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]);
}

Powered by Google App Engine
This is Rietveld 408576698