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

Unified Diff: src/deoptimizer.cc

Issue 1694183003: Use explicit context translation in CodeStub deoptimization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment Created 4 years, 10 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/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index 9528cbb299741f80854985b992cf5ff0f5c07439..5a0389669c051dce412d67b953188f3fe700d3ac 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -1734,7 +1734,9 @@ void Deoptimizer::DoComputeCompiledStubFrame(int frame_index) {
// object to the stub failure handler.
int param_count = descriptor.GetRegisterParameterCount();
int stack_param_count = descriptor.GetStackParameterCount();
- CHECK_EQ(translated_frame->height(), param_count);
+ // The translated frame contains all of the register parameters
+ // plus the context.
+ CHECK_EQ(translated_frame->height(), param_count + 1);
CHECK_GE(param_count, 0);
int height_in_bytes = kPointerSize * (param_count + stack_param_count) +
@@ -1793,15 +1795,10 @@ void Deoptimizer::DoComputeCompiledStubFrame(int frame_index) {
"caller's constant_pool\n");
}
- // The context can be gotten from the input frame.
- Register context_reg = StubFailureTrampolineFrame::context_register();
- input_frame_offset -= kPointerSize;
- value = input_->GetFrameSlot(input_frame_offset);
- output_frame->SetRegister(context_reg.code(), value);
+ // Remember where the context will need to be written back from the deopt
+ // translation.
output_frame_offset -= kPointerSize;
- output_frame->SetFrameSlot(output_frame_offset, value);
- CHECK(reinterpret_cast<Object*>(value)->IsContext());
- DebugPrintOutputSlot(value, frame_index, output_frame_offset, "context\n");
+ unsigned context_frame_offset = output_frame_offset;
// A marker value is used in place of the function.
output_frame_offset -= kPointerSize;
@@ -1859,6 +1856,15 @@ void Deoptimizer::DoComputeCompiledStubFrame(int frame_index) {
}
}
+ Object* maybe_context = value_iterator->GetRawValue();
+ CHECK(maybe_context->IsContext());
+ Register context_reg = StubFailureTrampolineFrame::context_register();
+ value = reinterpret_cast<intptr_t>(maybe_context);
+ output_frame->SetRegister(context_reg.code(), value);
+ output_frame->SetFrameSlot(context_frame_offset, value);
+ DebugPrintOutputSlot(value, frame_index, context_frame_offset, "context\n");
+ ++value_iterator;
+
// Copy constant stack parameters to the failure frame. If the number of stack
// parameters is not known in the descriptor, the arguments object is the way
// to access them.
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698