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

Unified Diff: src/objects.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/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index f223b0fc9461a138fb0abd67d7bee22fcdea85b1..b6e0eaca94a8871cc780adea4225941fb672709c 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -7933,17 +7933,11 @@ Object* AccessorPair::GetComponent(AccessorComponent component) {
Handle<DeoptimizationInputData> DeoptimizationInputData::New(
- Isolate* isolate, int deopt_entry_count, int return_patch_address_count,
- PretenureFlag pretenure) {
- DCHECK(deopt_entry_count + return_patch_address_count > 0);
- Handle<FixedArray> deoptimization_data =
- Handle<FixedArray>::cast(isolate->factory()->NewFixedArray(
- LengthFor(deopt_entry_count, return_patch_address_count), pretenure));
- deoptimization_data->set(kDeoptEntryCountIndex,
- Smi::FromInt(deopt_entry_count));
- deoptimization_data->set(kReturnAddressPatchEntryCountIndex,
- Smi::FromInt(return_patch_address_count));
- return Handle<DeoptimizationInputData>::cast(deoptimization_data);
+ Isolate* isolate, int deopt_entry_count, PretenureFlag pretenure) {
+ DCHECK(deopt_entry_count > 0);
+ return Handle<DeoptimizationInputData>::cast(
+ isolate->factory()->NewFixedArray(LengthFor(deopt_entry_count),
+ pretenure));
}
@@ -10291,26 +10285,7 @@ int Code::SourceStatementPosition(Address pc) {
SafepointEntry Code::GetSafepointEntry(Address pc) {
SafepointTable table(this);
- SafepointEntry entry = table.FindEntry(pc);
- if (entry.is_valid() || !is_turbofanned()) {
- return entry;
- }
-
- // If the code is turbofanned, we might be looking for
- // an address that was patched by lazy deoptimization.
- // In that case look through the patch table, try to
- // lookup the original address there, and then use this
- // to find the safepoint entry.
- DeoptimizationInputData* deopt_data =
- DeoptimizationInputData::cast(deoptimization_data());
- intptr_t offset = pc - instruction_start();
- for (int i = 0; i < deopt_data->ReturnAddressPatchCount(); i++) {
- if (deopt_data->PatchedAddressPc(i)->value() == offset) {
- int original_offset = deopt_data->ReturnAddressPc(i)->value();
- return table.FindEntry(instruction_start() + original_offset);
- }
- }
- return SafepointEntry();
+ return table.FindEntry(pc);
}
@@ -10863,19 +10838,6 @@ void DeoptimizationInputData::DeoptimizationInputDataPrint(
os << "\n";
}
}
-
- int return_address_patch_count = ReturnAddressPatchCount();
- if (return_address_patch_count != 0) {
- os << "Return address patch data (count = " << return_address_patch_count
- << ")\n";
- os << " index pc patched_pc\n";
- }
- for (int i = 0; i < return_address_patch_count; i++) {
- Vector<char> buf = Vector<char>::New(128);
- SNPrintF(buf, "%6d %6d %12d\n", i, ReturnAddressPc(i)->value(),
- PatchedAddressPc(i)->value());
- os << buf.start();
- }
}
@@ -11006,6 +10968,13 @@ void Code::Disassemble(const char* name, OStream& os) { // NOLINT
} else {
os << "<none>";
}
+ if (entry.deoptimization_pc() != Safepoint::kNoDeoptimizationPc) {
+ Vector<char> buf2 = Vector<char>::New(30);
+ SNPrintF(buf2, "%6d", entry.deoptimization_pc());
+ os << buf2.start();
+ } else {
+ os << "<none>";
+ }
if (entry.argument_count() > 0) {
os << " argc: " << entry.argument_count();
}
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698