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

Unified Diff: src/deoptimizer.cc

Issue 504493002: Fix deoptimization address patching in Turbofan to use safepoints. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Compilation fix. Created 6 years, 4 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/compiler/instruction-selector.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | 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 5209a51611915952c8ec44af98bfff76bdc581ce..e6415f4b238360dedbebd5d89dccfc00721b6312 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -442,23 +442,6 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) {
}
-static int FindPatchAddressForReturnAddress(Code* code, int pc) {
- DeoptimizationInputData* input_data =
- DeoptimizationInputData::cast(code->deoptimization_data());
- int patch_count = input_data->ReturnAddressPatchCount();
- for (int i = 0; i < patch_count; i++) {
- int return_pc = input_data->ReturnAddressPc(i)->value();
- int patch_pc = input_data->PatchedAddressPc(i)->value();
- // If the supplied pc matches the return pc or if the address
- // has been already patched, return the patch pc.
- if (pc == return_pc || pc == patch_pc) {
- return patch_pc;
- }
- }
- return -1;
-}
-
-
// For all marked Turbofanned code on stack, change the return address to go
// to the deoptimization block.
void Deoptimizer::PatchStackForMarkedCode(Isolate* isolate) {
@@ -474,7 +457,8 @@ void Deoptimizer::PatchStackForMarkedCode(Isolate* isolate) {
Address* pc_address = it.frame()->pc_address();
int pc_offset =
static_cast<int>(*pc_address - code->instruction_start());
- int new_pc_offset = FindPatchAddressForReturnAddress(code, pc_offset);
+ SafepointEntry safepoint_entry = code->GetSafepointEntry(*pc_address);
+ unsigned new_pc_offset = safepoint_entry.deoptimization_pc();
if (FLAG_trace_deopt) {
CodeTracer::Scope scope(isolate->GetCodeTracer());
@@ -484,8 +468,8 @@ void Deoptimizer::PatchStackForMarkedCode(Isolate* isolate) {
new_pc_offset);
}
- CHECK_LE(0, new_pc_offset);
- *pc_address += new_pc_offset - pc_offset;
+ CHECK(new_pc_offset != Safepoint::kNoDeoptimizationPc);
+ *pc_address += static_cast<int>(new_pc_offset) - pc_offset;
}
}
}
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698