Commit 0acfd5af authored by ulan@chromium.org's avatar ulan@chromium.org

Fix offset computation for EmitProfilingCounterReset in x64.

R=jkummerow@chromium.org
BUG=v8:2039

Review URL: https://chromiumcodereview.appspot.com/9903015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11186 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 429407d5
......@@ -113,7 +113,6 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
static const byte kJnsInstruction = 0x79;
static const byte kJnsOffset = 0x1f;
static const byte kJnsOffsetDebugCode = 0x53;
static const byte kJaeInstruction = 0x73;
static const byte kJaeOffset = 0x07;
static const byte kCallInstruction = 0xe8;
......@@ -146,15 +145,7 @@ void Deoptimizer::PatchStackCheckCodeAt(Code* unoptimized_code,
//
if (FLAG_count_based_interrupts) {
ASSERT_EQ(kJnsInstruction, *(call_target_address - 3));
if (FLAG_debug_code) {
// FullCodeGenerator::EmitProfilingCounterReset() makes use of
// masm->Move(Operand&, Smi*), which generates additional code
// when FLAG_debug_code is set, so the jump offset is larger
// in that case.
ASSERT_EQ(kJnsOffsetDebugCode, *(call_target_address - 2));
} else {
ASSERT_EQ(kJnsOffset, *(call_target_address - 2));
}
ASSERT_EQ(kJnsOffset, *(call_target_address - 2));
} else {
ASSERT_EQ(kJaeInstruction, *(call_target_address - 3));
ASSERT_EQ(kJaeOffset, *(call_target_address - 2));
......@@ -184,12 +175,7 @@ void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code,
ASSERT_EQ(kCallInstruction, *(call_target_address - 1));
if (FLAG_count_based_interrupts) {
*(call_target_address - 3) = kJnsInstruction;
if (FLAG_debug_code) {
// See comment above: larger jump offset if debug code is generated.
*(call_target_address - 2) = kJnsOffsetDebugCode;
} else {
*(call_target_address - 2) = kJnsOffset;
}
*(call_target_address - 2) = kJnsOffset;
} else {
*(call_target_address - 3) = kJaeInstruction;
*(call_target_address - 2) = kJaeOffset;
......
......@@ -315,8 +315,11 @@ void FullCodeGenerator::EmitProfilingCounterReset() {
reset_value = 10;
}
__ movq(rbx, profiling_counter_, RelocInfo::EMBEDDED_OBJECT);
__ Move(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset),
Smi::FromInt(reset_value));
__ movq(kScratchRegister,
reinterpret_cast<uint64_t>(Smi::FromInt(reset_value)),
RelocInfo::NONE);
__ movq(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset),
kScratchRegister);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment