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/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 // Perform a lookup behind the interceptor. Copy the LookupIterator since | 1212 // Perform a lookup behind the interceptor. Copy the LookupIterator since |
1213 // the original iterator will be used to fetch the value. | 1213 // the original iterator will be used to fetch the value. |
1214 LookupIterator it = *lookup; | 1214 LookupIterator it = *lookup; |
1215 it.Next(); | 1215 it.Next(); |
1216 LookupForRead(&it); | 1216 LookupForRead(&it); |
1217 return compiler.CompileLoadInterceptor(&it); | 1217 return compiler.CompileLoadInterceptor(&it); |
1218 } | 1218 } |
1219 | 1219 |
1220 case LookupIterator::ACCESSOR: { | 1220 case LookupIterator::ACCESSOR: { |
1221 // Use simple field loads for some well-known callback properties. | 1221 // Use simple field loads for some well-known callback properties. |
1222 if (receiver_is_holder) { | 1222 // The method will only return true for absolute truths based on the |
1223 DCHECK(receiver->IsJSObject()); | 1223 // receiver maps. |
1224 Handle<JSObject> js_receiver = Handle<JSObject>::cast(receiver); | 1224 int object_offset; |
1225 int object_offset; | 1225 if (Accessors::IsJSObjectFieldAccessor(map, lookup->name(), |
1226 if (Accessors::IsJSObjectFieldAccessor(map, lookup->name(), | 1226 &object_offset)) { |
1227 &object_offset)) { | 1227 FieldIndex index = FieldIndex::ForInObjectOffset(object_offset, *map); |
1228 FieldIndex index = | 1228 return SimpleFieldLoad(index); |
1229 FieldIndex::ForInObjectOffset(object_offset, js_receiver->map()); | |
1230 return SimpleFieldLoad(index); | |
1231 } | |
1232 } | 1229 } |
1233 | 1230 |
1234 Handle<Object> accessors = lookup->GetAccessors(); | 1231 Handle<Object> accessors = lookup->GetAccessors(); |
1235 if (accessors->IsExecutableAccessorInfo()) { | 1232 if (accessors->IsExecutableAccessorInfo()) { |
1236 Handle<ExecutableAccessorInfo> info = | 1233 Handle<ExecutableAccessorInfo> info = |
1237 Handle<ExecutableAccessorInfo>::cast(accessors); | 1234 Handle<ExecutableAccessorInfo>::cast(accessors); |
1238 if (v8::ToCData<Address>(info->getter()) == 0) break; | 1235 if (v8::ToCData<Address>(info->getter()) == 0) break; |
1239 if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info, | 1236 if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info, |
1240 map)) { | 1237 map)) { |
1241 break; | 1238 break; |
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3048 static const Address IC_utilities[] = { | 3045 static const Address IC_utilities[] = { |
3049 #define ADDR(name) FUNCTION_ADDR(name), | 3046 #define ADDR(name) FUNCTION_ADDR(name), |
3050 IC_UTIL_LIST(ADDR) NULL | 3047 IC_UTIL_LIST(ADDR) NULL |
3051 #undef ADDR | 3048 #undef ADDR |
3052 }; | 3049 }; |
3053 | 3050 |
3054 | 3051 |
3055 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3052 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
3056 } | 3053 } |
3057 } // namespace v8::internal | 3054 } // namespace v8::internal |
OLD | NEW |