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

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

Issue 2890363002: Fix deoptmization of inlined TF InstanceOf to call ToBoolean (Closed)
Patch Set: Review feedback 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
« no previous file with comments | « src/builtins/builtins-definitions.h ('k') | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>());
}
« no previous file with comments | « src/builtins/builtins-definitions.h ('k') | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698