| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || | 381 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || |
| 382 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); | 382 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); |
| 383 return reinterpret_cast<Object**>( | 383 return reinterpret_cast<Object**>( |
| 384 pc_ + Assembler::kPatchReturnSequenceAddressOffset); | 384 pc_ + Assembler::kPatchReturnSequenceAddressOffset); |
| 385 } | 385 } |
| 386 | 386 |
| 387 | 387 |
| 388 void RelocInfo::Visit(ObjectVisitor* visitor) { | 388 void RelocInfo::Visit(ObjectVisitor* visitor) { |
| 389 RelocInfo::Mode mode = rmode(); | 389 RelocInfo::Mode mode = rmode(); |
| 390 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 390 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 391 visitor->VisitEmbeddedPointer(host(), target_object_address()); | 391 visitor->VisitEmbeddedPointer(this); |
| 392 CPU::FlushICache(pc_, sizeof(Address)); | 392 CPU::FlushICache(pc_, sizeof(Address)); |
| 393 } else if (RelocInfo::IsCodeTarget(mode)) { | 393 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 394 visitor->VisitCodeTarget(this); | 394 visitor->VisitCodeTarget(this); |
| 395 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 395 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 396 visitor->VisitGlobalPropertyCell(this); | 396 visitor->VisitGlobalPropertyCell(this); |
| 397 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 397 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 398 visitor->VisitExternalReference(target_reference_address()); | 398 visitor->VisitExternalReference(target_reference_address()); |
| 399 CPU::FlushICache(pc_, sizeof(Address)); | 399 CPU::FlushICache(pc_, sizeof(Address)); |
| 400 #ifdef ENABLE_DEBUGGER_SUPPORT | 400 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 401 // TODO(isolates): Get a cached isolate below. | 401 // TODO(isolates): Get a cached isolate below. |
| 402 } else if (((RelocInfo::IsJSReturn(mode) && | 402 } else if (((RelocInfo::IsJSReturn(mode) && |
| 403 IsPatchedReturnSequence()) || | 403 IsPatchedReturnSequence()) || |
| 404 (RelocInfo::IsDebugBreakSlot(mode) && | 404 (RelocInfo::IsDebugBreakSlot(mode) && |
| 405 IsPatchedDebugBreakSlotSequence())) && | 405 IsPatchedDebugBreakSlotSequence())) && |
| 406 Isolate::Current()->debug()->has_break_points()) { | 406 Isolate::Current()->debug()->has_break_points()) { |
| 407 visitor->VisitDebugTarget(this); | 407 visitor->VisitDebugTarget(this); |
| 408 #endif | 408 #endif |
| 409 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 409 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
| 410 visitor->VisitRuntimeEntry(this); | 410 visitor->VisitRuntimeEntry(this); |
| 411 } | 411 } |
| 412 } | 412 } |
| 413 | 413 |
| 414 | 414 |
| 415 template<typename StaticVisitor> | 415 template<typename StaticVisitor> |
| 416 void RelocInfo::Visit(Heap* heap) { | 416 void RelocInfo::Visit(Heap* heap) { |
| 417 RelocInfo::Mode mode = rmode(); | 417 RelocInfo::Mode mode = rmode(); |
| 418 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 418 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 419 StaticVisitor::VisitEmbeddedPointer(heap, host(), target_object_address()); | 419 StaticVisitor::VisitEmbeddedPointer(heap, this); |
| 420 CPU::FlushICache(pc_, sizeof(Address)); | 420 CPU::FlushICache(pc_, sizeof(Address)); |
| 421 } else if (RelocInfo::IsCodeTarget(mode)) { | 421 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 422 StaticVisitor::VisitCodeTarget(heap, this); | 422 StaticVisitor::VisitCodeTarget(heap, this); |
| 423 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 423 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 424 StaticVisitor::VisitGlobalPropertyCell(heap, this); | 424 StaticVisitor::VisitGlobalPropertyCell(heap, this); |
| 425 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 425 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 426 StaticVisitor::VisitExternalReference(target_reference_address()); | 426 StaticVisitor::VisitExternalReference(target_reference_address()); |
| 427 CPU::FlushICache(pc_, sizeof(Address)); | 427 CPU::FlushICache(pc_, sizeof(Address)); |
| 428 #ifdef ENABLE_DEBUGGER_SUPPORT | 428 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 429 } else if (heap->isolate()->debug()->has_break_points() && | 429 } else if (heap->isolate()->debug()->has_break_points() && |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 ASSERT(len_ == 1 || len_ == 2); | 473 ASSERT(len_ == 1 || len_ == 2); |
| 474 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 474 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
| 475 *p = disp; | 475 *p = disp; |
| 476 len_ += sizeof(int32_t); | 476 len_ += sizeof(int32_t); |
| 477 } | 477 } |
| 478 | 478 |
| 479 | 479 |
| 480 } } // namespace v8::internal | 480 } } // namespace v8::internal |
| 481 | 481 |
| 482 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 482 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
| OLD | NEW |