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

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

Issue 1160933003: PPC: Make KeyedStores from a sloppy arguments array use a handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ppc/ic-ppc.cc
diff --git a/src/ic/ppc/ic-ppc.cc b/src/ic/ppc/ic-ppc.cc
index 206020de66a23b464dbe2e9bb59e16d1acf13c57..84cc09e40b460e7cdf0495b3da44e03b6918299a 100644
--- a/src/ic/ppc/ic-ppc.cc
+++ b/src/ic/ppc/ic-ppc.cc
@@ -333,117 +333,6 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
}
-static MemOperand GenerateMappedArgumentsLookup(
- MacroAssembler* masm, Register object, Register key, Register scratch1,
- Register scratch2, Register scratch3, Label* unmapped_case,
- Label* slow_case) {
- Heap* heap = masm->isolate()->heap();
-
- // Check that the receiver is a JSObject. Because of the map check
- // later, we do not need to check for interceptors or whether it
- // requires access checks.
- __ JumpIfSmi(object, slow_case);
- // Check that the object is some kind of JSObject.
- __ CompareObjectType(object, scratch1, scratch2, FIRST_JS_RECEIVER_TYPE);
- __ blt(slow_case);
-
- // Check that the key is a positive smi.
- __ mov(scratch1, Operand(0x80000001));
- __ and_(r0, key, scratch1, SetRC);
- __ bne(slow_case, cr0);
-
- // Load the elements into scratch1 and check its map.
- Handle<Map> arguments_map(heap->sloppy_arguments_elements_map());
- __ LoadP(scratch1, FieldMemOperand(object, JSObject::kElementsOffset));
- __ CheckMap(scratch1, scratch2, arguments_map, slow_case, DONT_DO_SMI_CHECK);
-
- // Check if element is in the range of mapped arguments. If not, jump
- // to the unmapped lookup with the parameter map in scratch1.
- __ LoadP(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset));
- __ SubSmiLiteral(scratch2, scratch2, Smi::FromInt(2), r0);
- __ cmpl(key, scratch2);
- __ bge(unmapped_case);
-
- // Load element index and check whether it is the hole.
- const int kOffset =
- FixedArray::kHeaderSize + 2 * kPointerSize - kHeapObjectTag;
-
- __ SmiToPtrArrayOffset(scratch3, key);
- __ addi(scratch3, scratch3, Operand(kOffset));
-
- __ LoadPX(scratch2, MemOperand(scratch1, scratch3));
- __ LoadRoot(scratch3, Heap::kTheHoleValueRootIndex);
- __ cmp(scratch2, scratch3);
- __ beq(unmapped_case);
-
- // Load value from context and return it. We can reuse scratch1 because
- // we do not jump to the unmapped lookup (which requires the parameter
- // map in scratch1).
- __ LoadP(scratch1, FieldMemOperand(scratch1, FixedArray::kHeaderSize));
- __ SmiToPtrArrayOffset(scratch3, scratch2);
- __ addi(scratch3, scratch3, Operand(Context::kHeaderSize - kHeapObjectTag));
- return MemOperand(scratch1, scratch3);
-}
-
-
-static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm,
- Register key,
- Register parameter_map,
- Register scratch,
- Label* slow_case) {
- // Element is in arguments backing store, which is referenced by the
- // second element of the parameter_map. The parameter_map register
- // must be loaded with the parameter map of the arguments object and is
- // overwritten.
- const int kBackingStoreOffset = FixedArray::kHeaderSize + kPointerSize;
- Register backing_store = parameter_map;
- __ LoadP(backing_store, FieldMemOperand(parameter_map, kBackingStoreOffset));
- Handle<Map> fixed_array_map(masm->isolate()->heap()->fixed_array_map());
- __ CheckMap(backing_store, scratch, fixed_array_map, slow_case,
- DONT_DO_SMI_CHECK);
- __ LoadP(scratch, FieldMemOperand(backing_store, FixedArray::kLengthOffset));
- __ cmpl(key, scratch);
- __ bge(slow_case);
- __ SmiToPtrArrayOffset(scratch, key);
- __ addi(scratch, scratch, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
- return MemOperand(backing_store, scratch);
-}
-
-
-void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
- Register receiver = StoreDescriptor::ReceiverRegister();
- Register key = StoreDescriptor::NameRegister();
- Register value = StoreDescriptor::ValueRegister();
- DCHECK(receiver.is(r4));
- DCHECK(key.is(r5));
- DCHECK(value.is(r3));
-
- Label slow, notin;
- MemOperand mapped_location = GenerateMappedArgumentsLookup(
- masm, receiver, key, r6, r7, r8, &notin, &slow);
- Register mapped_base = mapped_location.ra();
- Register mapped_offset = mapped_location.rb();
- __ StorePX(value, mapped_location);
- __ add(r9, mapped_base, mapped_offset);
- __ mr(r11, value);
- __ RecordWrite(mapped_base, r9, r11, kLRHasNotBeenSaved, kDontSaveFPRegs);
- __ Ret();
- __ bind(&notin);
- // The unmapped lookup expects that the parameter map is in r6.
- MemOperand unmapped_location =
- GenerateUnmappedArgumentsLookup(masm, key, r6, r7, &slow);
- Register unmapped_base = unmapped_location.ra();
- Register unmapped_offset = unmapped_location.rb();
- __ StorePX(value, unmapped_location);
- __ add(r9, unmapped_base, unmapped_offset);
- __ mr(r11, value);
- __ RecordWrite(unmapped_base, r9, r11, kLRHasNotBeenSaved, kDontSaveFPRegs);
- __ Ret();
- __ bind(&slow);
- GenerateMiss(masm);
-}
-
-
void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
// The return address is in lr.
Isolate* isolate = masm->isolate();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698