| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Patch the code at the current PC with a call to the target address. | 48 // Patch the code at the current PC with a call to the target address. |
| 49 // Additional guard int3 instructions can be added if required. | 49 // Additional guard int3 instructions can be added if required. |
| 50 void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { | 50 void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { |
| 51 int code_size = Assembler::kCallSequenceLength + guard_bytes; | 51 int code_size = Assembler::kCallSequenceLength + guard_bytes; |
| 52 | 52 |
| 53 // Create a code patcher. | 53 // Create a code patcher. |
| 54 CodePatcher patcher(pc_, code_size); | 54 CodePatcher patcher(pc_, code_size); |
| 55 | 55 |
| 56 // Add a label for checking the size of the code used for returning. | 56 // Add a label for checking the size of the code used for returning. |
| 57 #ifdef DEBUG | 57 #if DCHECK_IS_ON |
| 58 Label check_codesize; | 58 Label check_codesize; |
| 59 patcher.masm()->bind(&check_codesize); | 59 patcher.masm()->bind(&check_codesize); |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 // Patch the code. | 62 // Patch the code. |
| 63 patcher.masm()->movp(kScratchRegister, reinterpret_cast<void*>(target), | 63 patcher.masm()->movp(kScratchRegister, reinterpret_cast<void*>(target), |
| 64 Assembler::RelocInfoNone()); | 64 Assembler::RelocInfoNone()); |
| 65 patcher.masm()->call(kScratchRegister); | 65 patcher.masm()->call(kScratchRegister); |
| 66 | 66 |
| 67 // Check that the size of the code generated is as expected. | 67 // Check that the size of the code generated is as expected. |
| (...skipping 3282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3350 | 3350 |
| 3351 | 3351 |
| 3352 bool RelocInfo::IsInConstantPool() { | 3352 bool RelocInfo::IsInConstantPool() { |
| 3353 return false; | 3353 return false; |
| 3354 } | 3354 } |
| 3355 | 3355 |
| 3356 | 3356 |
| 3357 } } // namespace v8::internal | 3357 } } // namespace v8::internal |
| 3358 | 3358 |
| 3359 #endif // V8_TARGET_ARCH_X64 | 3359 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |