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

Unified Diff: src/assembler.cc

Issue 11574027: Use direct jump and call instruction for X64 when the deoptimization entries are in the code range (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years 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/assembler.cc
===================================================================
--- src/assembler.cc (revision 13219)
+++ src/assembler.cc (working copy)
@@ -293,10 +293,14 @@
const int kStatementPositionTag = 2;
const int kCommentTag = 3;
+#if !defined(V8_TARGET_ARCH_X64)
Sven Panne 2012/12/14 08:20:11 Again for this and the rest of the file: No archit
const int kConstPoolExtraTag = kPCJumpExtraTag - 2;
const int kConstPoolTag = 3;
+#else
+const int kDeoptEntryExtraTag = kPCJumpExtraTag - 2;
+const int kDeoptEntryTag = 3;
+#endif
-
uint32_t RelocInfoWriter::WriteVariableLengthPCJump(uint32_t pc_delta) {
// Return if the pc_delta can fit in kSmallPCDeltaBits bits.
// Otherwise write a variable length PC jump for the bits that do
@@ -353,6 +357,8 @@
}
}
+
+#if !defined(V8_TARGET_ARCH_X64)
void RelocInfoWriter::WriteExtraTaggedConstPoolData(int data) {
WriteExtraTag(kConstPoolExtraTag, kConstPoolTag);
for (int i = 0; i < kIntSize; i++) {
@@ -361,7 +367,18 @@
data = data >> kBitsPerByte;
}
}
+#else
+void RelocInfoWriter::WriteExtraTaggedDeoptEntryData(int data) {
+ WriteExtraTag(kDeoptEntryExtraTag, kDeoptEntryTag);
+ for (int i = 0; i < kIntSize; i++) {
+ *--pos_ = static_cast<byte>(data);
+ // Signed right shift is arithmetic shift. Tested in test-utils.cc.
+ data = data >> kBitsPerByte;
+ }
+}
+#endif
+
void RelocInfoWriter::WriteExtraTaggedData(intptr_t data_delta, int top_tag) {
WriteExtraTag(kDataJumpExtraTag, top_tag);
for (int i = 0; i < kIntptrSize; i++) {
@@ -425,9 +442,15 @@
WriteExtraTaggedPC(pc_delta, kPCJumpExtraTag);
WriteExtraTaggedData(rinfo->data(), kCommentTag);
ASSERT(begin_pos - pos_ >= RelocInfo::kMinRelocCommentSize);
+#if !defined(V8_TARGET_ARCH_X64)
} else if (RelocInfo::IsConstPool(rmode)) {
WriteExtraTaggedPC(pc_delta, kPCJumpExtraTag);
WriteExtraTaggedConstPoolData(static_cast<int>(rinfo->data()));
+#else
+ } else if (RelocInfo::IsDeoptEntry(rmode)) {
+ WriteExtraTaggedPC(pc_delta, kPCJumpExtraTag);
+ WriteExtraTaggedDeoptEntryData(static_cast<int>(rinfo->data()));
+#endif
} else {
ASSERT(rmode > RelocInfo::LAST_COMPACT_ENUM);
int saved_mode = rmode - RelocInfo::LAST_COMPACT_ENUM;
@@ -620,6 +643,7 @@
}
Advance(kIntptrSize);
}
+#if !defined(V8_TARGET_ARCH_X64)
} else if ((extra_tag == kConstPoolExtraTag) &&
(GetTopTag() == kConstPoolTag)) {
if (SetMode(RelocInfo::CONST_POOL)) {
@@ -627,6 +651,15 @@
return;
}
Advance(kIntSize);
+#else
+ } else if ((extra_tag == kDeoptEntryExtraTag) &&
+ (GetTopTag() == kDeoptEntryTag)) {
+ if (SetMode(RelocInfo::DEOPT_ENTRY)) {
+ AdvanceReadConstPoolData();
+ return;
+ }
+ Advance(kIntSize);
+#endif
} else {
AdvanceReadPC();
int rmode = extra_tag + RelocInfo::LAST_COMPACT_ENUM;
@@ -725,8 +758,13 @@
return "external reference";
case RelocInfo::INTERNAL_REFERENCE:
return "internal reference";
+#if !defined(V8_TARGET_ARCH_X64)
case RelocInfo::CONST_POOL:
return "constant pool";
+#else
+ case RelocInfo::DEOPT_ENTRY:
+ return "deopt entry";
+#endif
case RelocInfo::DEBUG_BREAK_SLOT:
#ifndef ENABLE_DEBUGGER_SUPPORT
UNREACHABLE();
@@ -814,7 +852,11 @@
case STATEMENT_POSITION:
case EXTERNAL_REFERENCE:
case INTERNAL_REFERENCE:
+#if !defined(V8_TARGET_ARCH_X64)
case CONST_POOL:
+#else
+ case DEOPT_ENTRY:
+#endif
case DEBUG_BREAK_SLOT:
case NONE:
break;

Powered by Google App Engine
This is Rietveld 408576698