Revision: 12314
Author: [email protected]
Date: Thu Aug 16 02:10:10 2012
Log: MIPS: Fix improved LoadICs for dictionaries with callbacks.
Port r12311 (f698ddd7)
Original commit message:
This fixes the positive lookup performed by these LoadICs, to use the
holder instead of the receiver to perfrom the lookup on. It also extends
this improvement to KeyedLoadICs. And it fixes a bug introduced for the
JavaScript getter case of a LoadIC.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/10823326
Patch from Akos Palfi <[email protected]>.
http://code.google.com/p/v8/source/detail?r=12314
Modified:
/branches/bleeding_edge/src/mips/stub-cache-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Fri Aug 10 05:28:12
2012
+++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Thu Aug 16 02:10:10
2012
@@ -1242,8 +1242,12 @@
Handle<AccessorInfo>
callback,
Handle<String> name,
Label* miss) {
+ ASSERT(!receiver.is(scratch1));
+ ASSERT(!receiver.is(scratch2));
+ ASSERT(!receiver.is(scratch3));
+
+ // Load the properties dictionary.
Register dictionary = scratch1;
- Register index = scratch2;
__ lw(dictionary, FieldMemOperand(receiver,
JSObject::kPropertiesOffset));
// Probe the dictionary.
@@ -1253,21 +1257,18 @@
&probe_done,
dictionary,
name_reg,
- index, // Set if we
hit.
+ scratch2,
scratch3);
__ bind(&probe_done);
- // If probing finds an entry in the dictionary, check that the value is
the
- // callback.
- const int kElementsStartOffset =
- StringDictionary::kHeaderSize +
+ // If probing finds an entry in the dictionary, scratch3 contains the
+ // pointer into the dictionary. Check that the value is the callback.
+ Register pointer = scratch3;
+ const int kElementsStartOffset = StringDictionary::kHeaderSize +
StringDictionary::kElementsStartIndex * kPointerSize;
const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ Addu(scratch1, dictionary, Operand(kValueOffset - kHeapObjectTag));
- __ sll(scratch3, index, kPointerSizeLog2);
- __ addu(scratch1, scratch1, scratch3);
- __ lw(scratch3, MemOperand(scratch1));
- __ Branch(miss, ne, scratch3, Operand(callback));
+ __ lw(scratch2, FieldMemOperand(pointer, kValueOffset));
+ __ Branch(miss, ne, scratch2, Operand(callback));
}
@@ -1278,6 +1279,7 @@
Register scratch1,
Register scratch2,
Register scratch3,
+ Register scratch4,
Handle<AccessorInfo> callback,
Handle<String> name,
Label* miss) {
@@ -1290,7 +1292,7 @@
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
GenerateDictionaryLoadCallback(
- receiver, name_reg, scratch1, scratch2, scratch3, callback, name,
miss);
+ reg, name_reg, scratch2, scratch3, scratch4, callback, name, miss);
}
// Build AccessorInfo::args_ list on the stack and push property name
below
@@ -2920,7 +2922,7 @@
// -- ra : return address
// -----------------------------------
Label miss;
- GenerateLoadCallback(object, holder, a0, a2, a3, a1, t0, callback, name,
+ GenerateLoadCallback(object, holder, a0, a2, a3, a1, t0, t1, callback,
name,
&miss);
__ bind(&miss);
GenerateLoadMiss(masm(), Code::LOAD_IC);
@@ -3089,8 +3091,8 @@
// Check the key is the cached one.
__ Branch(&miss, ne, a0, Operand(name));
- GenerateLoadCallback(receiver, holder, a1, a0, a2, a3, t0, callback,
name,
- &miss);
+ GenerateLoadCallback(receiver, holder, a1, a0, a2, a3, t0, t1, callback,
+ name, &miss);
__ bind(&miss);
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev