Chromium Code Reviews| Index: src/x64/ic-x64.cc |
| diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc |
| index 0632ce439f3c2c91171dc70380e52b1893c9330d..5573497c600bbe58b91d8110f60a27e132b2c4a2 100644 |
| --- a/src/x64/ic-x64.cc |
| +++ b/src/x64/ic-x64.cc |
| @@ -1741,11 +1741,11 @@ void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { |
| // Activate inlined smi code. |
| if (previous_state == UNINITIALIZED) { |
| - PatchInlinedSmiCode(address()); |
| + PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); |
| } |
| } |
| -void PatchInlinedSmiCode(Address address) { |
| +void PatchInlinedSmiCode(Address address, InlinedSmiCheck check) { |
| // The address of the instruction following the call. |
| Address test_instruction_address = |
| address + Assembler::kCallTargetAddressOffset; |
| @@ -1769,11 +1769,14 @@ void PatchInlinedSmiCode(Address address) { |
| // Patch with a short conditional jump. There must be a |
| // short jump-if-carry/not-carry at this position. |
|
Vyacheslav Egorov (Chromium)
2012/05/02 11:29:48
Please update the comment just like in ia32
Michael Starzinger
2012/05/03 10:56:21
Done.
|
| Address jmp_address = test_instruction_address - delta; |
| - ASSERT(*jmp_address == Assembler::kJncShortOpcode || |
| - *jmp_address == Assembler::kJcShortOpcode); |
| - Condition cc = *jmp_address == Assembler::kJncShortOpcode |
| - ? not_zero |
| - : zero; |
| + ASSERT((check == ENABLE_INLINED_SMI_CHECK) |
| + ? (*jmp_address == Assembler::kJncShortOpcode || |
| + *jmp_address == Assembler::kJcShortOpcode) |
| + : (*jmp_address == Assembler::kJnzShortOpcode || |
| + *jmp_address == Assembler::kJzShortOpcode)); |
| + Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
| + ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| + : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| } |