OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 visitor->VisitPointer(target_object_address()); | 365 visitor->VisitPointer(target_object_address()); |
366 CPU::FlushICache(pc_, sizeof(Address)); | 366 CPU::FlushICache(pc_, sizeof(Address)); |
367 } else if (RelocInfo::IsCodeTarget(mode)) { | 367 } else if (RelocInfo::IsCodeTarget(mode)) { |
368 visitor->VisitCodeTarget(this); | 368 visitor->VisitCodeTarget(this); |
369 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 369 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
370 visitor->VisitGlobalPropertyCell(this); | 370 visitor->VisitGlobalPropertyCell(this); |
371 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 371 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
372 visitor->VisitExternalReference(target_reference_address()); | 372 visitor->VisitExternalReference(target_reference_address()); |
373 CPU::FlushICache(pc_, sizeof(Address)); | 373 CPU::FlushICache(pc_, sizeof(Address)); |
374 #ifdef ENABLE_DEBUGGER_SUPPORT | 374 #ifdef ENABLE_DEBUGGER_SUPPORT |
375 } else if (Debug::has_break_points() && | 375 // TODO(isolates): Get a cached isolate below. |
376 ((RelocInfo::IsJSReturn(mode) && | 376 } else if (((RelocInfo::IsJSReturn(mode) && |
377 IsPatchedReturnSequence()) || | 377 IsPatchedReturnSequence()) || |
378 (RelocInfo::IsDebugBreakSlot(mode) && | 378 (RelocInfo::IsDebugBreakSlot(mode) && |
379 IsPatchedDebugBreakSlotSequence()))) { | 379 IsPatchedDebugBreakSlotSequence())) && |
| 380 Isolate::Current()->debug()->has_break_points()) { |
380 visitor->VisitDebugTarget(this); | 381 visitor->VisitDebugTarget(this); |
381 #endif | 382 #endif |
382 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 383 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
383 visitor->VisitRuntimeEntry(this); | 384 visitor->VisitRuntimeEntry(this); |
384 } | 385 } |
385 } | 386 } |
386 | 387 |
387 | 388 |
388 template<typename StaticVisitor> | 389 template<typename StaticVisitor> |
389 void RelocInfo::Visit() { | 390 void RelocInfo::Visit(Heap* heap) { |
390 RelocInfo::Mode mode = rmode(); | 391 RelocInfo::Mode mode = rmode(); |
391 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 392 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
392 StaticVisitor::VisitPointer(target_object_address()); | 393 StaticVisitor::VisitPointer(heap, target_object_address()); |
393 CPU::FlushICache(pc_, sizeof(Address)); | 394 CPU::FlushICache(pc_, sizeof(Address)); |
394 } else if (RelocInfo::IsCodeTarget(mode)) { | 395 } else if (RelocInfo::IsCodeTarget(mode)) { |
395 StaticVisitor::VisitCodeTarget(this); | 396 StaticVisitor::VisitCodeTarget(this); |
396 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 397 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
397 StaticVisitor::VisitGlobalPropertyCell(this); | 398 StaticVisitor::VisitGlobalPropertyCell(this); |
398 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 399 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
399 StaticVisitor::VisitExternalReference(target_reference_address()); | 400 StaticVisitor::VisitExternalReference(target_reference_address()); |
400 CPU::FlushICache(pc_, sizeof(Address)); | 401 CPU::FlushICache(pc_, sizeof(Address)); |
401 #ifdef ENABLE_DEBUGGER_SUPPORT | 402 #ifdef ENABLE_DEBUGGER_SUPPORT |
402 } else if (Debug::has_break_points() && | 403 } else if (heap->isolate()->debug()->has_break_points() && |
403 ((RelocInfo::IsJSReturn(mode) && | 404 ((RelocInfo::IsJSReturn(mode) && |
404 IsPatchedReturnSequence()) || | 405 IsPatchedReturnSequence()) || |
405 (RelocInfo::IsDebugBreakSlot(mode) && | 406 (RelocInfo::IsDebugBreakSlot(mode) && |
406 IsPatchedDebugBreakSlotSequence()))) { | 407 IsPatchedDebugBreakSlotSequence()))) { |
407 StaticVisitor::VisitDebugTarget(this); | 408 StaticVisitor::VisitDebugTarget(this); |
408 #endif | 409 #endif |
409 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 410 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
410 StaticVisitor::VisitRuntimeEntry(this); | 411 StaticVisitor::VisitRuntimeEntry(this); |
411 } | 412 } |
412 } | 413 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 ASSERT(len_ == 1 || len_ == 2); | 447 ASSERT(len_ == 1 || len_ == 2); |
447 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 448 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
448 *p = disp; | 449 *p = disp; |
449 len_ += sizeof(int32_t); | 450 len_ += sizeof(int32_t); |
450 } | 451 } |
451 | 452 |
452 | 453 |
453 } } // namespace v8::internal | 454 } } // namespace v8::internal |
454 | 455 |
455 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 456 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |