OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 | 45 |
46 namespace v8 { | 46 namespace v8 { |
47 namespace internal { | 47 namespace internal { |
48 | 48 |
49 | 49 |
50 bool CpuFeatures::SupportsCrankshaft() { return true; } | 50 bool CpuFeatures::SupportsCrankshaft() { return true; } |
51 | 51 |
52 | 52 |
53 void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) { | 53 void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) { |
54 if (IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)) { | 54 // absolute code pointer inside code object moves with the code object. |
55 // absolute code pointer inside code object moves with the code object. | 55 if (IsInternalReference(rmode_)) { |
56 Assembler::RelocateInternalReference(pc_, delta, 0, rmode_, | 56 // Jump table entry |
57 icache_flush_mode); | 57 Address target = Memory::Address_at(pc_); |
| 58 Memory::Address_at(pc_) = target + delta; |
| 59 } else { |
| 60 // mov sequence |
| 61 DCHECK(IsInternalReferenceEncoded(rmode_)); |
| 62 Address target = Assembler::target_address_at(pc_, host_); |
| 63 Assembler::set_target_address_at(pc_, host_, target + delta, |
| 64 icache_flush_mode); |
58 } | 65 } |
59 } | 66 } |
60 | 67 |
| 68 |
| 69 Address RelocInfo::target_internal_reference() { |
| 70 if (IsInternalReference(rmode_)) { |
| 71 // Jump table entry |
| 72 return Memory::Address_at(pc_); |
| 73 } else { |
| 74 // mov sequence |
| 75 DCHECK(IsInternalReferenceEncoded(rmode_)); |
| 76 return Assembler::target_address_at(pc_, host_); |
| 77 } |
| 78 } |
| 79 |
| 80 |
| 81 void RelocInfo::set_target_internal_reference(Address target) { |
| 82 if (IsInternalReference(rmode_)) { |
| 83 // Jump table entry |
| 84 Memory::Address_at(pc_) = target; |
| 85 } else { |
| 86 // mov sequence |
| 87 DCHECK(IsInternalReferenceEncoded(rmode_)); |
| 88 Assembler::set_target_address_at(pc_, host_, target, SKIP_ICACHE_FLUSH); |
| 89 } |
| 90 } |
| 91 |
61 | 92 |
62 Address RelocInfo::target_address() { | 93 Address RelocInfo::target_address() { |
63 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 94 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); |
64 return Assembler::target_address_at(pc_, host_); | 95 return Assembler::target_address_at(pc_, host_); |
65 } | 96 } |
66 | 97 |
67 | 98 |
68 Address RelocInfo::target_address_address() { | 99 Address RelocInfo::target_address_address() { |
69 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || | 100 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || |
70 rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE); | 101 rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 184 } |
154 } | 185 } |
155 | 186 |
156 | 187 |
157 Address RelocInfo::target_external_reference() { | 188 Address RelocInfo::target_external_reference() { |
158 DCHECK(rmode_ == EXTERNAL_REFERENCE); | 189 DCHECK(rmode_ == EXTERNAL_REFERENCE); |
159 return Assembler::target_address_at(pc_, host_); | 190 return Assembler::target_address_at(pc_, host_); |
160 } | 191 } |
161 | 192 |
162 | 193 |
163 Address RelocInfo::target_internal_reference() { | |
164 DCHECK(rmode_ == INTERNAL_REFERENCE); | |
165 return Memory::Address_at(pc_); | |
166 } | |
167 | |
168 | |
169 void RelocInfo::set_target_internal_reference(Address target) { | |
170 DCHECK(rmode_ == INTERNAL_REFERENCE); | |
171 Memory::Address_at(pc_) = target; | |
172 } | |
173 | |
174 | |
175 Address RelocInfo::target_runtime_entry(Assembler* origin) { | 194 Address RelocInfo::target_runtime_entry(Assembler* origin) { |
176 DCHECK(IsRuntimeEntry(rmode_)); | 195 DCHECK(IsRuntimeEntry(rmode_)); |
177 return target_address(); | 196 return target_address(); |
178 } | 197 } |
179 | 198 |
180 | 199 |
181 void RelocInfo::set_target_runtime_entry(Address target, | 200 void RelocInfo::set_target_runtime_entry(Address target, |
182 WriteBarrierMode write_barrier_mode, | 201 WriteBarrierMode write_barrier_mode, |
183 ICacheFlushMode icache_flush_mode) { | 202 ICacheFlushMode icache_flush_mode) { |
184 DCHECK(IsRuntimeEntry(rmode_)); | 203 DCHECK(IsRuntimeEntry(rmode_)); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 } | 530 } |
512 #endif | 531 #endif |
513 return; | 532 return; |
514 } | 533 } |
515 UNREACHABLE(); | 534 UNREACHABLE(); |
516 } | 535 } |
517 } | 536 } |
518 } // namespace v8::internal | 537 } // namespace v8::internal |
519 | 538 |
520 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ | 539 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ |
OLD | NEW |