Chromium Code Reviews| 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/ic/ic.h" | 5 #include "src/ic/ic.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-arguments-inl.h" | 8 #include "src/api-arguments-inl.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 case LookupIterator::ACCESSOR: { | 1274 case LookupIterator::ACCESSOR: { |
| 1275 #ifdef DEBUG | 1275 #ifdef DEBUG |
| 1276 int object_offset; | 1276 int object_offset; |
| 1277 DCHECK(!Accessors::IsJSObjectFieldAccessor(map, lookup->name(), | 1277 DCHECK(!Accessors::IsJSObjectFieldAccessor(map, lookup->name(), |
| 1278 &object_offset)); | 1278 &object_offset)); |
| 1279 #endif | 1279 #endif |
| 1280 | 1280 |
| 1281 DCHECK(IsCompatibleReceiver(lookup, map)); | 1281 DCHECK(IsCompatibleReceiver(lookup, map)); |
| 1282 if (lookup->TryLookupCacheProperty()) { | |
|
Toon Verwaest
2016/10/21 08:22:14
Shouldn't this be moved in the IsAccessorPair case
vogelheim
2016/11/03 16:12:23
Done.
| |
| 1283 DCHECK_EQ(LookupIterator::DATA, lookup->state()); | |
| 1284 return CompileHandler(lookup, unused, cache_holder); | |
|
Toon Verwaest
2016/10/21 08:22:14
Don't we have to go through ComputeHandler again?
vogelheim
2016/11/03 16:12:23
Done.
| |
| 1285 } | |
| 1282 Handle<Object> accessors = lookup->GetAccessors(); | 1286 Handle<Object> accessors = lookup->GetAccessors(); |
| 1283 if (accessors->IsAccessorPair()) { | 1287 if (accessors->IsAccessorPair()) { |
| 1284 DCHECK(holder->HasFastProperties()); | 1288 DCHECK(holder->HasFastProperties()); |
| 1285 DCHECK(!GetSharedFunctionInfo()->HasDebugInfo()); | 1289 DCHECK(!GetSharedFunctionInfo()->HasDebugInfo()); |
| 1286 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), | 1290 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), |
| 1287 isolate()); | 1291 isolate()); |
| 1288 CallOptimization call_optimization(getter); | 1292 CallOptimization call_optimization(getter); |
| 1289 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1293 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1290 if (call_optimization.is_simple_api_call()) { | 1294 if (call_optimization.is_simple_api_call()) { |
| 1291 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback); | 1295 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1325 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1329 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1326 Handle<PropertyCell> cell = lookup->GetPropertyCell(); | 1330 Handle<PropertyCell> cell = lookup->GetPropertyCell(); |
| 1327 Handle<Code> code = compiler.CompileLoadGlobal( | 1331 Handle<Code> code = compiler.CompileLoadGlobal( |
| 1328 cell, lookup->name(), lookup->IsConfigurable()); | 1332 cell, lookup->name(), lookup->IsConfigurable()); |
| 1329 return code; | 1333 return code; |
| 1330 } | 1334 } |
| 1331 | 1335 |
| 1332 // -------------- Fields -------------- | 1336 // -------------- Fields -------------- |
| 1333 if (lookup->property_details().type() == DATA) { | 1337 if (lookup->property_details().type() == DATA) { |
| 1334 FieldIndex field = lookup->GetFieldIndex(); | 1338 FieldIndex field = lookup->GetFieldIndex(); |
| 1335 DCHECK(!receiver_is_holder); | |
|
Toon Verwaest
2016/10/21 08:22:14
Why is this removed? I'm pretty sure we need this.
vogelheim
2016/11/03 16:12:23
Done.
(I guess this was an artefact of the Comp[i
| |
| 1336 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadField); | 1339 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadField); |
| 1337 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1340 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1338 return compiler.CompileLoadField(lookup->name(), field); | 1341 return compiler.CompileLoadField(lookup->name(), field); |
| 1339 } | 1342 } |
| 1340 | 1343 |
| 1341 // -------------- Constant properties -------------- | 1344 // -------------- Constant properties -------------- |
| 1342 DCHECK(lookup->property_details().type() == DATA_CONSTANT); | 1345 DCHECK(lookup->property_details().type() == DATA_CONSTANT); |
| 1343 DCHECK(!receiver_is_holder); | 1346 DCHECK(!receiver_is_holder); |
| 1344 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstant); | 1347 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstant); |
| 1345 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1348 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| (...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2965 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); | 2968 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); |
| 2966 it.Next(); | 2969 it.Next(); |
| 2967 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2970 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 2968 Object::GetProperty(&it)); | 2971 Object::GetProperty(&it)); |
| 2969 } | 2972 } |
| 2970 | 2973 |
| 2971 return *result; | 2974 return *result; |
| 2972 } | 2975 } |
| 2973 } // namespace internal | 2976 } // namespace internal |
| 2974 } // namespace v8 | 2977 } // namespace v8 |
| OLD | NEW |