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

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

Issue 2424433002: [ic] Delete old KeyedLoadIC code (Closed)
Patch Set: fix failing test Created 4 years, 2 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 | « src/ic/ppc/ic-ppc.cc ('k') | src/ic/x64/ic-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/s390/ic-s390.cc
diff --git a/src/ic/s390/ic-s390.cc b/src/ic/s390/ic-s390.cc
index 08eb3e4ff128bea47b90a161012151f8ca6874cf..bd83af1f59ceb3bdb4565e14064669c9b730424d 100644
--- a/src/ic/s390/ic-s390.cc
+++ b/src/ic/s390/ic-s390.cc
@@ -18,16 +18,6 @@ namespace internal {
#define __ ACCESS_MASM(masm)
-static void GenerateGlobalInstanceTypeCheck(MacroAssembler* masm, Register type,
- Label* global_object) {
- // Register usage:
- // type: holds the receiver instance type on entry.
- __ CmpP(type, Operand(JS_GLOBAL_OBJECT_TYPE));
- __ beq(global_object);
- __ CmpP(type, Operand(JS_GLOBAL_PROXY_TYPE));
- __ beq(global_object);
-}
-
// Helper function used from LoadIC GenerateNormal.
//
// elements: Property dictionary. It is not clobbered if a jump to the miss
@@ -127,141 +117,6 @@ static void GenerateDictionaryStore(MacroAssembler* masm, Label* miss,
kDontSaveFPRegs);
}
-// Checks the receiver for special cases (value type, slow case bits).
-// Falls through for regular JS object.
-static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
- Register receiver, Register map,
- Register scratch,
- int interceptor_bit, Label* slow) {
- // Check that the object isn't a smi.
- __ JumpIfSmi(receiver, slow);
- // Get the map of the receiver.
- __ LoadP(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
- // Check bit field.
- __ LoadlB(scratch, FieldMemOperand(map, Map::kBitFieldOffset));
- DCHECK(((1 << Map::kIsAccessCheckNeeded) | (1 << interceptor_bit)) < 0x8000);
- __ mov(r0,
- Operand((1 << Map::kIsAccessCheckNeeded) | (1 << interceptor_bit)));
- __ AndP(r0, scratch);
- __ bne(slow /*, cr0*/);
- // Check that the object is some kind of JS object EXCEPT JS Value type.
- // In the case that the object is a value-wrapper object,
- // we enter the runtime system to make sure that indexing into string
- // objects work as intended.
- DCHECK(JS_OBJECT_TYPE > JS_VALUE_TYPE);
- __ LoadlB(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset));
- __ CmpP(scratch, Operand(JS_OBJECT_TYPE));
- __ blt(slow);
-}
-
-// Loads an indexed element from a fast case array.
-static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
- Register key, Register elements,
- Register scratch1, Register scratch2,
- Register result, Label* slow) {
- // Register use:
- //
- // receiver - holds the receiver on entry.
- // Unchanged unless 'result' is the same register.
- //
- // key - holds the smi key on entry.
- // Unchanged unless 'result' is the same register.
- //
- // result - holds the result on exit if the load succeeded.
- // Allowed to be the the same as 'receiver' or 'key'.
- // Unchanged on bailout so 'receiver' and 'key' can be safely
- // used by further computation.
- //
- // Scratch registers:
- //
- // elements - holds the elements of the receiver and its protoypes.
- //
- // scratch1 - used to hold elements length, bit fields, base addresses.
- //
- // scratch2 - used to hold maps, prototypes, and the loaded value.
- Label check_prototypes, check_next_prototype;
- Label done, in_bounds, absent;
-
- __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset));
- __ AssertFastElements(elements);
-
- // Check that the key (index) is within bounds.
- __ LoadP(scratch1, FieldMemOperand(elements, FixedArray::kLengthOffset));
- __ CmpLogicalP(key, scratch1);
- __ blt(&in_bounds, Label::kNear);
- // Out-of-bounds. Check the prototype chain to see if we can just return
- // 'undefined'.
- __ CmpP(key, Operand::Zero());
- __ blt(slow); // Negative keys can't take the fast OOB path.
- __ bind(&check_prototypes);
- __ LoadP(scratch2, FieldMemOperand(receiver, HeapObject::kMapOffset));
- __ bind(&check_next_prototype);
- __ LoadP(scratch2, FieldMemOperand(scratch2, Map::kPrototypeOffset));
- // scratch2: current prototype
- __ CompareRoot(scratch2, Heap::kNullValueRootIndex);
- __ beq(&absent, Label::kNear);
- __ LoadP(elements, FieldMemOperand(scratch2, JSObject::kElementsOffset));
- __ LoadP(scratch2, FieldMemOperand(scratch2, HeapObject::kMapOffset));
- // elements: elements of current prototype
- // scratch2: map of current prototype
- __ CompareInstanceType(scratch2, scratch1, JS_OBJECT_TYPE);
- __ blt(slow);
- __ LoadlB(scratch1, FieldMemOperand(scratch2, Map::kBitFieldOffset));
- __ AndP(r0, scratch1, Operand((1 << Map::kIsAccessCheckNeeded) |
- (1 << Map::kHasIndexedInterceptor)));
- __ bne(slow);
- __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex);
- __ bne(slow);
- __ jmp(&check_next_prototype);
-
- __ bind(&absent);
- __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
- __ jmp(&done);
-
- __ bind(&in_bounds);
- // Fast case: Do the load.
- __ AddP(scratch1, elements,
- Operand(FixedArray::kHeaderSize - kHeapObjectTag));
- // The key is a smi.
- __ SmiToPtrArrayOffset(scratch2, key);
- __ LoadP(scratch2, MemOperand(scratch2, scratch1));
- __ CompareRoot(scratch2, Heap::kTheHoleValueRootIndex);
- // In case the loaded value is the_hole we have to check the prototype chain.
- __ beq(&check_prototypes);
- __ LoadRR(result, scratch2);
- __ bind(&done);
-}
-
-// Checks whether a key is an array index string or a unique name.
-// Falls through if a key is a unique name.
-static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
- Register map, Register hash,
- Label* index_string, Label* not_unique) {
- // The key is not a smi.
- Label unique;
- // Is it a name?
- __ CompareObjectType(key, map, hash, LAST_UNIQUE_NAME_TYPE);
- __ bgt(not_unique);
- STATIC_ASSERT(LAST_UNIQUE_NAME_TYPE == FIRST_NONSTRING_TYPE);
- __ beq(&unique, Label::kNear);
-
- // Is the string an array index, with cached numeric value?
- __ LoadlW(hash, FieldMemOperand(key, Name::kHashFieldOffset));
- __ mov(r7, Operand(Name::kContainsCachedArrayIndexMask));
- __ AndP(r0, hash, r7);
- __ beq(index_string);
-
- // Is the string internalized? We know it's a string, so a single
- // bit test is enough.
- // map: key map
- __ LoadlB(hash, FieldMemOperand(map, Map::kInstanceTypeOffset));
- STATIC_ASSERT(kInternalizedTag == 0);
- __ tmll(hash, Operand(kIsNotInternalizedMask));
- __ bne(not_unique);
-
- __ bind(&unique);
-}
-
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = r2;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
@@ -339,103 +194,6 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}
-void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
- // The return address is in lr.
- Label slow, check_name, index_smi, index_name, property_array_property;
- Label probe_dictionary, check_number_dictionary;
-
- Register key = LoadDescriptor::NameRegister();
- Register receiver = LoadDescriptor::ReceiverRegister();
- DCHECK(key.is(r4));
- DCHECK(receiver.is(r3));
-
- Isolate* isolate = masm->isolate();
-
- // Check that the key is a smi.
- __ JumpIfNotSmi(key, &check_name);
- __ bind(&index_smi);
- // Now the key is known to be a smi. This place is also jumped to from below
- // where a numeric string is converted to a smi.
-
- GenerateKeyedLoadReceiverCheck(masm, receiver, r2, r5,
- Map::kHasIndexedInterceptor, &slow);
-
- // Check the receiver's map to see if it has fast elements.
- __ CheckFastElements(r2, r5, &check_number_dictionary);
-
- GenerateFastArrayLoad(masm, receiver, key, r2, r5, r6, r2, &slow);
- __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, r6,
- r5);
- __ Ret();
-
- __ bind(&check_number_dictionary);
- __ LoadP(r6, FieldMemOperand(receiver, JSObject::kElementsOffset));
- __ LoadP(r5, FieldMemOperand(r6, JSObject::kMapOffset));
-
- // Check whether the elements is a number dictionary.
- // r5: elements map
- // r6: elements
- __ CompareRoot(r5, Heap::kHashTableMapRootIndex);
- __ bne(&slow, Label::kNear);
- __ SmiUntag(r2, key);
- __ LoadFromNumberDictionary(&slow, r6, key, r2, r2, r5, r7);
- __ Ret();
-
- // Slow case, key and receiver still in r2 and r3.
- __ bind(&slow);
- __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, r6,
- r5);
- GenerateRuntimeGetProperty(masm);
-
- __ bind(&check_name);
- GenerateKeyNameCheck(masm, key, r2, r5, &index_name, &slow);
-
- GenerateKeyedLoadReceiverCheck(masm, receiver, r2, r5,
- Map::kHasNamedInterceptor, &slow);
-
- // If the receiver is a fast-case object, check the stub cache. Otherwise
- // probe the dictionary.
- __ LoadP(r5, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
- __ LoadP(r6, FieldMemOperand(r5, HeapObject::kMapOffset));
- __ CompareRoot(r6, Heap::kHashTableMapRootIndex);
- __ beq(&probe_dictionary);
-
- // The handlers in the stub cache expect a vector and slot. Since we won't
- // change the IC from any downstream misses, a dummy vector can be used.
- Register vector = LoadWithVectorDescriptor::VectorRegister();
- Register slot = LoadWithVectorDescriptor::SlotRegister();
- DCHECK(!AreAliased(vector, slot, r6, r7, r8, r9));
- Handle<TypeFeedbackVector> dummy_vector =
- TypeFeedbackVector::DummyVector(masm->isolate());
- int slot_index = dummy_vector->GetIndex(
- FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot));
- __ LoadRoot(vector, Heap::kDummyVectorRootIndex);
- __ LoadSmiLiteral(slot, Smi::FromInt(slot_index));
-
- masm->isolate()->load_stub_cache()->GenerateProbe(masm, receiver, key, r6, r7,
- r8, r9);
- // Cache miss.
- GenerateMiss(masm);
-
- // Do a quick inline probe of the receiver's dictionary, if it
- // exists.
- __ bind(&probe_dictionary);
- // r5: elements
- __ LoadP(r2, FieldMemOperand(receiver, HeapObject::kMapOffset));
- __ LoadlB(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset));
- GenerateGlobalInstanceTypeCheck(masm, r2, &slow);
- // Load the property to r2.
- GenerateDictionaryLoad(masm, &slow, r5, key, r2, r7, r6);
- __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1,
- r6, r5);
- __ Ret();
-
- __ bind(&index_name);
- __ IndexFromHash(r5, key);
- // Now jump to the place where smi keys are handled.
- __ b(&index_smi);
-}
-
static void StoreIC_PushArgs(MacroAssembler* masm) {
__ Push(StoreWithVectorDescriptor::ValueRegister(),
StoreWithVectorDescriptor::SlotRegister(),
« no previous file with comments | « src/ic/ppc/ic-ppc.cc ('k') | src/ic/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698