| 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 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2571 | 2571 |
| 2572 // ---------------------------------------------------------------------------- | 2572 // ---------------------------------------------------------------------------- |
| 2573 // Static IC stub generators. | 2573 // Static IC stub generators. |
| 2574 // | 2574 // |
| 2575 | 2575 |
| 2576 // Used from ic-<arch>.cc. | 2576 // Used from ic-<arch>.cc. |
| 2577 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { | 2577 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { |
| 2578 HandleScope scope(isolate); | 2578 HandleScope scope(isolate); |
| 2579 DCHECK_EQ(3, args.length()); | 2579 DCHECK_EQ(3, args.length()); |
| 2580 // Runtime functions don't follow the IC's calling convention. | 2580 // Runtime functions don't follow the IC's calling convention. |
| 2581 Handle<Object> function = args.at<Object>(0); | 2581 Handle<Object> function = args.at(0); |
| 2582 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); | 2582 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); |
| 2583 Handle<Smi> slot = args.at<Smi>(2); | 2583 Handle<Smi> slot = args.at<Smi>(2); |
| 2584 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2584 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2585 CallICNexus nexus(vector, vector_slot); | 2585 CallICNexus nexus(vector, vector_slot); |
| 2586 CallIC ic(isolate, &nexus); | 2586 CallIC ic(isolate, &nexus); |
| 2587 ic.HandleMiss(function); | 2587 ic.HandleMiss(function); |
| 2588 return *function; | 2588 return *function; |
| 2589 } | 2589 } |
| 2590 | 2590 |
| 2591 | 2591 |
| 2592 // Used from ic-<arch>.cc. | 2592 // Used from ic-<arch>.cc. |
| 2593 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { | 2593 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { |
| 2594 HandleScope scope(isolate); | 2594 HandleScope scope(isolate); |
| 2595 DCHECK_EQ(4, args.length()); | 2595 DCHECK_EQ(4, args.length()); |
| 2596 // Runtime functions don't follow the IC's calling convention. | 2596 // Runtime functions don't follow the IC's calling convention. |
| 2597 Handle<Object> receiver = args.at<Object>(0); | 2597 Handle<Object> receiver = args.at(0); |
| 2598 Handle<Name> key = args.at<Name>(1); | 2598 Handle<Name> key = args.at<Name>(1); |
| 2599 Handle<Smi> slot = args.at<Smi>(2); | 2599 Handle<Smi> slot = args.at<Smi>(2); |
| 2600 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2600 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
| 2601 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2601 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2602 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2602 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
| 2603 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 2603 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
| 2604 // set up outside the IC, handle that here. | 2604 // set up outside the IC, handle that here. |
| 2605 FeedbackVectorSlotKind kind = vector->GetKind(vector_slot); | 2605 FeedbackVectorSlotKind kind = vector->GetKind(vector_slot); |
| 2606 if (kind == FeedbackVectorSlotKind::LOAD_IC) { | 2606 if (kind == FeedbackVectorSlotKind::LOAD_IC) { |
| 2607 LoadICNexus nexus(vector, vector_slot); | 2607 LoadICNexus nexus(vector, vector_slot); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 } | 2684 } |
| 2685 } | 2685 } |
| 2686 return *result; | 2686 return *result; |
| 2687 } | 2687 } |
| 2688 | 2688 |
| 2689 // Used from ic-<arch>.cc | 2689 // Used from ic-<arch>.cc |
| 2690 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { | 2690 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { |
| 2691 HandleScope scope(isolate); | 2691 HandleScope scope(isolate); |
| 2692 DCHECK_EQ(4, args.length()); | 2692 DCHECK_EQ(4, args.length()); |
| 2693 // Runtime functions don't follow the IC's calling convention. | 2693 // Runtime functions don't follow the IC's calling convention. |
| 2694 Handle<Object> receiver = args.at<Object>(0); | 2694 Handle<Object> receiver = args.at(0); |
| 2695 Handle<Object> key = args.at<Object>(1); | 2695 Handle<Object> key = args.at(1); |
| 2696 Handle<Smi> slot = args.at<Smi>(2); | 2696 Handle<Smi> slot = args.at<Smi>(2); |
| 2697 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2697 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
| 2698 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2698 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2699 KeyedLoadICNexus nexus(vector, vector_slot); | 2699 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2700 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2700 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2701 ic.UpdateState(receiver, key); | 2701 ic.UpdateState(receiver, key); |
| 2702 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2702 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2703 } | 2703 } |
| 2704 | 2704 |
| 2705 | 2705 |
| 2706 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { | 2706 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { |
| 2707 HandleScope scope(isolate); | 2707 HandleScope scope(isolate); |
| 2708 typedef LoadWithVectorDescriptor Descriptor; | 2708 typedef LoadWithVectorDescriptor Descriptor; |
| 2709 DCHECK_EQ(Descriptor::kParameterCount, args.length()); | 2709 DCHECK_EQ(Descriptor::kParameterCount, args.length()); |
| 2710 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2710 Handle<Object> receiver = args.at(Descriptor::kReceiver); |
| 2711 Handle<Object> key = args.at<Object>(Descriptor::kName); | 2711 Handle<Object> key = args.at(Descriptor::kName); |
| 2712 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2712 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
| 2713 Handle<TypeFeedbackVector> vector = | 2713 Handle<TypeFeedbackVector> vector = |
| 2714 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2714 args.at<TypeFeedbackVector>(Descriptor::kVector); |
| 2715 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2715 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2716 KeyedLoadICNexus nexus(vector, vector_slot); | 2716 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2717 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2717 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2718 ic.UpdateState(receiver, key); | 2718 ic.UpdateState(receiver, key); |
| 2719 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2719 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2720 } | 2720 } |
| 2721 | 2721 |
| 2722 | 2722 |
| 2723 // Used from ic-<arch>.cc. | 2723 // Used from ic-<arch>.cc. |
| 2724 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2724 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
| 2725 HandleScope scope(isolate); | 2725 HandleScope scope(isolate); |
| 2726 DCHECK_EQ(5, args.length()); | 2726 DCHECK_EQ(5, args.length()); |
| 2727 // Runtime functions don't follow the IC's calling convention. | 2727 // Runtime functions don't follow the IC's calling convention. |
| 2728 Handle<Object> value = args.at<Object>(0); | 2728 Handle<Object> value = args.at(0); |
| 2729 Handle<Smi> slot = args.at<Smi>(1); | 2729 Handle<Smi> slot = args.at<Smi>(1); |
| 2730 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); | 2730 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); |
| 2731 Handle<Object> receiver = args.at<Object>(3); | 2731 Handle<Object> receiver = args.at(3); |
| 2732 Handle<Name> key = args.at<Name>(4); | 2732 Handle<Name> key = args.at<Name>(4); |
| 2733 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2733 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2734 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2734 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
| 2735 StoreICNexus nexus(vector, vector_slot); | 2735 StoreICNexus nexus(vector, vector_slot); |
| 2736 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2736 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2737 ic.UpdateState(receiver, key); | 2737 ic.UpdateState(receiver, key); |
| 2738 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2738 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2739 } else { | 2739 } else { |
| 2740 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2740 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
| 2741 vector->GetKind(vector_slot)); | 2741 vector->GetKind(vector_slot)); |
| 2742 KeyedStoreICNexus nexus(vector, vector_slot); | 2742 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2743 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2743 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2744 ic.UpdateState(receiver, key); | 2744 ic.UpdateState(receiver, key); |
| 2745 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2745 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2746 } | 2746 } |
| 2747 } | 2747 } |
| 2748 | 2748 |
| 2749 | 2749 |
| 2750 // Used from ic-<arch>.cc. | 2750 // Used from ic-<arch>.cc. |
| 2751 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { | 2751 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { |
| 2752 HandleScope scope(isolate); | 2752 HandleScope scope(isolate); |
| 2753 DCHECK_EQ(5, args.length()); | 2753 DCHECK_EQ(5, args.length()); |
| 2754 // Runtime functions don't follow the IC's calling convention. | 2754 // Runtime functions don't follow the IC's calling convention. |
| 2755 Handle<Object> value = args.at<Object>(0); | 2755 Handle<Object> value = args.at(0); |
| 2756 Handle<Smi> slot = args.at<Smi>(1); | 2756 Handle<Smi> slot = args.at<Smi>(1); |
| 2757 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); | 2757 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); |
| 2758 Handle<Object> receiver = args.at<Object>(3); | 2758 Handle<Object> receiver = args.at(3); |
| 2759 Handle<Object> key = args.at<Object>(4); | 2759 Handle<Object> key = args.at(4); |
| 2760 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2760 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2761 KeyedStoreICNexus nexus(vector, vector_slot); | 2761 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2762 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2762 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2763 ic.UpdateState(receiver, key); | 2763 ic.UpdateState(receiver, key); |
| 2764 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2764 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2765 } | 2765 } |
| 2766 | 2766 |
| 2767 | 2767 |
| 2768 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { | 2768 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { |
| 2769 HandleScope scope(isolate); | 2769 HandleScope scope(isolate); |
| 2770 DCHECK_EQ(5, args.length()); | 2770 DCHECK_EQ(5, args.length()); |
| 2771 // Runtime functions don't follow the IC's calling convention. | 2771 // Runtime functions don't follow the IC's calling convention. |
| 2772 Handle<Object> value = args.at<Object>(0); | 2772 Handle<Object> value = args.at(0); |
| 2773 // slot and vector parameters are not used. | 2773 // slot and vector parameters are not used. |
| 2774 Handle<Object> object = args.at<Object>(3); | 2774 Handle<Object> object = args.at(3); |
| 2775 Handle<Object> key = args.at<Object>(4); | 2775 Handle<Object> key = args.at(4); |
| 2776 LanguageMode language_mode; | 2776 LanguageMode language_mode; |
| 2777 KeyedStoreICNexus nexus(isolate); | 2777 KeyedStoreICNexus nexus(isolate); |
| 2778 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2778 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2779 language_mode = ic.language_mode(); | 2779 language_mode = ic.language_mode(); |
| 2780 RETURN_RESULT_OR_FAILURE( | 2780 RETURN_RESULT_OR_FAILURE( |
| 2781 isolate, | 2781 isolate, |
| 2782 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2782 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
| 2783 } | 2783 } |
| 2784 | 2784 |
| 2785 | 2785 |
| 2786 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { | 2786 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { |
| 2787 HandleScope scope(isolate); | 2787 HandleScope scope(isolate); |
| 2788 // Runtime functions don't follow the IC's calling convention. | 2788 // Runtime functions don't follow the IC's calling convention. |
| 2789 Handle<Object> object = args.at<Object>(0); | 2789 Handle<Object> object = args.at(0); |
| 2790 Handle<Object> key = args.at<Object>(1); | 2790 Handle<Object> key = args.at(1); |
| 2791 Handle<Object> value = args.at<Object>(2); | 2791 Handle<Object> value = args.at(2); |
| 2792 Handle<Map> map = args.at<Map>(3); | 2792 Handle<Map> map = args.at<Map>(3); |
| 2793 LanguageMode language_mode; | 2793 LanguageMode language_mode; |
| 2794 KeyedStoreICNexus nexus(isolate); | 2794 KeyedStoreICNexus nexus(isolate); |
| 2795 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2795 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2796 language_mode = ic.language_mode(); | 2796 language_mode = ic.language_mode(); |
| 2797 if (object->IsJSObject()) { | 2797 if (object->IsJSObject()) { |
| 2798 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), | 2798 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), |
| 2799 map->elements_kind()); | 2799 map->elements_kind()); |
| 2800 } | 2800 } |
| 2801 RETURN_RESULT_OR_FAILURE( | 2801 RETURN_RESULT_OR_FAILURE( |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2918 } | 2918 } |
| 2919 | 2919 |
| 2920 return result; | 2920 return result; |
| 2921 } | 2921 } |
| 2922 | 2922 |
| 2923 | 2923 |
| 2924 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { | 2924 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { |
| 2925 HandleScope scope(isolate); | 2925 HandleScope scope(isolate); |
| 2926 DCHECK_EQ(2, args.length()); | 2926 DCHECK_EQ(2, args.length()); |
| 2927 typedef BinaryOpDescriptor Descriptor; | 2927 typedef BinaryOpDescriptor Descriptor; |
| 2928 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2928 Handle<Object> left = args.at(Descriptor::kLeft); |
| 2929 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2929 Handle<Object> right = args.at(Descriptor::kRight); |
| 2930 BinaryOpIC ic(isolate); | 2930 BinaryOpIC ic(isolate); |
| 2931 RETURN_RESULT_OR_FAILURE( | 2931 RETURN_RESULT_OR_FAILURE( |
| 2932 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2932 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); |
| 2933 } | 2933 } |
| 2934 | 2934 |
| 2935 | 2935 |
| 2936 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { | 2936 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { |
| 2937 HandleScope scope(isolate); | 2937 HandleScope scope(isolate); |
| 2938 DCHECK_EQ(3, args.length()); | 2938 DCHECK_EQ(3, args.length()); |
| 2939 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; | 2939 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; |
| 2940 Handle<AllocationSite> allocation_site = | 2940 Handle<AllocationSite> allocation_site = |
| 2941 args.at<AllocationSite>(Descriptor::kAllocationSite); | 2941 args.at<AllocationSite>(Descriptor::kAllocationSite); |
| 2942 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2942 Handle<Object> left = args.at(Descriptor::kLeft); |
| 2943 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2943 Handle<Object> right = args.at(Descriptor::kRight); |
| 2944 BinaryOpIC ic(isolate); | 2944 BinaryOpIC ic(isolate); |
| 2945 RETURN_RESULT_OR_FAILURE(isolate, | 2945 RETURN_RESULT_OR_FAILURE(isolate, |
| 2946 ic.Transition(allocation_site, left, right)); | 2946 ic.Transition(allocation_site, left, right)); |
| 2947 } | 2947 } |
| 2948 | 2948 |
| 2949 Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op) { | 2949 Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op) { |
| 2950 CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED, | 2950 CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED, |
| 2951 CompareICState::UNINITIALIZED, | 2951 CompareICState::UNINITIALIZED, |
| 2952 CompareICState::UNINITIALIZED); | 2952 CompareICState::UNINITIALIZED); |
| 2953 Code* code = NULL; | 2953 Code* code = NULL; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2993 | 2993 |
| 2994 return *new_target; | 2994 return *new_target; |
| 2995 } | 2995 } |
| 2996 | 2996 |
| 2997 | 2997 |
| 2998 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. | 2998 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. |
| 2999 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { | 2999 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { |
| 3000 HandleScope scope(isolate); | 3000 HandleScope scope(isolate); |
| 3001 DCHECK(args.length() == 3); | 3001 DCHECK(args.length() == 3); |
| 3002 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 3002 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
| 3003 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 3003 return ic.UpdateCaches(args.at(0), args.at(1)); |
| 3004 } | 3004 } |
| 3005 | 3005 |
| 3006 | 3006 |
| 3007 RUNTIME_FUNCTION(Runtime_Unreachable) { | 3007 RUNTIME_FUNCTION(Runtime_Unreachable) { |
| 3008 UNREACHABLE(); | 3008 UNREACHABLE(); |
| 3009 CHECK(false); | 3009 CHECK(false); |
| 3010 return isolate->heap()->undefined_value(); | 3010 return isolate->heap()->undefined_value(); |
| 3011 } | 3011 } |
| 3012 | 3012 |
| 3013 | 3013 |
| 3014 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 3014 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
| 3015 ToBooleanICStub stub(isolate(), extra_ic_state()); | 3015 ToBooleanICStub stub(isolate(), extra_ic_state()); |
| 3016 bool to_boolean_value = stub.UpdateStatus(object); | 3016 bool to_boolean_value = stub.UpdateStatus(object); |
| 3017 Handle<Code> code = stub.GetCode(); | 3017 Handle<Code> code = stub.GetCode(); |
| 3018 set_target(*code); | 3018 set_target(*code); |
| 3019 return isolate()->factory()->ToBoolean(to_boolean_value); | 3019 return isolate()->factory()->ToBoolean(to_boolean_value); |
| 3020 } | 3020 } |
| 3021 | 3021 |
| 3022 | 3022 |
| 3023 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { | 3023 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { |
| 3024 DCHECK(args.length() == 1); | 3024 DCHECK(args.length() == 1); |
| 3025 HandleScope scope(isolate); | 3025 HandleScope scope(isolate); |
| 3026 Handle<Object> object = args.at<Object>(0); | 3026 Handle<Object> object = args.at(0); |
| 3027 ToBooleanIC ic(isolate); | 3027 ToBooleanIC ic(isolate); |
| 3028 return *ic.ToBoolean(object); | 3028 return *ic.ToBoolean(object); |
| 3029 } | 3029 } |
| 3030 | 3030 |
| 3031 | 3031 |
| 3032 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { | 3032 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { |
| 3033 Handle<JSObject> receiver = args.at<JSObject>(0); | 3033 Handle<JSObject> receiver = args.at<JSObject>(0); |
| 3034 Handle<JSObject> holder = args.at<JSObject>(1); | 3034 Handle<JSObject> holder = args.at<JSObject>(1); |
| 3035 Handle<HeapObject> callback_or_cell = args.at<HeapObject>(2); | 3035 Handle<HeapObject> callback_or_cell = args.at<HeapObject>(2); |
| 3036 Handle<Name> name = args.at<Name>(3); | 3036 Handle<Name> name = args.at<Name>(3); |
| 3037 Handle<Object> value = args.at<Object>(4); | 3037 Handle<Object> value = args.at(4); |
| 3038 CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 5); | 3038 CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 5); |
| 3039 HandleScope scope(isolate); | 3039 HandleScope scope(isolate); |
| 3040 | 3040 |
| 3041 if (V8_UNLIKELY(FLAG_runtime_stats)) { | 3041 if (V8_UNLIKELY(FLAG_runtime_stats)) { |
| 3042 RETURN_RESULT_OR_FAILURE( | 3042 RETURN_RESULT_OR_FAILURE( |
| 3043 isolate, Runtime::SetObjectProperty(isolate, receiver, name, value, | 3043 isolate, Runtime::SetObjectProperty(isolate, receiver, name, value, |
| 3044 language_mode)); | 3044 language_mode)); |
| 3045 } | 3045 } |
| 3046 | 3046 |
| 3047 Handle<AccessorInfo> callback( | 3047 Handle<AccessorInfo> callback( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 3071 * but doesn't search the prototype chain. | 3071 * but doesn't search the prototype chain. |
| 3072 * | 3072 * |
| 3073 * Returns |Heap::no_interceptor_result_sentinel()| if interceptor doesn't | 3073 * Returns |Heap::no_interceptor_result_sentinel()| if interceptor doesn't |
| 3074 * provide any value for the given name. | 3074 * provide any value for the given name. |
| 3075 */ | 3075 */ |
| 3076 RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptorOnly) { | 3076 RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptorOnly) { |
| 3077 DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength); | 3077 DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength); |
| 3078 Handle<Name> name = | 3078 Handle<Name> name = |
| 3079 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); | 3079 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); |
| 3080 Handle<Object> receiver = | 3080 Handle<Object> receiver = |
| 3081 args.at<Object>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); | 3081 args.at(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); |
| 3082 Handle<JSObject> holder = | 3082 Handle<JSObject> holder = |
| 3083 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); | 3083 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); |
| 3084 HandleScope scope(isolate); | 3084 HandleScope scope(isolate); |
| 3085 | 3085 |
| 3086 if (!receiver->IsJSReceiver()) { | 3086 if (!receiver->IsJSReceiver()) { |
| 3087 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 3087 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 3088 isolate, receiver, Object::ConvertReceiver(isolate, receiver)); | 3088 isolate, receiver, Object::ConvertReceiver(isolate, receiver)); |
| 3089 } | 3089 } |
| 3090 | 3090 |
| 3091 InterceptorInfo* interceptor = holder->GetNamedInterceptor(); | 3091 InterceptorInfo* interceptor = holder->GetNamedInterceptor(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3107 /** | 3107 /** |
| 3108 * Loads a property with an interceptor performing post interceptor | 3108 * Loads a property with an interceptor performing post interceptor |
| 3109 * lookup if interceptor failed. | 3109 * lookup if interceptor failed. |
| 3110 */ | 3110 */ |
| 3111 RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptor) { | 3111 RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptor) { |
| 3112 HandleScope scope(isolate); | 3112 HandleScope scope(isolate); |
| 3113 DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength); | 3113 DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength); |
| 3114 Handle<Name> name = | 3114 Handle<Name> name = |
| 3115 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); | 3115 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); |
| 3116 Handle<Object> receiver = | 3116 Handle<Object> receiver = |
| 3117 args.at<Object>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); | 3117 args.at(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); |
| 3118 Handle<JSObject> holder = | 3118 Handle<JSObject> holder = |
| 3119 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); | 3119 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); |
| 3120 | 3120 |
| 3121 if (!receiver->IsJSReceiver()) { | 3121 if (!receiver->IsJSReceiver()) { |
| 3122 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 3122 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 3123 isolate, receiver, Object::ConvertReceiver(isolate, receiver)); | 3123 isolate, receiver, Object::ConvertReceiver(isolate, receiver)); |
| 3124 } | 3124 } |
| 3125 | 3125 |
| 3126 InterceptorInfo* interceptor = holder->GetNamedInterceptor(); | 3126 InterceptorInfo* interceptor = holder->GetNamedInterceptor(); |
| 3127 PropertyCallbackArguments arguments(isolate, interceptor->data(), *receiver, | 3127 PropertyCallbackArguments arguments(isolate, interceptor->data(), *receiver, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3163 } | 3163 } |
| 3164 | 3164 |
| 3165 | 3165 |
| 3166 RUNTIME_FUNCTION(Runtime_StorePropertyWithInterceptor) { | 3166 RUNTIME_FUNCTION(Runtime_StorePropertyWithInterceptor) { |
| 3167 HandleScope scope(isolate); | 3167 HandleScope scope(isolate); |
| 3168 DCHECK(args.length() == 3); | 3168 DCHECK(args.length() == 3); |
| 3169 StoreICNexus nexus(isolate); | 3169 StoreICNexus nexus(isolate); |
| 3170 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 3170 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 3171 Handle<JSObject> receiver = args.at<JSObject>(0); | 3171 Handle<JSObject> receiver = args.at<JSObject>(0); |
| 3172 Handle<Name> name = args.at<Name>(1); | 3172 Handle<Name> name = args.at<Name>(1); |
| 3173 Handle<Object> value = args.at<Object>(2); | 3173 Handle<Object> value = args.at(2); |
| 3174 | 3174 |
| 3175 DCHECK(receiver->HasNamedInterceptor()); | 3175 DCHECK(receiver->HasNamedInterceptor()); |
| 3176 InterceptorInfo* interceptor = receiver->GetNamedInterceptor(); | 3176 InterceptorInfo* interceptor = receiver->GetNamedInterceptor(); |
| 3177 DCHECK(!interceptor->non_masking()); | 3177 DCHECK(!interceptor->non_masking()); |
| 3178 PropertyCallbackArguments arguments(isolate, interceptor->data(), *receiver, | 3178 PropertyCallbackArguments arguments(isolate, interceptor->data(), *receiver, |
| 3179 *receiver, Object::DONT_THROW); | 3179 *receiver, Object::DONT_THROW); |
| 3180 | 3180 |
| 3181 v8::GenericNamedPropertySetterCallback setter = | 3181 v8::GenericNamedPropertySetterCallback setter = |
| 3182 v8::ToCData<v8::GenericNamedPropertySetterCallback>( | 3182 v8::ToCData<v8::GenericNamedPropertySetterCallback>( |
| 3183 interceptor->setter()); | 3183 interceptor->setter()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3224 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); | 3224 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); |
| 3225 it.Next(); | 3225 it.Next(); |
| 3226 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 3226 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 3227 Object::GetProperty(&it)); | 3227 Object::GetProperty(&it)); |
| 3228 } | 3228 } |
| 3229 | 3229 |
| 3230 return *result; | 3230 return *result; |
| 3231 } | 3231 } |
| 3232 } // namespace internal | 3232 } // namespace internal |
| 3233 } // namespace v8 | 3233 } // namespace v8 |
| OLD | NEW |