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
This commit is contained in:
whesse@chromium.org 2009-10-06 13:59:56 +00:00
parent cc0c626d70
commit d9dd84d5e4
6 changed files with 6 additions and 20 deletions

View File

@ -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);

View File

@ -201,20 +201,13 @@ bool PendingFixups::Process(Handle<JSBuiltinsObject> 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<Address>(f->code()));
} else {
*reinterpret_cast<Object**>(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();

View File

@ -66,9 +66,8 @@ class Bootstrapper : public AllStatic {
static bool IsActive();
// Encoding/decoding support for fixup flags.
class FixupFlagsIsPCRelative: public BitField<bool, 0, 1> {};
class FixupFlagsUseCodeObject: public BitField<bool, 1, 1> {};
class FixupFlagsArgumentsCount: public BitField<uint32_t, 2, 32-2> {};
class FixupFlagsUseCodeObject: public BitField<bool, 0, 1> {};
class FixupFlagsArgumentsCount: public BitField<uint32_t, 1, 32-1> {};
// Support for thread preemption.
static int ArchiveSpacePerThread();

View File

@ -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);

View File

@ -947,7 +947,7 @@ class ReferenceUpdater: public ObjectVisitor {
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(encoded_target));
ASSERT(reinterpret_cast<uintptr_t>(encoded_target) == small_target);
data_32_bit_.Add(small_target);
}
}
virtual void VisitExternalReferences(Address* start, Address* end) {

View File

@ -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 };