Index: src/ia32/stub-cache-ia32.cc |
=================================================================== |
--- src/ia32/stub-cache-ia32.cc (revision 12254) |
+++ src/ia32/stub-cache-ia32.cc (working copy) |
@@ -1052,6 +1052,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; |
+ __ mov(dictionary, FieldOperand(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; |
+ const int kElementsStartOffset = |
+ StringDictionary::kHeaderSize + |
+ StringDictionary::kElementsStartIndex * kPointerSize; |
+ const int kValueOffset = kElementsStartOffset + kPointerSize; |
+ __ mov(scratch3, |
+ Operand(dictionary, index, times_4, kValueOffset - kHeapObjectTag)); |
+ __ cmp(scratch3, callback); |
+ __ j(not_equal, miss); |
+} |
+ |
+ |
void StubCompiler::GenerateLoadCallback(Handle<JSObject> object, |
Handle<JSObject> holder, |
Register receiver, |
@@ -1069,6 +1105,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); |
Michael Starzinger
2012/08/13 17:47:16
This performs a dictionary lookup on the receiver,
|
+ } |
+ |
// Insert additional parameters into the stack frame above return address. |
ASSERT(!scratch3.is(reg)); |
__ pop(scratch3); // Get return address to place it below. |