Index: src/arm/stub-cache-arm.cc |
=================================================================== |
--- src/arm/stub-cache-arm.cc (revision 12254) |
+++ src/arm/stub-cache-arm.cc (working copy) |
@@ -1230,6 +1230,42 @@ |
} |
+void StubCompiler::GenerateDictionaryLoadCallback(Register receiver, |
+ Register name_reg, |
+ Register scratch1, |
+ Register scratch2, |
+ Register scratch3, |
+ Handle<AccessorInfo> callback, |
+ Handle<String> name, |
+ Label* miss) { |
+ Register dictionary = scratch1; |
+ __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
+ |
+ // Probe the dictionary. |
+ Label probe_done; |
+ StringDictionaryLookupStub::GeneratePositiveLookup(masm(), |
+ miss, |
+ &probe_done, |
+ dictionary, |
+ name_reg, |
+ scratch2, |
+ scratch3); |
+ __ bind(&probe_done); |
+ |
+ // If probing finds an entry in the dictionary, scratch2 contains the |
+ // index into the dictionary. Check that the value is the callback. |
+ Register index = scratch2; |
Toon Verwaest
2012/08/06 13:49:24
If you do this assignment before passing scratch2
Erik Corry
2012/08/06 14:26:46
Done.
|
+ const int kElementsStartOffset = |
+ StringDictionary::kHeaderSize + |
+ StringDictionary::kElementsStartIndex * kPointerSize; |
+ const int kValueOffset = kElementsStartOffset + kPointerSize; |
+ __ add(scratch1, dictionary, Operand(kValueOffset - kHeapObjectTag)); |
+ __ ldr(scratch3, MemOperand(scratch1, index, LSL, kPointerSizeLog2)); |
+ __ cmp(scratch3, Operand(callback)); |
+ __ b(ne, miss); |
+} |
+ |
+ |
void StubCompiler::GenerateLoadCallback(Handle<JSObject> object, |
Handle<JSObject> holder, |
Register receiver, |
@@ -1247,6 +1283,11 @@ |
Register reg = CheckPrototypes(object, receiver, holder, scratch1, |
scratch2, scratch3, name, miss); |
+ if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { |
+ GenerateDictionaryLoadCallback( |
+ receiver, name_reg, scratch1, scratch2, scratch3, callback, name, miss); |
+ } |
+ |
// Build AccessorInfo::args_ list on the stack and push property name below |
// the exit frame to make GC aware of them and store pointers to them. |
__ push(receiver); |