Remove keyed load "force generic" miss case.

BUG=
R=ishell@chromium.org

Review URL: https://chromiumcodereview.appspot.com/68213024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2013-11-18 13:07:44 +00:00
parent a957c323d4
commit 74c7fda915
12 changed files with 44 additions and 87 deletions

View File

@ -827,7 +827,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) {
__ mov(r0, r2);
__ Ret();
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -887,7 +887,7 @@ void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm,
}
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
// ---------- S t a t e --------------
// -- lr : return address
// -- r0 : key
@ -900,9 +900,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
__ Push(r1, r0);
// Perform tail call to the entry.
ExternalReference ref = miss_mode == MISS_FORCE_GENERIC
? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), isolate)
: ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
ExternalReference ref =
ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
__ TailCallExternalReference(ref, 2, 1);
}
@ -1120,7 +1119,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
char_at_generator.GenerateSlow(masm, call_helper);
__ bind(&miss);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -1160,7 +1159,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
1);
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}

View File

@ -3140,12 +3140,12 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
// -- r0 : key
// -- r1 : receiver
// -----------------------------------
Label slow, miss_force_generic;
Label slow, miss;
Register key = r0;
Register receiver = r1;
__ UntagAndJumpIfNotSmi(r2, key, &miss_force_generic);
__ UntagAndJumpIfNotSmi(r2, key, &miss);
__ ldr(r4, FieldMemOperand(receiver, JSObject::kElementsOffset));
__ LoadFromNumberDictionary(&slow, r4, key, r0, r2, r3, r5);
__ Ret();
@ -3163,14 +3163,14 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
// Miss case, call the runtime.
__ bind(&miss_force_generic);
__ bind(&miss);
// ---------- S t a t e --------------
// -- lr : return address
// -- r0 : key
// -- r1 : receiver
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}

View File

@ -1351,12 +1351,7 @@ static void Generate_KeyedLoadIC_Slow(MacroAssembler* masm) {
static void Generate_KeyedLoadIC_Miss(MacroAssembler* masm) {
KeyedLoadIC::GenerateMiss(masm, MISS);
}
static void Generate_KeyedLoadIC_MissForceGeneric(MacroAssembler* masm) {
KeyedLoadIC::GenerateMiss(masm, MISS_FORCE_GENERIC);
KeyedLoadIC::GenerateMiss(masm);
}

View File

@ -119,8 +119,6 @@ enum BuiltinExtraArguments {
Code::kNoExtraICState) \
V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \

View File

@ -611,7 +611,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
char_at_generator.GenerateSlow(masm, call_helper);
__ bind(&miss);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -653,7 +653,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
__ TailCallExternalReference(ref, 2, 1);
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -678,7 +678,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) {
__ mov(eax, unmapped_location);
__ Ret();
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -1396,7 +1396,7 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
}
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- ecx : key
// -- edx : receiver
@ -1411,10 +1411,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
__ push(ebx); // return address
// Perform tail call to the entry.
ExternalReference ref = miss_mode == MISS_FORCE_GENERIC
? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric),
masm->isolate())
: ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
ExternalReference ref =
ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
__ TailCallExternalReference(ref, 2, 1);
}

View File

@ -3211,11 +3211,11 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
Label slow, miss_force_generic;
Label slow, miss;
// This stub is meant to be tail-jumped to, the receiver must already
// have been verified by the caller to not be a smi.
__ JumpIfNotSmi(ecx, &miss_force_generic);
__ JumpIfNotSmi(ecx, &miss);
__ mov(ebx, ecx);
__ SmiUntag(ebx);
__ mov(eax, FieldOperand(edx, JSObject::kElementsOffset));
@ -3238,13 +3238,13 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
__ bind(&miss_force_generic);
__ bind(&miss);
// ----------- S t a t e -------------
// -- ecx : key
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}

View File

