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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 | 208 |
209 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { | 209 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { |
210 return !Assembler::IsNop(pc()); | 210 return !Assembler::IsNop(pc()); |
211 } | 211 } |
212 | 212 |
213 | 213 |
214 void RelocInfo::Visit(ObjectVisitor* visitor) { | 214 void RelocInfo::Visit(ObjectVisitor* visitor) { |
215 RelocInfo::Mode mode = rmode(); | 215 RelocInfo::Mode mode = rmode(); |
216 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 216 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
217 visitor->VisitEmbeddedPointer(host(), target_object_address()); | 217 visitor->VisitEmbeddedPointer(this); |
218 CPU::FlushICache(pc_, sizeof(Address)); | 218 CPU::FlushICache(pc_, sizeof(Address)); |
219 } else if (RelocInfo::IsCodeTarget(mode)) { | 219 } else if (RelocInfo::IsCodeTarget(mode)) { |
220 visitor->VisitCodeTarget(this); | 220 visitor->VisitCodeTarget(this); |
221 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 221 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
222 visitor->VisitGlobalPropertyCell(this); | 222 visitor->VisitGlobalPropertyCell(this); |
223 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 223 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
224 visitor->VisitExternalReference(target_reference_address()); | 224 visitor->VisitExternalReference(target_reference_address()); |
225 CPU::FlushICache(pc_, sizeof(Address)); | 225 CPU::FlushICache(pc_, sizeof(Address)); |
226 #ifdef ENABLE_DEBUGGER_SUPPORT | 226 #ifdef ENABLE_DEBUGGER_SUPPORT |
227 // TODO(isolates): Get a cached isolate below. | 227 // TODO(isolates): Get a cached isolate below. |
228 } else if (((RelocInfo::IsJSReturn(mode) && | 228 } else if (((RelocInfo::IsJSReturn(mode) && |
229 IsPatchedReturnSequence()) || | 229 IsPatchedReturnSequence()) || |
230 (RelocInfo::IsDebugBreakSlot(mode) && | 230 (RelocInfo::IsDebugBreakSlot(mode) && |
231 IsPatchedDebugBreakSlotSequence())) && | 231 IsPatchedDebugBreakSlotSequence())) && |
232 Isolate::Current()->debug()->has_break_points()) { | 232 Isolate::Current()->debug()->has_break_points()) { |
233 visitor->VisitDebugTarget(this); | 233 visitor->VisitDebugTarget(this); |
234 #endif | 234 #endif |
235 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 235 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
236 visitor->VisitRuntimeEntry(this); | 236 visitor->VisitRuntimeEntry(this); |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 | 240 |
241 template<typename StaticVisitor> | 241 template<typename StaticVisitor> |
242 void RelocInfo::Visit(Heap* heap) { | 242 void RelocInfo::Visit(Heap* heap) { |
243 RelocInfo::Mode mode = rmode(); | 243 RelocInfo::Mode mode = rmode(); |
244 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 244 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
245 StaticVisitor::VisitEmbeddedPointer(heap, host(), target_object_address()); | 245 StaticVisitor::VisitEmbeddedPointer(heap, this); |
246 CPU::FlushICache(pc_, sizeof(Address)); | 246 CPU::FlushICache(pc_, sizeof(Address)); |
247 } else if (RelocInfo::IsCodeTarget(mode)) { | 247 } else if (RelocInfo::IsCodeTarget(mode)) { |
248 StaticVisitor::VisitCodeTarget(heap, this); | 248 StaticVisitor::VisitCodeTarget(heap, this); |
249 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 249 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
250 StaticVisitor::VisitGlobalPropertyCell(heap, this); | 250 StaticVisitor::VisitGlobalPropertyCell(heap, this); |
251 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 251 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
252 StaticVisitor::VisitExternalReference(target_reference_address()); | 252 StaticVisitor::VisitExternalReference(target_reference_address()); |
253 CPU::FlushICache(pc_, sizeof(Address)); | 253 CPU::FlushICache(pc_, sizeof(Address)); |
254 #ifdef ENABLE_DEBUGGER_SUPPORT | 254 #ifdef ENABLE_DEBUGGER_SUPPORT |
255 } else if (heap->isolate()->debug()->has_break_points() && | 255 } else if (heap->isolate()->debug()->has_break_points() && |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 458 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
459 // [disp/r] | 459 // [disp/r] |
460 set_modrm(0, ebp); | 460 set_modrm(0, ebp); |
461 set_dispr(disp, rmode); | 461 set_dispr(disp, rmode); |
462 } | 462 } |
463 | 463 |
464 } } // namespace v8::internal | 464 } } // namespace v8::internal |
465 | 465 |
466 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 466 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |