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

Unified Diff: src/mips/ic-mips.cc

Issue 396663004: MIPS: Drop unnecessary receiver validity checks from {Load,Store}IC_Normal. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix diff. Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/mips64/ic-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/ic-mips.cc
diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc
index 4683502a301805c89ea7970f2fc6e8f1c564b6b6..23ad6de0639ec56cac29463f479500593258e3d0 100644
--- a/src/mips/ic-mips.cc
+++ b/src/mips/ic-mips.cc
@@ -36,47 +36,6 @@ static void GenerateGlobalInstanceTypeCheck(MacroAssembler* masm,
}
-// Generated code falls through if the receiver is a regular non-global
-// JS object with slow properties and no interceptors.
-static void GenerateNameDictionaryReceiverCheck(MacroAssembler* masm,
- Register receiver,
- Register elements,
- Register scratch0,
- Register scratch1,
- Label* miss) {
- // Register usage:
- // receiver: holds the receiver on entry and is unchanged.
- // elements: holds the property dictionary on fall through.
- // Scratch registers:
- // scratch0: used to holds the receiver map.
- // scratch1: used to holds the receiver instance type, receiver bit mask
- // and elements map.
-
- // Check that the receiver isn't a smi.
- __ JumpIfSmi(receiver, miss);
-
- // Check that the receiver is a valid JS object.
- __ GetObjectType(receiver, scratch0, scratch1);
- __ Branch(miss, lt, scratch1, Operand(FIRST_SPEC_OBJECT_TYPE));
-
- // If this assert fails, we have to check upper bound too.
- STATIC_ASSERT(LAST_TYPE == LAST_SPEC_OBJECT_TYPE);
-
- GenerateGlobalInstanceTypeCheck(masm, scratch1, miss);
-
- // Check that the global object does not require access checks.
- __ lbu(scratch1, FieldMemOperand(scratch0, Map::kBitFieldOffset));
- __ And(scratch1, scratch1, Operand((1 << Map::kIsAccessCheckNeeded) |
- (1 << Map::kHasNamedInterceptor)));
- __ Branch(miss, ne, scratch1, Operand(zero_reg));
-
- __ lw(elements, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
- __ lw(scratch1, FieldMemOperand(elements, HeapObject::kMapOffset));
- __ LoadRoot(scratch0, Heap::kHashTableMapRootIndex);
- __ Branch(miss, ne, scratch1, Operand(scratch0));
-}
-
-
// Helper function used from LoadIC GenerateNormal.
//
// elements: Property dictionary. It is not clobbered if a jump to the miss
@@ -334,29 +293,20 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- a2 : name
- // -- lr : return address
- // -- a1 : receiver
- // -----------------------------------
- ASSERT(a1.is(ReceiverRegister()));
- ASSERT(a2.is(NameRegister()));
-
- Label miss, slow;
+ Register dictionary = a0;
+ ASSERT(!dictionary.is(ReceiverRegister()));
+ ASSERT(!dictionary.is(NameRegister()));
- GenerateNameDictionaryReceiverCheck(masm, a1, a0, a3, t0, &miss);
+ Label slow;
- // a0: elements
- GenerateDictionaryLoad(masm, &slow, a0, a2, v0, a3, t0);
+ __ lw(dictionary,
+ FieldMemOperand(ReceiverRegister(), JSObject::kPropertiesOffset));
+ GenerateDictionaryLoad(masm, &slow, dictionary, NameRegister(), v0, a3, t0);
__ Ret();
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
GenerateRuntimeGetProperty(masm);
-
- // Cache miss: Jump to runtime.
- __ bind(&miss);
- GenerateMiss(masm);
}
@@ -1178,13 +1128,14 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) {
Register receiver = ReceiverRegister();
Register name = NameRegister();
Register value = ValueRegister();
+ Register dictionary = a3;
ASSERT(receiver.is(a1));
ASSERT(name.is(a2));
ASSERT(value.is(a0));
- GenerateNameDictionaryReceiverCheck(masm, receiver, a3, t0, t1, &miss);
+ __ lw(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
- GenerateDictionaryStore(masm, &miss, a3, name, value, t0, t1);
+ GenerateDictionaryStore(masm, &miss, dictionary, name, value, t0, t1);
Counters* counters = masm->isolate()->counters();
__ IncrementCounter(counters->store_normal_hit(), 1, t0, t1);
__ Ret();
« no previous file with comments | « no previous file | src/mips64/ic-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698