@ -1364,13 +1364,6 @@ Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) {
}
MaybeObject* KeyedLoadIC::LoadForceGeneric(Handle<Object> object,
Handle<Object> key) {
set_target(*generic_stub());
return Runtime::GetObjectPropertyOrFail(isolate(), object, key);
}
MaybeObject* KeyedLoadIC::Load(Handle<Object> object, Handle<Object> key) {
if (MigrateDeprecated(object)) {
return Runtime::GetObjectPropertyOrFail(isolate(), object, key);
@ -2119,17 +2112,6 @@ RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure) {
}
RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissForceGeneric) {
HandleScope scope(isolate);
ASSERT(args.length() == 2);
KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate);
Handle<Object> receiver = args.at<Object>(0);
Handle<Object> key = args.at<Object>(1);
ic.UpdateState(receiver, key);
return ic.LoadForceGeneric(receiver, key);
}
// Used from ic-<arch>.cc.
RUNTIME_FUNCTION(MaybeObject*, StoreIC_Miss) {
HandleScope scope(isolate);

View File

@ -40,7 +40,6 @@ namespace internal {
#define IC_UTIL_LIST(ICU) \
ICU(LoadIC_Miss) \
ICU(KeyedLoadIC_Miss) \
ICU(KeyedLoadIC_MissForceGeneric) \
ICU(CallIC_Miss) \
ICU(KeyedCallIC_Miss) \
ICU(StoreIC_Miss) \
@ -469,12 +468,6 @@ class LoadIC: public IC {
};
enum ICMissMode {
MISS_FORCE_GENERIC,
MISS
};
class KeyedLoadIC: public LoadIC {
public:
explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate)
@ -482,20 +475,15 @@ class KeyedLoadIC: public LoadIC {
ASSERT(target()->is_keyed_load_stub());
}
MUST_USE_RESULT MaybeObject* LoadForceGeneric(Handle<Object> object,
Handle<Object> key);
MUST_USE_RESULT MaybeObject* Load(Handle<Object> object,
Handle<Object> key);
// Code generator routines.
static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic);
static void GenerateMiss(MacroAssembler* masm);
static void GenerateRuntimeGetProperty(MacroAssembler* masm);
static void GenerateInitialize(MacroAssembler* masm) {
GenerateMiss(masm, MISS);
}
static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
static void GeneratePreMonomorphic(MacroAssembler* masm) {
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
static void GenerateGeneric(MacroAssembler* masm);
static void GenerateString(MacroAssembler* masm);

View File

@ -826,7 +826,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) {
__ Ret(USE_DELAY_SLOT);
__ mov(v0, a2);
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -891,7 +891,7 @@ void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm,
}
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
// ---------- S t a t e --------------
// -- ra : return address
// -- a0 : key
@ -904,9 +904,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
__ Push(a1, a0);
// Perform tail call to the entry.
ExternalReference ref = miss_mode == MISS_FORCE_GENERIC
? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), isolate)
: ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
ExternalReference ref =
ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
__ TailCallExternalReference(ref, 2, 1);
}
@ -1131,7 +1130,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
char_at_generator.GenerateSlow(masm, call_helper);
__ bind(&miss);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -1453,7 +1452,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
IC_Utility(kKeyedLoadPropertyWithInterceptor), masm->isolate()), 2, 1);
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}

View File

@ -3149,12 +3149,12 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
// -- a0 : key
// -- a1 : receiver
// -----------------------------------
Label slow, miss_force_generic;
Label slow, miss;
Register key = a0;
Register receiver = a1;
__ JumpIfNotSmi(key, &miss_force_generic);
__ JumpIfNotSmi(key, &miss);
__ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset));
__ sra(a2, a0, kSmiTagSize);
__ LoadFromNumberDictionary(&slow, t0, a0, v0, a2, a3, t1);
@ -3174,14 +3174,14 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
// Miss case, call the runtime.
__ bind(&miss_force_generic);
__ bind(&miss);
// ---------- S t a t e --------------
// -- ra : return address
// -- a0 : key
// -- a1 : receiver
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}

View File

@ -540,7 +540,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
char_at_generator.GenerateSlow(masm, call_helper);
__ bind(&miss);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -583,7 +583,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
1);
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -1271,7 +1271,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) {
__ movq(rax, unmapped_location);
__ Ret();
__ bind(&slow);
GenerateMiss(masm, MISS);
GenerateMiss(masm);
}
@ -1423,7 +1423,7 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
}
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : key
// -- rdx : receiver
@ -1439,10 +1439,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) {
__ PushReturnAddressFrom(rbx);
// Perform tail call to the entry.
ExternalReference ref = miss_mode == MISS_FORCE_GENERIC
? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric),
masm->isolate())
: ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
ExternalReference ref =
ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
__ TailCallExternalReference(ref, 2, 1);
}

View File

@ -3124,12 +3124,12 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
// -- rdx : receiver
// -- rsp[0] : return address
// -----------------------------------
Label slow, miss_force_generic;
Label slow, miss;
// This stub is meant to be tail-jumped to, the receiver must already
// have been verified by the caller to not be a smi.
__ JumpIfNotSmi(rax, &miss_force_generic);
__ JumpIfNotSmi(rax, &miss);
__ SmiToInteger32(rbx, rax);
__ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
@ -3149,13 +3149,13 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
__ bind(&miss_force_generic);
__ bind(&miss);
// ----------- S t a t e -------------
// -- rax : key
// -- rdx : receiver
// -- rsp[0] : return address
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}