| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 RelocInfo::Mode mode = rmode(); | 196 RelocInfo::Mode mode = rmode(); |
| 197 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 197 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 198 visitor->VisitPointer(target_object_address()); | 198 visitor->VisitPointer(target_object_address()); |
| 199 } else if (RelocInfo::IsCodeTarget(mode)) { | 199 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 200 visitor->VisitCodeTarget(this); | 200 visitor->VisitCodeTarget(this); |
| 201 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 201 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 202 visitor->VisitGlobalPropertyCell(this); | 202 visitor->VisitGlobalPropertyCell(this); |
| 203 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 203 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 204 visitor->VisitExternalReference(target_reference_address()); | 204 visitor->VisitExternalReference(target_reference_address()); |
| 205 #ifdef ENABLE_DEBUGGER_SUPPORT | 205 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 206 } else if (Debug::has_break_points() && | 206 // TODO(isolates): Get a cached isolate below. |
| 207 ((RelocInfo::IsJSReturn(mode) && | 207 } else if (((RelocInfo::IsJSReturn(mode) && |
| 208 IsPatchedReturnSequence()) || | 208 IsPatchedReturnSequence()) || |
| 209 (RelocInfo::IsDebugBreakSlot(mode) && | 209 (RelocInfo::IsDebugBreakSlot(mode) && |
| 210 IsPatchedDebugBreakSlotSequence()))) { | 210 IsPatchedDebugBreakSlotSequence())) && |
| 211 Isolate::Current()->debug()->has_break_points()) { |
| 211 visitor->VisitDebugTarget(this); | 212 visitor->VisitDebugTarget(this); |
| 212 #endif | 213 #endif |
| 213 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 214 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
| 214 visitor->VisitRuntimeEntry(this); | 215 visitor->VisitRuntimeEntry(this); |
| 215 } | 216 } |
| 216 } | 217 } |
| 217 | 218 |
| 218 | 219 |
| 219 template<typename StaticVisitor> | 220 template<typename StaticVisitor> |
| 220 void RelocInfo::Visit() { | 221 void RelocInfo::Visit(Heap* heap) { |
| 221 RelocInfo::Mode mode = rmode(); | 222 RelocInfo::Mode mode = rmode(); |
| 222 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 223 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 223 StaticVisitor::VisitPointer(target_object_address()); | 224 StaticVisitor::VisitPointer(heap, target_object_address()); |
| 224 } else if (RelocInfo::IsCodeTarget(mode)) { | 225 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 225 StaticVisitor::VisitCodeTarget(this); | 226 StaticVisitor::VisitCodeTarget(this); |
| 226 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 227 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 227 StaticVisitor::VisitGlobalPropertyCell(this); | 228 StaticVisitor::VisitGlobalPropertyCell(this); |
| 228 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 229 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 229 StaticVisitor::VisitExternalReference(target_reference_address()); | 230 StaticVisitor::VisitExternalReference(target_reference_address()); |
| 230 #ifdef ENABLE_DEBUGGER_SUPPORT | 231 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 231 } else if (Debug::has_break_points() && | 232 } else if (heap->isolate()->debug()->has_break_points() && |
| 232 ((RelocInfo::IsJSReturn(mode) && | 233 ((RelocInfo::IsJSReturn(mode) && |
| 233 IsPatchedReturnSequence()) || | 234 IsPatchedReturnSequence()) || |
| 234 (RelocInfo::IsDebugBreakSlot(mode) && | 235 (RelocInfo::IsDebugBreakSlot(mode) && |
| 235 IsPatchedDebugBreakSlotSequence()))) { | 236 IsPatchedDebugBreakSlotSequence()))) { |
| 236 StaticVisitor::VisitDebugTarget(this); | 237 StaticVisitor::VisitDebugTarget(this); |
| 237 #endif | 238 #endif |
| 238 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 239 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
| 239 StaticVisitor::VisitRuntimeEntry(this); | 240 StaticVisitor::VisitRuntimeEntry(this); |
| 240 } | 241 } |
| 241 } | 242 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // CPU::FlushICache(pc, sizeof(target)); | 344 // CPU::FlushICache(pc, sizeof(target)); |
| 344 // However, on ARM, no instruction was actually patched by the assignment | 345 // However, on ARM, no instruction was actually patched by the assignment |
| 345 // above; the target address is not part of an instruction, it is patched in | 346 // above; the target address is not part of an instruction, it is patched in |
| 346 // the constant pool and is read via a data access; the instruction accessing | 347 // the constant pool and is read via a data access; the instruction accessing |
| 347 // this address in the constant pool remains unchanged. | 348 // this address in the constant pool remains unchanged. |
| 348 } | 349 } |
| 349 | 350 |
| 350 } } // namespace v8::internal | 351 } } // namespace v8::internal |
| 351 | 352 |
| 352 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 353 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |