| 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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 Handle<Object> accessors = lookup->GetAccessors(); | 1142 Handle<Object> accessors = lookup->GetAccessors(); |
| 1143 if (accessors->IsAccessorPair()) { | 1143 if (accessors->IsAccessorPair()) { |
| 1144 if (lookup->TryLookupCachedProperty()) { | 1144 if (lookup->TryLookupCachedProperty()) { |
| 1145 DCHECK_EQ(LookupIterator::DATA, lookup->state()); | 1145 DCHECK_EQ(LookupIterator::DATA, lookup->state()); |
| 1146 return ComputeHandler(lookup); | 1146 return ComputeHandler(lookup); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 // When debugging we need to go the slow path to flood the accessor. | 1149 // When debugging we need to go the slow path to flood the accessor. |
| 1150 if (GetHostFunction()->shared()->HasDebugInfo()) { | 1150 if (GetHostFunction()->shared()->HasBreakInfo()) { |
| 1151 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); | 1151 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); |
| 1152 return slow_stub(); | 1152 return slow_stub(); |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 Handle<Object> getter(AccessorPair::cast(*accessors)->getter(), | 1155 Handle<Object> getter(AccessorPair::cast(*accessors)->getter(), |
| 1156 isolate()); | 1156 isolate()); |
| 1157 if (!getter->IsJSFunction() && !getter->IsFunctionTemplateInfo()) { | 1157 if (!getter->IsJSFunction() && !getter->IsFunctionTemplateInfo()) { |
| 1158 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); | 1158 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub); |
| 1159 return slow_stub(); | 1159 return slow_stub(); |
| 1160 } | 1160 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 } | 1276 } |
| 1277 | 1277 |
| 1278 Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup) { | 1278 Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup) { |
| 1279 DCHECK_EQ(LookupIterator::ACCESSOR, lookup->state()); | 1279 DCHECK_EQ(LookupIterator::ACCESSOR, lookup->state()); |
| 1280 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); | 1280 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); |
| 1281 Handle<Map> map = receiver_map(); | 1281 Handle<Map> map = receiver_map(); |
| 1282 | 1282 |
| 1283 Handle<Object> accessors = lookup->GetAccessors(); | 1283 Handle<Object> accessors = lookup->GetAccessors(); |
| 1284 DCHECK(accessors->IsAccessorPair()); | 1284 DCHECK(accessors->IsAccessorPair()); |
| 1285 DCHECK(holder->HasFastProperties()); | 1285 DCHECK(holder->HasFastProperties()); |
| 1286 DCHECK(!GetHostFunction()->shared()->HasDebugInfo()); | 1286 DCHECK(!GetHostFunction()->shared()->HasBreakInfo()); |
| 1287 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), | 1287 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), |
| 1288 isolate()); | 1288 isolate()); |
| 1289 CallOptimization call_optimization(getter); | 1289 CallOptimization call_optimization(getter); |
| 1290 NamedLoadHandlerCompiler compiler(isolate(), map, holder); | 1290 NamedLoadHandlerCompiler compiler(isolate(), map, holder); |
| 1291 DCHECK(call_optimization.is_simple_api_call()); | 1291 DCHECK(call_optimization.is_simple_api_call()); |
| 1292 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback); | 1292 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback); |
| 1293 int index = lookup->GetAccessorIndex(); | 1293 int index = lookup->GetAccessorIndex(); |
| 1294 Handle<Code> code = compiler.CompileLoadCallback( | 1294 Handle<Code> code = compiler.CompileLoadCallback( |
| 1295 lookup->name(), call_optimization, index, slow_stub()); | 1295 lookup->name(), call_optimization, index, slow_stub()); |
| 1296 return code; | 1296 return code; |
| (...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2990 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); | 2990 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); |
| 2991 it.Next(); | 2991 it.Next(); |
| 2992 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2992 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 2993 Object::GetProperty(&it)); | 2993 Object::GetProperty(&it)); |
| 2994 } | 2994 } |
| 2995 | 2995 |
| 2996 return *result; | 2996 return *result; |
| 2997 } | 2997 } |
| 2998 } // namespace internal | 2998 } // namespace internal |
| 2999 } // namespace v8 | 2999 } // namespace v8 |
| OLD | NEW |