From d9dd84d5e404d2589929b69a9ac7176dc3238ebc Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Tue, 6 Oct 2009 13:59:56 +0000 Subject: [PATCH] Clean up fixups of calls to builtins. Fix lint error. Review URL: http://codereview.chromium.org/259057 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3022 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/macro-assembler-arm.cc | 2 -- src/bootstrapper.cc | 13 +++---------- src/bootstrapper.h | 5 ++--- src/ia32/macro-assembler-ia32.cc | 2 -- src/serialize.cc | 2 +- src/x64/macro-assembler-x64.cc | 2 -- 6 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index cf467733b..45c6540ee 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -1051,7 +1051,6 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, int argc = Builtins::GetArgumentsCount(id); uint32_t flags = Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | - Bootstrapper::FixupFlagsIsPCRelative::encode(true) | Bootstrapper::FixupFlagsUseCodeObject::encode(false); Unresolved entry = { pc_offset() - kInstrSize, flags, name }; unresolved_.Add(entry); @@ -1069,7 +1068,6 @@ void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { int argc = Builtins::GetArgumentsCount(id); uint32_t flags = Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | - Bootstrapper::FixupFlagsIsPCRelative::encode(true) | Bootstrapper::FixupFlagsUseCodeObject::encode(true); Unresolved entry = { pc_offset() - kInstrSize, flags, name }; unresolved_.Add(entry); diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index e2d23ef7e..43aa1a3b8 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -201,20 +201,13 @@ bool PendingFixups::Process(Handle builtins) { } Code* code = Code::cast(code_[i]); Address pc = code->instruction_start() + pc_[i]; - bool is_pc_relative = Bootstrapper::FixupFlagsIsPCRelative::decode(flags); + RelocInfo target(pc, RelocInfo::CODE_TARGET, 0); bool use_code_object = Bootstrapper::FixupFlagsUseCodeObject::decode(flags); - if (use_code_object) { - if (is_pc_relative) { - Assembler::set_target_address_at( - pc, reinterpret_cast
(f->code())); - } else { - *reinterpret_cast(pc) = f->code(); - } + target.set_target_object(f->code()); } else { - Assembler::set_target_address_at(pc, f->code()->instruction_start()); + target.set_target_address(f->code()->instruction_start()); } - LOG(StringEvent("resolved", name)); } Clear(); diff --git a/src/bootstrapper.h b/src/bootstrapper.h index 809cd4154..15fc88dc0 100644 --- a/src/bootstrapper.h +++ b/src/bootstrapper.h @@ -66,9 +66,8 @@ class Bootstrapper : public AllStatic { static bool IsActive(); // Encoding/decoding support for fixup flags. - class FixupFlagsIsPCRelative: public BitField {}; - class FixupFlagsUseCodeObject: public BitField {}; - class FixupFlagsArgumentsCount: public BitField {}; + class FixupFlagsUseCodeObject: public BitField {}; + class FixupFlagsArgumentsCount: public BitField {}; // Support for thread preemption. static int ArchiveSpacePerThread(); diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc index e83bb92e2..a3b214972 100644 --- a/src/ia32/macro-assembler-ia32.cc +++ b/src/ia32/macro-assembler-ia32.cc @@ -1049,7 +1049,6 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) { if (!resolved) { uint32_t flags = Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | - Bootstrapper::FixupFlagsIsPCRelative::encode(true) | Bootstrapper::FixupFlagsUseCodeObject::encode(false); Unresolved entry = { pc_offset() - sizeof(int32_t), flags, name }; unresolved_.Add(entry); @@ -1068,7 +1067,6 @@ void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { if (!resolved) { uint32_t flags = Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | - Bootstrapper::FixupFlagsIsPCRelative::encode(false) | Bootstrapper::FixupFlagsUseCodeObject::encode(true); Unresolved entry = { pc_offset() - sizeof(int32_t), flags, name }; unresolved_.Add(entry); diff --git a/src/serialize.cc b/src/serialize.cc index fc3fd8432..94cd02aac 100644 --- a/src/serialize.cc +++ b/src/serialize.cc @@ -947,7 +947,7 @@ class ReferenceUpdater: public ObjectVisitor { static_cast(reinterpret_cast(encoded_target)); ASSERT(reinterpret_cast(encoded_target) == small_target); data_32_bit_.Add(small_target); - } + } virtual void VisitExternalReferences(Address* start, Address* end) { diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index edfc696ec..2689e388b 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -363,7 +363,6 @@ void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { if (!resolved) { uint32_t flags = Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | - Bootstrapper::FixupFlagsIsPCRelative::encode(false) | Bootstrapper::FixupFlagsUseCodeObject::encode(true); Unresolved entry = { pc_offset() - sizeof(intptr_t), flags, name }; unresolved_.Add(entry); @@ -1556,7 +1555,6 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) { if (!resolved) { uint32_t flags = Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | - Bootstrapper::FixupFlagsIsPCRelative::encode(true) | Bootstrapper::FixupFlagsUseCodeObject::encode(false); Unresolved entry = { pc_offset() - kCallTargetAddressOffset, flags, name }; -- 2.34.1