Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/x64/assembler-x64-inl.h

Issue 1477343002: Pass an isolate to RelocInfo (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x87/assembler-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ 5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_
6 #define V8_X64_ASSEMBLER_X64_INL_H_ 6 #define V8_X64_ASSEMBLER_X64_INL_H_
7 7
8 #include "src/x64/assembler-x64.h" 8 #include "src/x64/assembler-x64.h"
9 9
10 #include "src/base/cpu.h" 10 #include "src/base/cpu.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 return reinterpret_cast<Address>(pc_); 397 return reinterpret_cast<Address>(pc_);
398 } 398 }
399 399
400 400
401 void RelocInfo::set_target_object(Object* target, 401 void RelocInfo::set_target_object(Object* target,
402 WriteBarrierMode write_barrier_mode, 402 WriteBarrierMode write_barrier_mode,
403 ICacheFlushMode icache_flush_mode) { 403 ICacheFlushMode icache_flush_mode) {
404 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 404 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
405 Memory::Object_at(pc_) = target; 405 Memory::Object_at(pc_) = target;
406 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 406 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
407 Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address)); 407 Assembler::FlushICache(isolate_, pc_, sizeof(Address));
408 } 408 }
409 if (write_barrier_mode == UPDATE_WRITE_BARRIER && 409 if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
410 host() != NULL && 410 host() != NULL &&
411 target->IsHeapObject()) { 411 target->IsHeapObject()) {
412 host()->GetHeap()->incremental_marking()->RecordWrite( 412 host()->GetHeap()->incremental_marking()->RecordWrite(
413 host(), &Memory::Object_at(pc_), HeapObject::cast(target)); 413 host(), &Memory::Object_at(pc_), HeapObject::cast(target));
414 } 414 }
415 } 415 }
416 416
417 417
(...skipping 26 matching lines...) Expand all
444 } 444 }
445 445
446 446
447 void RelocInfo::set_target_cell(Cell* cell, 447 void RelocInfo::set_target_cell(Cell* cell,
448 WriteBarrierMode write_barrier_mode, 448 WriteBarrierMode write_barrier_mode,
449 ICacheFlushMode icache_flush_mode) { 449 ICacheFlushMode icache_flush_mode) {
450 DCHECK(rmode_ == RelocInfo::CELL); 450 DCHECK(rmode_ == RelocInfo::CELL);
451 Address address = cell->address() + Cell::kValueOffset; 451 Address address = cell->address() + Cell::kValueOffset;
452 Memory::Address_at(pc_) = address; 452 Memory::Address_at(pc_) = address;
453 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 453 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
454 Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address)); 454 Assembler::FlushICache(isolate_, pc_, sizeof(Address));
455 } 455 }
456 if (write_barrier_mode == UPDATE_WRITE_BARRIER && 456 if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
457 host() != NULL) { 457 host() != NULL) {
458 // TODO(1550) We are passing NULL as a slot because cell can never be on 458 // TODO(1550) We are passing NULL as a slot because cell can never be on
459 // evacuation candidate. 459 // evacuation candidate.
460 host()->GetHeap()->incremental_marking()->RecordWrite( 460 host()->GetHeap()->incremental_marking()->RecordWrite(
461 host(), NULL, cell); 461 host(), NULL, cell);
462 } 462 }
463 } 463 }
464 464
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 Address RelocInfo::debug_call_address() { 520 Address RelocInfo::debug_call_address() {
521 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); 521 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence());
522 return Memory::Address_at(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset); 522 return Memory::Address_at(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset);
523 } 523 }
524 524
525 525
526 void RelocInfo::set_debug_call_address(Address target) { 526 void RelocInfo::set_debug_call_address(Address target) {
527 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); 527 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence());
528 Memory::Address_at(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset) = 528 Memory::Address_at(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset) =
529 target; 529 target;
530 Assembler::FlushICacheWithoutIsolate( 530 Assembler::FlushICache(isolate_,
531 pc_ + Assembler::kPatchDebugBreakSlotAddressOffset, sizeof(Address)); 531 pc_ + Assembler::kPatchDebugBreakSlotAddressOffset,
532 sizeof(Address));
532 if (host() != NULL) { 533 if (host() != NULL) {
533 Object* target_code = Code::GetCodeFromTargetAddress(target); 534 Object* target_code = Code::GetCodeFromTargetAddress(target);
534 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( 535 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
535 host(), this, HeapObject::cast(target_code)); 536 host(), this, HeapObject::cast(target_code));
536 } 537 }
537 } 538 }
538 539
539 540
540 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { 541 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
541 RelocInfo::Mode mode = rmode(); 542 RelocInfo::Mode mode = rmode();
542 if (mode == RelocInfo::EMBEDDED_OBJECT) { 543 if (mode == RelocInfo::EMBEDDED_OBJECT) {
543 visitor->VisitEmbeddedPointer(this); 544 visitor->VisitEmbeddedPointer(this);
544 Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address)); 545 Assembler::FlushICache(isolate, pc_, sizeof(Address));
545 } else if (RelocInfo::IsCodeTarget(mode)) { 546 } else if (RelocInfo::IsCodeTarget(mode)) {
546 visitor->VisitCodeTarget(this); 547 visitor->VisitCodeTarget(this);
547 } else if (mode == RelocInfo::CELL) { 548 } else if (mode == RelocInfo::CELL) {
548 visitor->VisitCell(this); 549 visitor->VisitCell(this);
549 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 550 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
550 visitor->VisitExternalReference(this); 551 visitor->VisitExternalReference(this);
551 } else if (mode == RelocInfo::INTERNAL_REFERENCE) { 552 } else if (mode == RelocInfo::INTERNAL_REFERENCE) {
552 visitor->VisitInternalReference(this); 553 visitor->VisitInternalReference(this);
553 } else if (RelocInfo::IsCodeAgeSequence(mode)) { 554 } else if (RelocInfo::IsCodeAgeSequence(mode)) {
554 visitor->VisitCodeAgeSequence(this); 555 visitor->VisitCodeAgeSequence(this);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 void Operand::set_disp64(int64_t disp) { 627 void Operand::set_disp64(int64_t disp) {
627 DCHECK_EQ(1, len_); 628 DCHECK_EQ(1, len_);
628 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); 629 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]);
629 *p = disp; 630 *p = disp;
630 len_ += sizeof(disp); 631 len_ += sizeof(disp);
631 } 632 }
632 } // namespace internal 633 } // namespace internal
633 } // namespace v8 634 } // namespace v8
634 635
635 #endif // V8_X64_ASSEMBLER_X64_INL_H_ 636 #endif // V8_X64_ASSEMBLER_X64_INL_H_
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x87/assembler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698