OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 static void DecodeMinorKey(int minor_key, | 1073 static void DecodeMinorKey(int minor_key, |
1074 CompareIC::State* left_state, | 1074 CompareIC::State* left_state, |
1075 CompareIC::State* right_state, | 1075 CompareIC::State* right_state, |
1076 CompareIC::State* handler_state, | 1076 CompareIC::State* handler_state, |
1077 Token::Value* op); | 1077 Token::Value* op); |
1078 | 1078 |
1079 static CompareIC::State CompareState(int minor_key) { | 1079 static CompareIC::State CompareState(int minor_key) { |
1080 return static_cast<CompareIC::State>(HandlerStateField::decode(minor_key)); | 1080 return static_cast<CompareIC::State>(HandlerStateField::decode(minor_key)); |
1081 } | 1081 } |
1082 | 1082 |
| 1083 virtual InlineCacheState GetICState(); |
| 1084 |
1083 private: | 1085 private: |
1084 class OpField: public BitField<int, 0, 3> { }; | 1086 class OpField: public BitField<int, 0, 3> { }; |
1085 class LeftStateField: public BitField<int, 3, 4> { }; | 1087 class LeftStateField: public BitField<int, 3, 4> { }; |
1086 class RightStateField: public BitField<int, 7, 4> { }; | 1088 class RightStateField: public BitField<int, 7, 4> { }; |
1087 class HandlerStateField: public BitField<int, 11, 4> { }; | 1089 class HandlerStateField: public BitField<int, 11, 4> { }; |
1088 | 1090 |
1089 virtual void FinishCode(Handle<Code> code) { | 1091 virtual void FinishCode(Handle<Code> code) { |
1090 code->set_stub_info(MinorKey()); | 1092 code->set_stub_info(MinorKey()); |
1091 } | 1093 } |
1092 | 1094 |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 } | 2022 } |
2021 | 2023 |
2022 static Handle<Code> GetUninitialized(Isolate* isolate) { | 2024 static Handle<Code> GetUninitialized(Isolate* isolate) { |
2023 return ToBooleanStub(UNINITIALIZED).GetCode(isolate); | 2025 return ToBooleanStub(UNINITIALIZED).GetCode(isolate); |
2024 } | 2026 } |
2025 | 2027 |
2026 virtual Code::ExtraICState GetExtraICState() { | 2028 virtual Code::ExtraICState GetExtraICState() { |
2027 return types_.ToIntegral(); | 2029 return types_.ToIntegral(); |
2028 } | 2030 } |
2029 | 2031 |
| 2032 virtual InlineCacheState GetICState() { |
| 2033 if (types_.IsEmpty()) { |
| 2034 return ::v8::internal::UNINITIALIZED; |
| 2035 } else { |
| 2036 return MONOMORPHIC; |
| 2037 } |
| 2038 } |
2030 | 2039 |
2031 private: | 2040 private: |
2032 Major MajorKey() { return ToBoolean; } | 2041 Major MajorKey() { return ToBoolean; } |
2033 int NotMissMinorKey() { return GetExtraICState(); } | 2042 int NotMissMinorKey() { return GetExtraICState(); } |
2034 | 2043 |
2035 explicit ToBooleanStub(InitializationState init_state) : | 2044 explicit ToBooleanStub(InitializationState init_state) : |
2036 HydrogenCodeStub(init_state) {} | 2045 HydrogenCodeStub(init_state) {} |
2037 | 2046 |
2038 Types types_; | 2047 Types types_; |
2039 }; | 2048 }; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 | 2164 |
2156 // The current function entry hook. | 2165 // The current function entry hook. |
2157 static FunctionEntryHook entry_hook_; | 2166 static FunctionEntryHook entry_hook_; |
2158 | 2167 |
2159 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2168 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
2160 }; | 2169 }; |
2161 | 2170 |
2162 } } // namespace v8::internal | 2171 } } // namespace v8::internal |
2163 | 2172 |
2164 #endif // V8_CODE_STUBS_H_ | 2173 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |