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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 V(CallIC_Array) \ | 32 V(CallIC_Array) \ |
33 V(CEntry) \ | 33 V(CEntry) \ |
34 V(CompareIC) \ | 34 V(CompareIC) \ |
35 V(DoubleToI) \ | 35 V(DoubleToI) \ |
36 V(FunctionPrototype) \ | 36 V(FunctionPrototype) \ |
37 V(Instanceof) \ | 37 V(Instanceof) \ |
38 V(InternalArrayConstructor) \ | 38 V(InternalArrayConstructor) \ |
39 V(JSEntry) \ | 39 V(JSEntry) \ |
40 V(KeyedLoadICTrampoline) \ | 40 V(KeyedLoadICTrampoline) \ |
41 V(LoadICTrampoline) \ | 41 V(LoadICTrampoline) \ |
| 42 V(CallICTrampoline) \ |
| 43 V(CallIC_ArrayTrampoline) \ |
42 V(LoadIndexedInterceptor) \ | 44 V(LoadIndexedInterceptor) \ |
43 V(LoadIndexedString) \ | 45 V(LoadIndexedString) \ |
44 V(MathPow) \ | 46 V(MathPow) \ |
45 V(ProfileEntryHook) \ | 47 V(ProfileEntryHook) \ |
46 V(RecordWrite) \ | 48 V(RecordWrite) \ |
47 V(RegExpExec) \ | 49 V(RegExpExec) \ |
48 V(StoreArrayLiteralElement) \ | 50 V(StoreArrayLiteralElement) \ |
49 V(StoreBufferOverflow) \ | 51 V(StoreBufferOverflow) \ |
50 V(StoreElement) \ | 52 V(StoreElement) \ |
51 V(StringCompare) \ | 53 V(StringCompare) \ |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 CallICState state() const { | 824 CallICState state() const { |
823 return CallICState(static_cast<ExtraICState>(minor_key_)); | 825 return CallICState(static_cast<ExtraICState>(minor_key_)); |
824 } | 826 } |
825 | 827 |
826 // Code generation helpers. | 828 // Code generation helpers. |
827 void GenerateMiss(MacroAssembler* masm); | 829 void GenerateMiss(MacroAssembler* masm); |
828 | 830 |
829 private: | 831 private: |
830 void PrintState(std::ostream& os) const OVERRIDE; // NOLINT | 832 void PrintState(std::ostream& os) const OVERRIDE; // NOLINT |
831 | 833 |
832 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); | 834 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedbackAndVector); |
833 DEFINE_PLATFORM_CODE_STUB(CallIC, PlatformCodeStub); | 835 DEFINE_PLATFORM_CODE_STUB(CallIC, PlatformCodeStub); |
834 }; | 836 }; |
835 | 837 |
836 | 838 |
837 class CallIC_ArrayStub: public CallICStub { | 839 class CallIC_ArrayStub: public CallICStub { |
838 public: | 840 public: |
839 CallIC_ArrayStub(Isolate* isolate, const CallICState& state_in) | 841 CallIC_ArrayStub(Isolate* isolate, const CallICState& state_in) |
840 : CallICStub(isolate, state_in) {} | 842 : CallICStub(isolate, state_in) {} |
841 | 843 |
842 InlineCacheState GetICState() const FINAL { return MONOMORPHIC; } | 844 InlineCacheState GetICState() const FINAL { return MONOMORPHIC; } |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1931 public: | 1933 public: |
1932 explicit KeyedLoadICTrampolineStub(Isolate* isolate) | 1934 explicit KeyedLoadICTrampolineStub(Isolate* isolate) |
1933 : LoadICTrampolineStub(isolate, LoadICState(0)) {} | 1935 : LoadICTrampolineStub(isolate, LoadICState(0)) {} |
1934 | 1936 |
1935 Code::Kind GetCodeKind() const OVERRIDE { return Code::KEYED_LOAD_IC; } | 1937 Code::Kind GetCodeKind() const OVERRIDE { return Code::KEYED_LOAD_IC; } |
1936 | 1938 |
1937 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); | 1939 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); |
1938 }; | 1940 }; |
1939 | 1941 |
1940 | 1942 |
| 1943 class CallICTrampolineStub : public PlatformCodeStub { |
| 1944 public: |
| 1945 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
| 1946 : PlatformCodeStub(isolate) { |
| 1947 minor_key_ = state.GetExtraICState(); |
| 1948 } |
| 1949 |
| 1950 Code::Kind GetCodeKind() const OVERRIDE { return Code::CALL_IC; } |
| 1951 |
| 1952 InlineCacheState GetICState() const FINAL { return DEFAULT; } |
| 1953 |
| 1954 ExtraICState GetExtraICState() const FINAL { |
| 1955 return static_cast<ExtraICState>(minor_key_); |
| 1956 } |
| 1957 |
| 1958 protected: |
| 1959 CallICState state() const { |
| 1960 return CallICState(static_cast<ExtraICState>(minor_key_)); |
| 1961 } |
| 1962 |
| 1963 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); |
| 1964 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); |
| 1965 }; |
| 1966 |
| 1967 |
| 1968 class CallIC_ArrayTrampolineStub : public CallICTrampolineStub { |
| 1969 public: |
| 1970 CallIC_ArrayTrampolineStub(Isolate* isolate, const CallICState& state) |
| 1971 : CallICTrampolineStub(isolate, state) {} |
| 1972 |
| 1973 private: |
| 1974 DEFINE_PLATFORM_CODE_STUB(CallIC_ArrayTrampoline, CallICTrampolineStub); |
| 1975 }; |
| 1976 |
| 1977 |
1941 class MegamorphicLoadStub : public HydrogenCodeStub { | 1978 class MegamorphicLoadStub : public HydrogenCodeStub { |
1942 public: | 1979 public: |
1943 MegamorphicLoadStub(Isolate* isolate, const LoadICState& state) | 1980 MegamorphicLoadStub(Isolate* isolate, const LoadICState& state) |
1944 : HydrogenCodeStub(isolate) { | 1981 : HydrogenCodeStub(isolate) { |
1945 set_sub_minor_key(state.GetExtraICState()); | 1982 set_sub_minor_key(state.GetExtraICState()); |
1946 } | 1983 } |
1947 | 1984 |
1948 Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 1985 Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } |
1949 | 1986 |
1950 InlineCacheState GetICState() const FINAL { return MEGAMORPHIC; } | 1987 InlineCacheState GetICState() const FINAL { return MEGAMORPHIC; } |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2634 | 2671 |
2635 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2672 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2636 #undef DEFINE_PLATFORM_CODE_STUB | 2673 #undef DEFINE_PLATFORM_CODE_STUB |
2637 #undef DEFINE_HANDLER_CODE_STUB | 2674 #undef DEFINE_HANDLER_CODE_STUB |
2638 #undef DEFINE_HYDROGEN_CODE_STUB | 2675 #undef DEFINE_HYDROGEN_CODE_STUB |
2639 #undef DEFINE_CODE_STUB | 2676 #undef DEFINE_CODE_STUB |
2640 #undef DEFINE_CODE_STUB_BASE | 2677 #undef DEFINE_CODE_STUB_BASE |
2641 } } // namespace v8::internal | 2678 } } // namespace v8::internal |
2642 | 2679 |
2643 #endif // V8_CODE_STUBS_H_ | 2680 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |