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

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 6541053: Add more generic version of reloc info padding to ensure enough space for rel... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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
Index: src/ia32/lithium-codegen-ia32.cc
===================================================================
--- src/ia32/lithium-codegen-ia32.cc (revision 6848)
+++ src/ia32/lithium-codegen-ia32.cc (working copy)
@@ -55,7 +55,9 @@
// Ensure that we have enough space in the reloc info to patch
// this with calls when doing deoptimization.
if (ensure_reloc_space_) {
- codegen_->masm()->RecordComment(RelocInfo::kFillerCommentString, true);
+ // We can use up to RelocInfo::kMaxCallSize bytes for storing call,
+ // if this includes a long variable length pc-jump.
+ codegen_->AddRelocPadding(RelocInfo::kMaxCallSize);
}
codegen_->RecordSafepoint(pointers_, deoptimization_index_);
}
@@ -78,6 +80,7 @@
return GeneratePrologue() &&
GenerateBody() &&
GenerateDeferredCode() &&
+ GenerateRelocPadding() &&
GenerateSafepointTable();
}
@@ -122,6 +125,15 @@
}
+bool LCodeGen::GenerateRelocPadding() {
+ while(reloc_padding_count_ > 0) {
+ __ RecordComment(RelocInfo::kFillerCommentString, true);
+ reloc_padding_count_ -= RelocInfo::kRelocCommentSize;
+ }
+ return !is_aborted();
+}
+
+
bool LCodeGen::GeneratePrologue() {
ASSERT(is_generating());
@@ -382,6 +394,13 @@
ASSERT(instr != NULL);
LPointerMap* pointers = instr->pointer_map();
RecordPosition(pointers->position());
Søren Thygesen Gjesse 2011/02/21 13:27:20 Move this comment and code to after the '__ call'?
+ // A call will only take up 1 byte in the reloc_info, but patching in the
+ // deoptimizer will take up two since it uses RUNTIME_ENTY as relocation
+ // mode to avoid issues with GC. Any pc-jumps will be the same for both
+ // relocation info objects since we patch at the same spot as the original
+ // call.
+ AddRelocPadding(1);
+
if (!adjusted) {
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
}
@@ -2302,9 +2321,9 @@
__ CallSelf();
} else {
// This is an indirect call and will not be recorded in the reloc info.
- // Add a comment to the reloc info in case we need to patch this during
- // deoptimization.
- __ RecordComment(RelocInfo::kFillerCommentString, true);
+ // We can use up to RelocInfo::kMaxCallSize bytes for storing call, if
+ // this includes a long variable length pc-jump.
+ AddRelocPadding(RelocInfo::kMaxCallSize);
__ call(FieldOperand(edi, JSFunction::kCodeEntryOffset));
}

Powered by Google App Engine
This is Rietveld 408576698