OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/handler-compiler.h" | 5 #include "src/ic/handler-compiler.h" |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 Handle<Object> accessors = it->GetAccessors(); | 294 Handle<Object> accessors = it->GetAccessors(); |
295 if (accessors->IsAccessorInfo()) { | 295 if (accessors->IsAccessorInfo()) { |
296 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); | 296 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); |
297 inline_followup = | 297 inline_followup = |
298 info->getter() != NULL && | 298 info->getter() != NULL && |
299 AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map()); | 299 AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map()); |
300 } else if (accessors->IsAccessorPair()) { | 300 } else if (accessors->IsAccessorPair()) { |
301 Handle<JSObject> property_holder(it->GetHolder<JSObject>()); | 301 Handle<JSObject> property_holder(it->GetHolder<JSObject>()); |
302 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), | 302 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), |
303 isolate()); | 303 isolate()); |
304 if (!getter->IsJSFunction()) break; | 304 if (!(getter->IsJSFunction() || getter->IsFunctionTemplateInfo())) { |
| 305 break; |
| 306 } |
305 if (!property_holder->HasFastProperties()) break; | 307 if (!property_holder->HasFastProperties()) break; |
306 auto function = Handle<JSFunction>::cast(getter); | 308 CallOptimization call_optimization(getter); |
307 CallOptimization call_optimization(function); | |
308 Handle<Map> receiver_map = map(); | 309 Handle<Map> receiver_map = map(); |
309 inline_followup = call_optimization.is_simple_api_call() && | 310 inline_followup = call_optimization.is_simple_api_call() && |
310 call_optimization.IsCompatibleReceiverMap( | 311 call_optimization.IsCompatibleReceiverMap( |
311 receiver_map, property_holder); | 312 receiver_map, property_holder); |
312 } | 313 } |
313 } | 314 } |
314 } | 315 } |
315 | 316 |
316 Label miss; | 317 Label miss; |
317 InterceptorVectorSlotPush(receiver()); | 318 InterceptorVectorSlotPush(receiver()); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 GenerateTailCall(masm(), stub.GetCode()); | 391 GenerateTailCall(masm(), stub.GetCode()); |
391 break; | 392 break; |
392 } | 393 } |
393 case LookupIterator::ACCESSOR: | 394 case LookupIterator::ACCESSOR: |
394 if (it->GetAccessors()->IsAccessorInfo()) { | 395 if (it->GetAccessors()->IsAccessorInfo()) { |
395 Handle<AccessorInfo> info = | 396 Handle<AccessorInfo> info = |
396 Handle<AccessorInfo>::cast(it->GetAccessors()); | 397 Handle<AccessorInfo>::cast(it->GetAccessors()); |
397 DCHECK_NOT_NULL(info->getter()); | 398 DCHECK_NOT_NULL(info->getter()); |
398 GenerateLoadCallback(reg, info); | 399 GenerateLoadCallback(reg, info); |
399 } else { | 400 } else { |
400 auto function = handle(JSFunction::cast( | 401 Handle<Object> function = handle( |
401 AccessorPair::cast(*it->GetAccessors())->getter())); | 402 AccessorPair::cast(*it->GetAccessors())->getter(), isolate()); |
402 CallOptimization call_optimization(function); | 403 CallOptimization call_optimization(function); |
403 GenerateApiAccessorCall(masm(), call_optimization, holder_map, | 404 GenerateApiAccessorCall(masm(), call_optimization, holder_map, |
404 receiver(), scratch2(), false, no_reg, reg, | 405 receiver(), scratch2(), false, no_reg, reg, |
405 it->GetAccessorIndex()); | 406 it->GetAccessorIndex()); |
406 } | 407 } |
407 } | 408 } |
408 } | 409 } |
409 | 410 |
410 | 411 |
411 Handle<Code> NamedLoadHandlerCompiler::CompileLoadViaGetter( | 412 Handle<Code> NamedLoadHandlerCompiler::CompileLoadViaGetter( |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 : kNoExtraICState); | 601 : kNoExtraICState); |
601 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); | 602 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); |
602 } | 603 } |
603 } | 604 } |
604 | 605 |
605 handlers->Add(cached_stub); | 606 handlers->Add(cached_stub); |
606 } | 607 } |
607 } | 608 } |
608 } // namespace internal | 609 } // namespace internal |
609 } // namespace v8 | 610 } // namespace v8 |
OLD | NEW |