Index: src/x64/stub-cache-x64.cc |
=================================================================== |
--- src/x64/stub-cache-x64.cc (revision 12254) |
+++ src/x64/stub-cache-x64.cc (working copy) |
@@ -1029,6 +1029,43 @@ |
} |
+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; |
+ __ movq(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; |
+ __ movq(scratch3, |
+ Operand(dictionary, index, times_8, kValueOffset - kHeapObjectTag)); |
+ __ movq(scratch2, callback, RelocInfo::EMBEDDED_OBJECT); |
+ __ cmpq(scratch3, scratch2); |
+ __ j(not_equal, miss); |
+} |
+ |
+ |
void StubCompiler::GenerateLoadCallback(Handle<JSObject> object, |
Handle<JSObject> holder, |
Register receiver, |
@@ -1046,6 +1083,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); |
+ } |
+ |
// Insert additional parameters into the stack frame above return address. |
ASSERT(!scratch2.is(reg)); |
__ pop(scratch2); // Get return address to place it below. |