OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 } | 1027 } |
1028 | 1028 |
1029 Handle<HeapType> type = receiver_type(); | 1029 Handle<HeapType> type = receiver_type(); |
1030 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); | 1030 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); |
1031 bool receiver_is_holder = object.is_identical_to(holder); | 1031 bool receiver_is_holder = object.is_identical_to(holder); |
1032 // -------------- Interceptors -------------- | 1032 // -------------- Interceptors -------------- |
1033 if (lookup->state() == LookupIterator::INTERCEPTOR) { | 1033 if (lookup->state() == LookupIterator::INTERCEPTOR) { |
1034 DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined()); | 1034 DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined()); |
1035 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, | 1035 NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder, |
1036 cache_holder); | 1036 cache_holder); |
1037 return compiler.CompileLoadInterceptor(name); | 1037 // Perform a lookup behind the interceptor. Copy the LookupIterator since |
| 1038 // the original iterator will be used to fetch the value. |
| 1039 LookupIterator it(lookup); |
| 1040 it.Next(); |
| 1041 LookupForRead(&it); |
| 1042 return compiler.CompileLoadInterceptor(&it, name); |
1038 } | 1043 } |
1039 DCHECK(lookup->state() == LookupIterator::PROPERTY); | 1044 DCHECK(lookup->state() == LookupIterator::PROPERTY); |
1040 | 1045 |
1041 // -------------- Accessors -------------- | 1046 // -------------- Accessors -------------- |
1042 if (lookup->property_kind() == LookupIterator::ACCESSOR) { | 1047 if (lookup->property_kind() == LookupIterator::ACCESSOR) { |
1043 // Use simple field loads for some well-known callback properties. | 1048 // Use simple field loads for some well-known callback properties. |
1044 if (receiver_is_holder) { | 1049 if (receiver_is_holder) { |
1045 DCHECK(object->IsJSObject()); | 1050 DCHECK(object->IsJSObject()); |
1046 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1051 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
1047 int object_offset; | 1052 int object_offset; |
(...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3170 #undef ADDR | 3175 #undef ADDR |
3171 }; | 3176 }; |
3172 | 3177 |
3173 | 3178 |
3174 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3179 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3175 return IC_utilities[id]; | 3180 return IC_utilities[id]; |
3176 } | 3181 } |
3177 | 3182 |
3178 | 3183 |
3179 } } // namespace v8::internal | 3184 } } // namespace v8::internal |
OLD | NEW |