Index: src/ic.cc |
diff --git a/src/ic.cc b/src/ic.cc |
index 84e65ace6d7d640c528ee30dff1995b104eb86f9..f42b9f410f02db121959fd5500a4c8af53f6b637 100644 |
--- a/src/ic.cc |
+++ b/src/ic.cc |
@@ -1348,20 +1348,19 @@ Handle<Code> LoadIC::ComputeLoadHandler(LookupResult* lookup, |
if (!holder.is_identical_to(receiver)) break; |
return isolate()->stub_cache()->ComputeLoadNormal(name, receiver); |
case CALLBACKS: { |
- Handle<Object> callback(lookup->GetCallbackObject(), isolate()); |
- if (name->Equals(isolate()->heap()->length_string())) { |
- if (receiver->IsJSArray()) { |
- PropertyIndex lengthIndex = PropertyIndex::NewHeaderIndex( |
- JSArray::kLengthOffset / kPointerSize); |
- return isolate()->stub_cache()->ComputeLoadField( |
- name, receiver, receiver, lengthIndex, Representation::Tagged()); |
- } else if (receiver->IsJSTypedArray()) { |
- PropertyIndex lengthIndex = PropertyIndex::NewHeaderIndex( |
- JSTypedArray::kLengthOffset / kPointerSize); |
+ { |
Toon Verwaest
2013/09/24 15:37:38
Remove extra { .. }
|
+ // Use simple field loads for some well-known callback properties. |
+ int object_offset; |
+ Handle<Map> map(receiver->map()); |
+ if (Accessors::IsJSObjectFieldAccessor(map, name, &object_offset)) { |
+ PropertyIndex index = |
+ PropertyIndex::NewHeaderIndex(object_offset / kPointerSize); |
return isolate()->stub_cache()->ComputeLoadField( |
- name, receiver, receiver, lengthIndex, Representation::Tagged()); |
+ name, receiver, receiver, index, Representation::Tagged()); |
} |
} |
+ |
+ Handle<Object> callback(lookup->GetCallbackObject(), isolate()); |
if (callback->IsExecutableAccessorInfo()) { |
Handle<ExecutableAccessorInfo> info = |
Handle<ExecutableAccessorInfo>::cast(callback); |