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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 Memory::uint64_at(pc_) = x; | 46 Memory::uint64_at(pc_) = x; |
47 pc_ += sizeof(uint64_t); | 47 pc_ += sizeof(uint64_t); |
48 } | 48 } |
49 | 49 |
50 | 50 |
51 void Assembler::emitw(uint16_t x) { | 51 void Assembler::emitw(uint16_t x) { |
52 Memory::uint16_at(pc_) = x; | 52 Memory::uint16_at(pc_) = x; |
53 pc_ += sizeof(uint16_t); | 53 pc_ += sizeof(uint16_t); |
54 } | 54 } |
55 | 55 |
56 | 56 void Assembler::emit_code_target(Handle<Code> target, RelocInfo::Mode rmode) { |
57 void Assembler::emit_code_target(Handle<Code> target, | |
58 RelocInfo::Mode rmode, | |
59 TypeFeedbackId ast_id) { | |
60 DCHECK(RelocInfo::IsCodeTarget(rmode) || | 57 DCHECK(RelocInfo::IsCodeTarget(rmode) || |
61 rmode == RelocInfo::CODE_AGE_SEQUENCE); | 58 rmode == RelocInfo::CODE_AGE_SEQUENCE); |
62 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { | 59 RecordRelocInfo(rmode); |
63 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, ast_id.ToInt()); | |
64 } else { | |
65 RecordRelocInfo(rmode); | |
66 } | |
67 int current = code_targets_.length(); | 60 int current = code_targets_.length(); |
68 if (current > 0 && code_targets_.last().address() == target.address()) { | 61 if (current > 0 && code_targets_.last().address() == target.address()) { |
69 // Optimization if we keep jumping to the same code target. | 62 // Optimization if we keep jumping to the same code target. |
70 emitl(current - 1); | 63 emitl(current - 1); |
71 } else { | 64 } else { |
72 code_targets_.Add(target); | 65 code_targets_.Add(target); |
73 emitl(current); | 66 emitl(current); |
74 } | 67 } |
75 } | 68 } |
76 | 69 |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 void Operand::set_disp64(int64_t disp) { | 599 void Operand::set_disp64(int64_t disp) { |
607 DCHECK_EQ(1, len_); | 600 DCHECK_EQ(1, len_); |
608 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); | 601 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); |
609 *p = disp; | 602 *p = disp; |
610 len_ += sizeof(disp); | 603 len_ += sizeof(disp); |
611 } | 604 } |
612 } // namespace internal | 605 } // namespace internal |
613 } // namespace v8 | 606 } // namespace v8 |
614 | 607 |
615 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 608 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |