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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 (RelocInfo::IsDebugBreakSlot(mode) && | 206 (RelocInfo::IsDebugBreakSlot(mode) && |
207 IsPatchedDebugBreakSlotSequence()))) { | 207 IsPatchedDebugBreakSlotSequence()))) { |
208 StaticVisitor::VisitDebugTarget(this); | 208 StaticVisitor::VisitDebugTarget(this); |
209 #endif | 209 #endif |
210 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 210 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
211 StaticVisitor::VisitRuntimeEntry(this); | 211 StaticVisitor::VisitRuntimeEntry(this); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 | 215 |
| 216 template<typename StaticVisitor, typename Data> |
| 217 void RelocInfo::Visit(Data data) { |
| 218 RelocInfo::Mode mode = rmode(); |
| 219 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 220 StaticVisitor::VisitPointer(target_object_address(), data); |
| 221 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 222 StaticVisitor::VisitCodeTarget(this, data); |
| 223 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 224 StaticVisitor::VisitExternalReference(target_reference_address(), data); |
| 225 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 226 } else if (Debug::has_break_points() && |
| 227 ((RelocInfo::IsJSReturn(mode) && |
| 228 IsPatchedReturnSequence()) || |
| 229 (RelocInfo::IsDebugBreakSlot(mode) && |
| 230 IsPatchedDebugBreakSlotSequence()))) { |
| 231 StaticVisitor::VisitDebugTarget(this, data); |
| 232 #endif |
| 233 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
| 234 StaticVisitor::VisitRuntimeEntry(this, data); |
| 235 } |
| 236 } |
| 237 |
| 238 |
216 Operand::Operand(int32_t immediate, RelocInfo::Mode rmode) { | 239 Operand::Operand(int32_t immediate, RelocInfo::Mode rmode) { |
217 rm_ = no_reg; | 240 rm_ = no_reg; |
218 imm32_ = immediate; | 241 imm32_ = immediate; |
219 rmode_ = rmode; | 242 rmode_ = rmode; |
220 } | 243 } |
221 | 244 |
222 | 245 |
223 Operand::Operand(const ExternalReference& f) { | 246 Operand::Operand(const ExternalReference& f) { |
224 rm_ = no_reg; | 247 rm_ = no_reg; |
225 imm32_ = reinterpret_cast<int32_t>(f.address()); | 248 imm32_ = reinterpret_cast<int32_t>(f.address()); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // CPU::FlushICache(pc, sizeof(target)); | 340 // CPU::FlushICache(pc, sizeof(target)); |
318 // However, on ARM, no instruction was actually patched by the assignment | 341 // However, on ARM, no instruction was actually patched by the assignment |
319 // above; the target address is not part of an instruction, it is patched in | 342 // above; the target address is not part of an instruction, it is patched in |
320 // the constant pool and is read via a data access; the instruction accessing | 343 // the constant pool and is read via a data access; the instruction accessing |
321 // this address in the constant pool remains unchanged. | 344 // this address in the constant pool remains unchanged. |
322 } | 345 } |
323 | 346 |
324 } } // namespace v8::internal | 347 } } // namespace v8::internal |
325 | 348 |
326 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 349 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
OLD | NEW |