OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/code-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
10 | 10 |
(...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2822 Word32And(code_flags, | 2822 Word32And(code_flags, |
2823 Int32Constant(~Code::kFlagsNotUsedInLookup))), | 2823 Int32Constant(~Code::kFlagsNotUsedInLookup))), |
2824 if_miss); | 2824 if_miss); |
2825 | 2825 |
2826 // We found the handler. | 2826 // We found the handler. |
2827 var_handler->Bind(code); | 2827 var_handler->Bind(code); |
2828 Goto(if_handler); | 2828 Goto(if_handler); |
2829 } | 2829 } |
2830 | 2830 |
2831 void CodeStubAssembler::TryProbeStubCache( | 2831 void CodeStubAssembler::TryProbeStubCache( |
2832 StubCache* stub_cache, Code::Flags flags, compiler::Node* receiver, | 2832 StubCache* stub_cache, compiler::Node* receiver, compiler::Node* name, |
2833 compiler::Node* name, Label* if_handler, Variable* var_handler, | 2833 Label* if_handler, Variable* var_handler, Label* if_miss) { |
2834 Label* if_miss) { | 2834 Code::Flags flags = Code::RemoveHolderFromFlags( |
| 2835 Code::ComputeHandlerFlags(stub_cache->ic_kind())); |
| 2836 |
2835 Label try_secondary(this), miss(this); | 2837 Label try_secondary(this), miss(this); |
2836 | 2838 |
2837 Counters* counters = isolate()->counters(); | 2839 Counters* counters = isolate()->counters(); |
2838 IncrementCounter(counters->megamorphic_stub_cache_probes(), 1); | 2840 IncrementCounter(counters->megamorphic_stub_cache_probes(), 1); |
2839 | 2841 |
2840 // Check that the {receiver} isn't a smi. | 2842 // Check that the {receiver} isn't a smi. |
2841 GotoIf(WordIsSmi(receiver), &miss); | 2843 GotoIf(WordIsSmi(receiver), &miss); |
2842 | 2844 |
2843 Node* receiver_map = LoadMap(receiver); | 2845 Node* receiver_map = LoadMap(receiver); |
2844 | 2846 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2892 &miss, 2); | 2894 &miss, 2); |
2893 } | 2895 } |
2894 | 2896 |
2895 Bind(&try_megamorphic); | 2897 Bind(&try_megamorphic); |
2896 { | 2898 { |
2897 // Check megamorphic case. | 2899 // Check megamorphic case. |
2898 GotoUnless( | 2900 GotoUnless( |
2899 WordEqual(feedback, LoadRoot(Heap::kmegamorphic_symbolRootIndex)), | 2901 WordEqual(feedback, LoadRoot(Heap::kmegamorphic_symbolRootIndex)), |
2900 &miss); | 2902 &miss); |
2901 | 2903 |
2902 Code::Flags code_flags = | 2904 TryProbeStubCache(isolate()->load_stub_cache(), p->receiver, p->name, |
2903 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); | |
2904 | |
2905 TryProbeStubCache(isolate()->stub_cache(), code_flags, p->receiver, p->name, | |
2906 &if_handler, &var_handler, &miss); | 2905 &if_handler, &var_handler, &miss); |
2907 } | 2906 } |
2908 Bind(&miss); | 2907 Bind(&miss); |
2909 { | 2908 { |
2910 TailCallRuntime(Runtime::kLoadIC_Miss, p->context, p->receiver, p->name, | 2909 TailCallRuntime(Runtime::kLoadIC_Miss, p->context, p->receiver, p->name, |
2911 p->slot, p->vector); | 2910 p->slot, p->vector); |
2912 } | 2911 } |
2913 } | 2912 } |
2914 | 2913 |
2915 void CodeStubAssembler::LoadGlobalIC(const LoadICParameters* p) { | 2914 void CodeStubAssembler::LoadGlobalIC(const LoadICParameters* p) { |
(...skipping 29 matching lines...) Expand all Loading... |
2945 } | 2944 } |
2946 Bind(&miss); | 2945 Bind(&miss); |
2947 { | 2946 { |
2948 TailCallRuntime(Runtime::kLoadGlobalIC_Miss, p->context, p->slot, | 2947 TailCallRuntime(Runtime::kLoadGlobalIC_Miss, p->context, p->slot, |
2949 p->vector); | 2948 p->vector); |
2950 } | 2949 } |
2951 } | 2950 } |
2952 | 2951 |
2953 } // namespace internal | 2952 } // namespace internal |
2954 } // namespace v8 | 2953 } // namespace v8 |
OLD | NEW |