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 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ | 5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ |
6 #define V8_X64_ASSEMBLER_X64_INL_H_ | 6 #define V8_X64_ASSEMBLER_X64_INL_H_ |
7 | 7 |
8 #include "src/x64/assembler-x64.h" | 8 #include "src/x64/assembler-x64.h" |
9 | 9 |
10 #include "src/base/cpu.h" | 10 #include "src/base/cpu.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 RelocInfo::Mode rmode, | 58 RelocInfo::Mode rmode, |
59 TypeFeedbackId ast_id) { | 59 TypeFeedbackId ast_id) { |
60 DCHECK(RelocInfo::IsCodeTarget(rmode) || | 60 DCHECK(RelocInfo::IsCodeTarget(rmode) || |
61 rmode == RelocInfo::CODE_AGE_SEQUENCE); | 61 rmode == RelocInfo::CODE_AGE_SEQUENCE); |
62 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { | 62 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { |
63 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, ast_id.ToInt()); | 63 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, ast_id.ToInt()); |
64 } else { | 64 } else { |
65 RecordRelocInfo(rmode); | 65 RecordRelocInfo(rmode); |
66 } | 66 } |
67 int current = code_targets_.length(); | 67 int current = code_targets_.length(); |
68 if (current > 0 && code_targets_.last().is_identical_to(target)) { | 68 if (current > 0 && code_targets_.last().address() == target.address()) { |
69 // Optimization if we keep jumping to the same code target. | 69 // Optimization if we keep jumping to the same code target. |
70 emitl(current - 1); | 70 emitl(current - 1); |
71 } else { | 71 } else { |
72 code_targets_.Add(target); | 72 code_targets_.Add(target); |
73 emitl(current); | 73 emitl(current); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 | 77 |
78 void Assembler::emit_runtime_entry(Address entry, RelocInfo::Mode rmode) { | 78 void Assembler::emit_runtime_entry(Address entry, RelocInfo::Mode rmode) { |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 void Operand::set_disp64(int64_t disp) { | 609 void Operand::set_disp64(int64_t disp) { |
610 DCHECK_EQ(1, len_); | 610 DCHECK_EQ(1, len_); |
611 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); | 611 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); |
612 *p = disp; | 612 *p = disp; |
613 len_ += sizeof(disp); | 613 len_ += sizeof(disp); |
614 } | 614 } |
615 } // namespace internal | 615 } // namespace internal |
616 } // namespace v8 | 616 } // namespace v8 |
617 | 617 |
618 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 618 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |