| 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 <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/api-arguments-inl.h" | 10 #include "src/api-arguments-inl.h" |
| (...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2493 | 2493 |
| 2494 #undef TRACE_IC | 2494 #undef TRACE_IC |
| 2495 | 2495 |
| 2496 | 2496 |
| 2497 // ---------------------------------------------------------------------------- | 2497 // ---------------------------------------------------------------------------- |
| 2498 // Static IC stub generators. | 2498 // Static IC stub generators. |
| 2499 // | 2499 // |
| 2500 | 2500 |
| 2501 // Used from ic-<arch>.cc. | 2501 // Used from ic-<arch>.cc. |
| 2502 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { | 2502 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { |
| 2503 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2504 HandleScope scope(isolate); | 2503 HandleScope scope(isolate); |
| 2505 DCHECK_EQ(3, args.length()); | 2504 DCHECK_EQ(3, args.length()); |
| 2506 // Runtime functions don't follow the IC's calling convention. | 2505 // Runtime functions don't follow the IC's calling convention. |
| 2507 Handle<Object> function = args.at<Object>(0); | 2506 Handle<Object> function = args.at<Object>(0); |
| 2508 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); | 2507 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); |
| 2509 Handle<Smi> slot = args.at<Smi>(2); | 2508 Handle<Smi> slot = args.at<Smi>(2); |
| 2510 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2509 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2511 CallICNexus nexus(vector, vector_slot); | 2510 CallICNexus nexus(vector, vector_slot); |
| 2512 CallIC ic(isolate, &nexus); | 2511 CallIC ic(isolate, &nexus); |
| 2513 ic.HandleMiss(function); | 2512 ic.HandleMiss(function); |
| 2514 return *function; | 2513 return *function; |
| 2515 } | 2514 } |
| 2516 | 2515 |
| 2517 | 2516 |
| 2518 // Used from ic-<arch>.cc. | 2517 // Used from ic-<arch>.cc. |
| 2519 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { | 2518 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { |
| 2520 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2521 HandleScope scope(isolate); | 2519 HandleScope scope(isolate); |
| 2522 DCHECK_EQ(4, args.length()); | 2520 DCHECK_EQ(4, args.length()); |
| 2523 // Runtime functions don't follow the IC's calling convention. | 2521 // Runtime functions don't follow the IC's calling convention. |
| 2524 Handle<Object> receiver = args.at<Object>(0); | 2522 Handle<Object> receiver = args.at<Object>(0); |
| 2525 Handle<Smi> slot = args.at<Smi>(2); | 2523 Handle<Smi> slot = args.at<Smi>(2); |
| 2526 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2524 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
| 2527 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2525 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2528 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2526 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
| 2529 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 2527 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
| 2530 // set up outside the IC, handle that here. | 2528 // set up outside the IC, handle that here. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2550 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, kind); | 2548 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, kind); |
| 2551 KeyedLoadICNexus nexus(vector, vector_slot); | 2549 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2552 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2550 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2553 ic.UpdateState(receiver, key); | 2551 ic.UpdateState(receiver, key); |
| 2554 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2552 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2555 } | 2553 } |
| 2556 } | 2554 } |
| 2557 | 2555 |
| 2558 // Used from ic-<arch>.cc. | 2556 // Used from ic-<arch>.cc. |
| 2559 RUNTIME_FUNCTION(Runtime_LoadGlobalIC_Miss) { | 2557 RUNTIME_FUNCTION(Runtime_LoadGlobalIC_Miss) { |
| 2560 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2561 HandleScope scope(isolate); | 2558 HandleScope scope(isolate); |
| 2562 DCHECK_EQ(2, args.length()); | 2559 DCHECK_EQ(2, args.length()); |
| 2563 // Runtime functions don't follow the IC's calling convention. | 2560 // Runtime functions don't follow the IC's calling convention. |
| 2564 Handle<JSGlobalObject> global = isolate->global_object(); | 2561 Handle<JSGlobalObject> global = isolate->global_object(); |
| 2565 Handle<Smi> slot = args.at<Smi>(0); | 2562 Handle<Smi> slot = args.at<Smi>(0); |
| 2566 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); | 2563 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); |
| 2567 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2564 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2568 DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC, | 2565 DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC, |
| 2569 vector->GetKind(vector_slot)); | 2566 vector->GetKind(vector_slot)); |
| 2570 Handle<String> name(vector->GetName(vector_slot), isolate); | 2567 Handle<String> name(vector->GetName(vector_slot), isolate); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2622 if (ic.ShouldThrowReferenceError()) { | 2619 if (ic.ShouldThrowReferenceError()) { |
| 2623 THROW_NEW_ERROR_RETURN_FAILURE( | 2620 THROW_NEW_ERROR_RETURN_FAILURE( |
| 2624 isolate, NewReferenceError(MessageTemplate::kNotDefined, name)); | 2621 isolate, NewReferenceError(MessageTemplate::kNotDefined, name)); |
| 2625 } | 2622 } |
| 2626 } | 2623 } |
| 2627 return *result; | 2624 return *result; |
| 2628 } | 2625 } |
| 2629 | 2626 |
| 2630 // Used from ic-<arch>.cc | 2627 // Used from ic-<arch>.cc |
| 2631 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { | 2628 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { |
| 2632 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2633 HandleScope scope(isolate); | 2629 HandleScope scope(isolate); |
| 2634 DCHECK_EQ(4, args.length()); | 2630 DCHECK_EQ(4, args.length()); |
| 2635 // Runtime functions don't follow the IC's calling convention. | 2631 // Runtime functions don't follow the IC's calling convention. |
| 2636 Handle<Object> receiver = args.at<Object>(0); | 2632 Handle<Object> receiver = args.at<Object>(0); |
| 2637 Handle<Object> key = args.at<Object>(1); | 2633 Handle<Object> key = args.at<Object>(1); |
| 2638 Handle<Smi> slot = args.at<Smi>(2); | 2634 Handle<Smi> slot = args.at<Smi>(2); |
| 2639 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2635 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
| 2640 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2636 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2641 KeyedLoadICNexus nexus(vector, vector_slot); | 2637 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2642 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2638 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2643 ic.UpdateState(receiver, key); | 2639 ic.UpdateState(receiver, key); |
| 2644 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2640 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2645 } | 2641 } |
| 2646 | 2642 |
| 2647 | 2643 |
| 2648 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { | 2644 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { |
| 2649 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2650 HandleScope scope(isolate); | 2645 HandleScope scope(isolate); |
| 2651 typedef LoadWithVectorDescriptor Descriptor; | 2646 typedef LoadWithVectorDescriptor Descriptor; |
| 2652 DCHECK_EQ(Descriptor::kParameterCount, args.length()); | 2647 DCHECK_EQ(Descriptor::kParameterCount, args.length()); |
| 2653 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2648 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
| 2654 Handle<Object> key = args.at<Object>(Descriptor::kName); | 2649 Handle<Object> key = args.at<Object>(Descriptor::kName); |
| 2655 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2650 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
| 2656 Handle<TypeFeedbackVector> vector = | 2651 Handle<TypeFeedbackVector> vector = |
| 2657 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2652 args.at<TypeFeedbackVector>(Descriptor::kVector); |
| 2658 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2653 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2659 KeyedLoadICNexus nexus(vector, vector_slot); | 2654 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2660 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2655 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2661 ic.UpdateState(receiver, key); | 2656 ic.UpdateState(receiver, key); |
| 2662 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2657 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2663 } | 2658 } |
| 2664 | 2659 |
| 2665 | 2660 |
| 2666 // Used from ic-<arch>.cc. | 2661 // Used from ic-<arch>.cc. |
| 2667 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2662 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
| 2668 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2669 HandleScope scope(isolate); | 2663 HandleScope scope(isolate); |
| 2670 DCHECK_EQ(5, args.length()); | 2664 DCHECK_EQ(5, args.length()); |
| 2671 // Runtime functions don't follow the IC's calling convention. | 2665 // Runtime functions don't follow the IC's calling convention. |
| 2672 Handle<Object> value = args.at<Object>(0); | 2666 Handle<Object> value = args.at<Object>(0); |
| 2673 Handle<Smi> slot = args.at<Smi>(1); | 2667 Handle<Smi> slot = args.at<Smi>(1); |
| 2674 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); | 2668 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); |
| 2675 Handle<Object> receiver = args.at<Object>(3); | 2669 Handle<Object> receiver = args.at<Object>(3); |
| 2676 Handle<Name> key = args.at<Name>(4); | 2670 Handle<Name> key = args.at<Name>(4); |
| 2677 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2671 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2678 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2672 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
| 2679 StoreICNexus nexus(vector, vector_slot); | 2673 StoreICNexus nexus(vector, vector_slot); |
| 2680 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2674 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2681 ic.UpdateState(receiver, key); | 2675 ic.UpdateState(receiver, key); |
| 2682 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2676 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2683 } else { | 2677 } else { |
| 2684 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2678 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
| 2685 vector->GetKind(vector_slot)); | 2679 vector->GetKind(vector_slot)); |
| 2686 KeyedStoreICNexus nexus(vector, vector_slot); | 2680 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2687 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2681 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2688 ic.UpdateState(receiver, key); | 2682 ic.UpdateState(receiver, key); |
| 2689 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2683 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2690 } | 2684 } |
| 2691 } | 2685 } |
| 2692 | 2686 |
| 2693 | 2687 |
| 2694 // Used from ic-<arch>.cc. | 2688 // Used from ic-<arch>.cc. |
| 2695 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { | 2689 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { |
| 2696 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2697 HandleScope scope(isolate); | 2690 HandleScope scope(isolate); |
| 2698 DCHECK_EQ(5, args.length()); | 2691 DCHECK_EQ(5, args.length()); |
| 2699 // Runtime functions don't follow the IC's calling convention. | 2692 // Runtime functions don't follow the IC's calling convention. |
| 2700 Handle<Object> value = args.at<Object>(0); | 2693 Handle<Object> value = args.at<Object>(0); |
| 2701 Handle<Smi> slot = args.at<Smi>(1); | 2694 Handle<Smi> slot = args.at<Smi>(1); |
| 2702 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); | 2695 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); |
| 2703 Handle<Object> receiver = args.at<Object>(3); | 2696 Handle<Object> receiver = args.at<Object>(3); |
| 2704 Handle<Object> key = args.at<Object>(4); | 2697 Handle<Object> key = args.at<Object>(4); |
| 2705 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2698 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2706 KeyedStoreICNexus nexus(vector, vector_slot); | 2699 KeyedStoreICNexus nexus(vector, vector_slot); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2722 KeyedStoreICNexus nexus(isolate); | 2715 KeyedStoreICNexus nexus(isolate); |
| 2723 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2716 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2724 language_mode = ic.language_mode(); | 2717 language_mode = ic.language_mode(); |
| 2725 RETURN_RESULT_OR_FAILURE( | 2718 RETURN_RESULT_OR_FAILURE( |
| 2726 isolate, | 2719 isolate, |
| 2727 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2720 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
| 2728 } | 2721 } |
| 2729 | 2722 |
| 2730 | 2723 |
| 2731 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { | 2724 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { |
| 2732 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2733 HandleScope scope(isolate); | 2725 HandleScope scope(isolate); |
| 2734 // Runtime functions don't follow the IC's calling convention. | 2726 // Runtime functions don't follow the IC's calling convention. |
| 2735 Handle<Object> object = args.at<Object>(0); | 2727 Handle<Object> object = args.at<Object>(0); |
| 2736 Handle<Object> key = args.at<Object>(1); | 2728 Handle<Object> key = args.at<Object>(1); |
| 2737 Handle<Object> value = args.at<Object>(2); | 2729 Handle<Object> value = args.at<Object>(2); |
| 2738 Handle<Map> map = args.at<Map>(3); | 2730 Handle<Map> map = args.at<Map>(3); |
| 2739 LanguageMode language_mode; | 2731 LanguageMode language_mode; |
| 2740 KeyedStoreICNexus nexus(isolate); | 2732 KeyedStoreICNexus nexus(isolate); |
| 2741 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2733 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2742 language_mode = ic.language_mode(); | 2734 language_mode = ic.language_mode(); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2861 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); | 2853 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); |
| 2862 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { | 2854 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { |
| 2863 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); | 2855 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); |
| 2864 } | 2856 } |
| 2865 | 2857 |
| 2866 return result; | 2858 return result; |
| 2867 } | 2859 } |
| 2868 | 2860 |
| 2869 | 2861 |
| 2870 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { | 2862 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { |
| 2871 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2872 HandleScope scope(isolate); | 2863 HandleScope scope(isolate); |
| 2873 DCHECK_EQ(2, args.length()); | 2864 DCHECK_EQ(2, args.length()); |
| 2874 typedef BinaryOpDescriptor Descriptor; | 2865 typedef BinaryOpDescriptor Descriptor; |
| 2875 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2866 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
| 2876 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2867 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
| 2877 BinaryOpIC ic(isolate); | 2868 BinaryOpIC ic(isolate); |
| 2878 RETURN_RESULT_OR_FAILURE( | 2869 RETURN_RESULT_OR_FAILURE( |
| 2879 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2870 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); |
| 2880 } | 2871 } |
| 2881 | 2872 |
| 2882 | 2873 |
| 2883 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { | 2874 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { |
| 2884 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2885 HandleScope scope(isolate); | 2875 HandleScope scope(isolate); |
| 2886 DCHECK_EQ(3, args.length()); | 2876 DCHECK_EQ(3, args.length()); |
| 2887 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; | 2877 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; |
| 2888 Handle<AllocationSite> allocation_site = | 2878 Handle<AllocationSite> allocation_site = |
| 2889 args.at<AllocationSite>(Descriptor::kAllocationSite); | 2879 args.at<AllocationSite>(Descriptor::kAllocationSite); |
| 2890 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2880 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
| 2891 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2881 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
| 2892 BinaryOpIC ic(isolate); | 2882 BinaryOpIC ic(isolate); |
| 2893 RETURN_RESULT_OR_FAILURE(isolate, | 2883 RETURN_RESULT_OR_FAILURE(isolate, |
| 2894 ic.Transition(allocation_site, left, right)); | 2884 ic.Transition(allocation_site, left, right)); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2938 if (old_stub.state() == CompareICState::UNINITIALIZED) { | 2928 if (old_stub.state() == CompareICState::UNINITIALIZED) { |
| 2939 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); | 2929 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); |
| 2940 } | 2930 } |
| 2941 | 2931 |
| 2942 return *new_target; | 2932 return *new_target; |
| 2943 } | 2933 } |
| 2944 | 2934 |
| 2945 | 2935 |
| 2946 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. | 2936 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. |
| 2947 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { | 2937 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { |
| 2948 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2949 HandleScope scope(isolate); | 2938 HandleScope scope(isolate); |
| 2950 DCHECK(args.length() == 3); | 2939 DCHECK(args.length() == 3); |
| 2951 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 2940 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
| 2952 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 2941 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); |
| 2953 } | 2942 } |
| 2954 | 2943 |
| 2955 | 2944 |
| 2956 RUNTIME_FUNCTION(Runtime_Unreachable) { | 2945 RUNTIME_FUNCTION(Runtime_Unreachable) { |
| 2957 UNREACHABLE(); | 2946 UNREACHABLE(); |
| 2958 CHECK(false); | 2947 CHECK(false); |
| 2959 return isolate->heap()->undefined_value(); | 2948 return isolate->heap()->undefined_value(); |
| 2960 } | 2949 } |
| 2961 | 2950 |
| 2962 | 2951 |
| 2963 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 2952 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
| 2964 ToBooleanICStub stub(isolate(), extra_ic_state()); | 2953 ToBooleanICStub stub(isolate(), extra_ic_state()); |
| 2965 bool to_boolean_value = stub.UpdateStatus(object); | 2954 bool to_boolean_value = stub.UpdateStatus(object); |
| 2966 Handle<Code> code = stub.GetCode(); | 2955 Handle<Code> code = stub.GetCode(); |
| 2967 set_target(*code); | 2956 set_target(*code); |
| 2968 return isolate()->factory()->ToBoolean(to_boolean_value); | 2957 return isolate()->factory()->ToBoolean(to_boolean_value); |
| 2969 } | 2958 } |
| 2970 | 2959 |
| 2971 | 2960 |
| 2972 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { | 2961 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { |
| 2973 TimerEventScope<TimerEventIcMiss> timer(isolate); | |
| 2974 DCHECK(args.length() == 1); | 2962 DCHECK(args.length() == 1); |
| 2975 HandleScope scope(isolate); | 2963 HandleScope scope(isolate); |
| 2976 Handle<Object> object = args.at<Object>(0); | 2964 Handle<Object> object = args.at<Object>(0); |
| 2977 ToBooleanIC ic(isolate); | 2965 ToBooleanIC ic(isolate); |
| 2978 return *ic.ToBoolean(object); | 2966 return *ic.ToBoolean(object); |
| 2979 } | 2967 } |
| 2980 | 2968 |
| 2981 | 2969 |
| 2982 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { | 2970 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { |
| 2983 Handle<JSObject> receiver = args.at<JSObject>(0); | 2971 Handle<JSObject> receiver = args.at<JSObject>(0); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3172 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); | 3160 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); |
| 3173 it.Next(); | 3161 it.Next(); |
| 3174 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 3162 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 3175 Object::GetProperty(&it)); | 3163 Object::GetProperty(&it)); |
| 3176 } | 3164 } |
| 3177 | 3165 |
| 3178 return *result; | 3166 return *result; |
| 3179 } | 3167 } |
| 3180 } // namespace internal | 3168 } // namespace internal |
| 3181 } // namespace v8 | 3169 } // namespace v8 |
| OLD | NEW |