From bb010f8ad0a186f1c70f8dd6bcdb902ca3dd1bb8 Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Tue, 5 Nov 2013 09:40:36 +0000 Subject: [PATCH] Removed RelocInfo::target_object_address() and reconstructed_obj_ptr_. Depends on https://codereview.chromium.org/46583006/ and has similar reasoning behind it. R=bmeurer@chromium.org Review URL: https://codereview.chromium.org/50413004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/assembler-arm-inl.h | 10 ---------- src/assembler.h | 7 ------- src/ia32/assembler-ia32-inl.h | 6 ------ src/mark-compact.cc | 3 ++- src/mips/assembler-mips-inl.h | 10 ---------- src/objects.cc | 3 ++- src/serialize.cc | 4 ++-- src/x64/assembler-x64-inl.h | 6 ------ 8 files changed, 6 insertions(+), 43 deletions(-) diff --git a/src/arm/assembler-arm-inl.h b/src/arm/assembler-arm-inl.h index 7b246ac..9a83a42 100644 --- a/src/arm/assembler-arm-inl.h +++ b/src/arm/assembler-arm-inl.h @@ -137,16 +137,6 @@ Handle RelocInfo::target_object_handle(Assembler* origin) { } -Object** RelocInfo::target_object_address() { - // Provide a "natural pointer" to the embedded object, - // which can be de-referenced during heap iteration. - ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); - reconstructed_obj_ptr_ = - reinterpret_cast(Assembler::target_pointer_at(pc_)); - return &reconstructed_obj_ptr_; -} - - void RelocInfo::set_target_object(Object* target, WriteBarrierMode mode) { ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); ASSERT(!target->IsConsString()); diff --git a/src/assembler.h b/src/assembler.h index cf5396a..11087da 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -390,7 +390,6 @@ class RelocInfo BASE_EMBEDDED { WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); INLINE(Object* target_object()); INLINE(Handle target_object_handle(Assembler* origin)); - INLINE(Object** target_object_address()); INLINE(void set_target_object(Object* target, WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); INLINE(Address target_runtime_entry(Assembler* origin)); @@ -486,12 +485,6 @@ class RelocInfo BASE_EMBEDDED { double data64_; }; Code* host_; - // Code and Embedded Object pointers on some platforms are stored split - // across two consecutive 32-bit instructions. Heap management - // routines expect to access these pointers indirectly. The following - // location provides a place for these pointers to exist naturally - // when accessed via the Iterator. - Object* reconstructed_obj_ptr_; // External-reference pointers are also split across instruction-pairs // on some platforms, but are accessed via indirect pointers. This location // provides a place for that pointer to exist naturally. Its address diff --git a/src/ia32/assembler-ia32-inl.h b/src/ia32/assembler-ia32-inl.h index 509658e..00f7a63 100644 --- a/src/ia32/assembler-ia32-inl.h +++ b/src/ia32/assembler-ia32-inl.h @@ -125,12 +125,6 @@ Handle RelocInfo::target_object_handle(Assembler* origin) { } -Object** RelocInfo::target_object_address() { - ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); - return &Memory::Object_at(pc_); -} - - void RelocInfo::set_target_object(Object* target, WriteBarrierMode mode) { ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); ASSERT(!target->IsConsString()); diff --git a/src/mark-compact.cc b/src/mark-compact.cc index b75ddb3..4aff0d3 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -93,7 +93,8 @@ class VerifyMarkingVisitor: public ObjectVisitor { ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); if (!Code::IsWeakEmbeddedObject(rinfo->host()->kind(), rinfo->target_object())) { - VisitPointer(rinfo->target_object_address()); + Object* p = rinfo->target_object(); + VisitPointer(&p); } } diff --git a/src/mips/assembler-mips-inl.h b/src/mips/assembler-mips-inl.h index d095037..b430b1f 100644 --- a/src/mips/assembler-mips-inl.h +++ b/src/mips/assembler-mips-inl.h @@ -190,16 +190,6 @@ Handle RelocInfo::target_object_handle(Assembler* origin) { } -Object** RelocInfo::target_object_address() { - // Provide a "natural pointer" to the embedded object, - // which can be de-referenced during heap iteration. - ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); - reconstructed_obj_ptr_ = - reinterpret_cast(Assembler::target_address_at(pc_)); - return &reconstructed_obj_ptr_; -} - - void RelocInfo::set_target_object(Object* target, WriteBarrierMode mode) { ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); ASSERT(!target->IsConsString()); diff --git a/src/objects.cc b/src/objects.cc index 84683ea..1dc9448 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -10317,7 +10317,8 @@ void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) { void ObjectVisitor::VisitEmbeddedPointer(RelocInfo* rinfo) { ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); - VisitPointer(rinfo->target_object_address()); + Object* p = rinfo->target_object(); + VisitPointer(&p); } diff --git a/src/serialize.cc b/src/serialize.cc index f350ce5..130fbee 100644 --- a/src/serialize.cc +++ b/src/serialize.cc @@ -1668,12 +1668,12 @@ void Serializer::ObjectSerializer::VisitPointers(Object** start, void Serializer::ObjectSerializer::VisitEmbeddedPointer(RelocInfo* rinfo) { - Object** current = rinfo->target_object_address(); + Object* current = rinfo->target_object(); int skip = OutputRawData(rinfo->target_address_address(), kCanReturnSkipInsteadOfSkipping); HowToCode representation = rinfo->IsCodedSpecially() ? kFromCode : kPlain; - serializer_->SerializeObject(*current, representation, kStartOfObject, skip); + serializer_->SerializeObject(current, representation, kStartOfObject, skip); bytes_processed_so_far_ += rinfo->target_address_size(); } diff --git a/src/x64/assembler-x64-inl.h b/src/x64/assembler-x64-inl.h index 1f47c89..f4ee4e6 100644 --- a/src/x64/assembler-x64-inl.h +++ b/src/x64/assembler-x64-inl.h @@ -303,12 +303,6 @@ Handle RelocInfo::target_object_handle(Assembler* origin) { } -Object** RelocInfo::target_object_address() { - ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); - return reinterpret_cast(pc_); -} - - Address RelocInfo::target_reference() { ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE); return Memory::Address_at(pc_); -- 2.7.4