Index: src/ia32/code-stubs-ia32.h |
diff --git a/src/ia32/code-stubs-ia32.h b/src/ia32/code-stubs-ia32.h |
index cc6bd1675c3ed7d11a01f241c9611d5726d77f49..bc0a478a0369644ff77df7e97f1d231631ba7690 100644 |
--- a/src/ia32/code-stubs-ia32.h |
+++ b/src/ia32/code-stubs-ia32.h |
@@ -544,24 +544,27 @@ class RecordWriteStub: public CodeStub { |
value) { // One scratch reg. |
} |
- static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8. |
- static const byte kSkipNonIncrementalPartInstruction = 0xeb; // Jmp #imm8. |
- |
- static byte GetInstruction(bool enable) { |
- // Can't use ternary operator here, because gcc makes an undefined |
- // reference to a static const int. |
- if (enable) { |
- return kSkipNonIncrementalPartInstruction; |
+ static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8. |
+ static const byte kTwoByteJumpInstruction = 0xeb; // Jmp #imm8. |
+ |
+ static const byte kFiveByteNopInstruction = 0x3d; // Cmpl al, #imm32. |
Erik Corry
2011/07/04 11:04:11
You are sure it is al and not eax?
Vyacheslav Egorov (Chromium)
2011/08/05 12:50:28
Done.
|
+ static const byte kFiveByteJumpInstruction = 0xe9; // Jmp #imm32. |
+ |
+ static void Patch(Code* stub, bool incremental, bool compaction) { |
+ ASSERT(!compaction || incremental); |
Erik Corry
2011/07/04 11:04:11
It would be very good to assert that the old opcod
Vyacheslav Egorov (Chromium)
2011/08/05 12:50:28
Done.
|
+ if (incremental) { |
+ if (compaction) { |
+ stub->instruction_start()[0] = kTwoByteNopInstruction; |
+ stub->instruction_start()[2] = kFiveByteJumpInstruction; |
+ } else { |
+ stub->instruction_start()[0] = kTwoByteJumpInstruction; |
+ } |
} else { |
- return kTwoByteNopInstruction; |
+ stub->instruction_start()[0] = kTwoByteNopInstruction; |
+ stub->instruction_start()[2] = kFiveByteNopInstruction; |
} |
} |
- static void Patch(Code* stub, bool enable) { |
- ASSERT(*stub->instruction_start() == GetInstruction(!enable)); |
- *stub->instruction_start() = GetInstruction(enable); |
- } |
- |
private: |
// This is a helper class for freeing up 3 scratch registers, where the third |
// is always ecx (needed for shift operations). The input is two registers |
@@ -710,12 +713,20 @@ class RecordWriteStub: public CodeStub { |
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
}; |
+ enum EvacuationState { |
+ kWithEvacuationCandidates, |
+ kWithoutEvacuationCandidates |
+ }; |
+ |
void Generate(MacroAssembler* masm); |
- void GenerateIncremental(MacroAssembler* masm); |
+ void GenerateIncremental(MacroAssembler* masm, |
+ EvacuationState evacuation_state); |
void CheckNeedsToInformIncrementalMarker( |
MacroAssembler* masm, |
- OnNoNeedToInformIncrementalMarker on_no_need); |
- void InformIncrementalMarker(MacroAssembler* masm); |
+ OnNoNeedToInformIncrementalMarker on_no_need, |
+ EvacuationState evacuation_state); |
+ void InformIncrementalMarker(MacroAssembler* masm, |
+ EvacuationState evacuation_state); |
Major MajorKey() { return RecordWrite; } |