| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
| 9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 // The address of the instruction following the call. | 823 // The address of the instruction following the call. |
| 824 Address test_instruction_address = | 824 Address test_instruction_address = |
| 825 address + Assembler::kCallTargetAddressOffset; | 825 address + Assembler::kCallTargetAddressOffset; |
| 826 | 826 |
| 827 // If the instruction following the call is not a test al, nothing | 827 // If the instruction following the call is not a test al, nothing |
| 828 // was inlined. | 828 // was inlined. |
| 829 return *test_instruction_address == Assembler::kTestAlByte; | 829 return *test_instruction_address == Assembler::kTestAlByte; |
| 830 } | 830 } |
| 831 | 831 |
| 832 | 832 |
| 833 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check) { | 833 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
| 834 InlinedSmiCheck check) { |
| 834 // The address of the instruction following the call. | 835 // The address of the instruction following the call. |
| 835 Address test_instruction_address = | 836 Address test_instruction_address = |
| 836 address + Assembler::kCallTargetAddressOffset; | 837 address + Assembler::kCallTargetAddressOffset; |
| 837 | 838 |
| 838 // If the instruction following the call is not a test al, nothing | 839 // If the instruction following the call is not a test al, nothing |
| 839 // was inlined. | 840 // was inlined. |
| 840 if (*test_instruction_address != Assembler::kTestAlByte) { | 841 if (*test_instruction_address != Assembler::kTestAlByte) { |
| 841 DCHECK(*test_instruction_address == Assembler::kNopByte); | 842 DCHECK(*test_instruction_address == Assembler::kNopByte); |
| 842 return; | 843 return; |
| 843 } | 844 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 863 Condition cc = | 864 Condition cc = |
| 864 (check == ENABLE_INLINED_SMI_CHECK) | 865 (check == ENABLE_INLINED_SMI_CHECK) |
| 865 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 866 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 866 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 867 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 867 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 868 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 868 } | 869 } |
| 869 } // namespace internal | 870 } // namespace internal |
| 870 } // namespace v8 | 871 } // namespace v8 |
| 871 | 872 |
| 872 #endif // V8_TARGET_ARCH_X64 | 873 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |