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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 static typename T::TypeHandle MapToType(Handle<Map> map, | 143 static typename T::TypeHandle MapToType(Handle<Map> map, |
144 typename T::Region* region); | 144 typename T::Region* region); |
145 | 145 |
146 static Handle<HeapType> CurrentTypeOf(Handle<Object> object, | 146 static Handle<HeapType> CurrentTypeOf(Handle<Object> object, |
147 Isolate* isolate); | 147 Isolate* isolate); |
148 | 148 |
149 protected: | 149 protected: |
150 // Get the call-site target; used for determining the state. | 150 // Get the call-site target; used for determining the state. |
151 Handle<Code> target() const { return target_; } | 151 Handle<Code> target() const { return target_; } |
152 | 152 |
| 153 TypeHandleList* types() { return &types_; } |
| 154 CodeHandleList* handlers() { return &handlers_; } |
| 155 Map* first_map() { |
| 156 return types_.length() == 0 ? NULL : *TypeToMap(*types_.at(0), isolate_); |
| 157 } |
| 158 Code* first_handler() { |
| 159 return handlers_.length() == 0 ? NULL : *handlers_.at(0); |
| 160 } |
| 161 void GetMapsFromTypes(MapHandleList* maps) { |
| 162 for (int i = 0; i < types_.length(); ++i) { |
| 163 maps->Add(TypeToMap(*types_.at(i), isolate_)); |
| 164 } |
| 165 } |
153 Address fp() const { return fp_; } | 166 Address fp() const { return fp_; } |
154 Address pc() const { return *pc_address_; } | 167 Address pc() const { return *pc_address_; } |
155 Isolate* isolate() const { return isolate_; } | 168 Isolate* isolate() const { return isolate_; } |
156 | 169 |
157 #ifdef ENABLE_DEBUGGER_SUPPORT | 170 #ifdef ENABLE_DEBUGGER_SUPPORT |
158 // Computes the address in the original code when the code running is | 171 // Computes the address in the original code when the code running is |
159 // containing break points (calls to DebugBreakXXX builtins). | 172 // containing break points (calls to DebugBreakXXX builtins). |
160 Address OriginalCodeAddress() const; | 173 Address OriginalCodeAddress() const; |
161 #endif | 174 #endif |
162 | 175 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 Handle<Code> handler, | 215 Handle<Code> handler, |
203 Handle<String> name); | 216 Handle<String> name); |
204 | 217 |
205 bool UpdatePolymorphicIC(Handle<HeapType> type, | 218 bool UpdatePolymorphicIC(Handle<HeapType> type, |
206 Handle<String> name, | 219 Handle<String> name, |
207 Handle<Code> code); | 220 Handle<Code> code); |
208 | 221 |
209 virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code); | 222 virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code); |
210 | 223 |
211 void CopyICToMegamorphicCache(Handle<String> name); | 224 void CopyICToMegamorphicCache(Handle<String> name); |
212 bool IsTransitionOfMonomorphicTarget(Handle<HeapType> type); | 225 bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map); |
213 void PatchCache(Handle<HeapType> type, | 226 void PatchCache(Handle<HeapType> type, |
214 Handle<String> name, | 227 Handle<String> name, |
215 Handle<Code> code); | 228 Handle<Code> code); |
216 virtual Code::Kind kind() const { | 229 virtual Code::Kind kind() const { |
217 UNREACHABLE(); | 230 UNREACHABLE(); |
218 return Code::STUB; | 231 return Code::STUB; |
219 } | 232 } |
220 virtual Handle<Code> slow_stub() const { | 233 virtual Handle<Code> slow_stub() const { |
221 UNREACHABLE(); | 234 UNREACHABLE(); |
222 return Handle<Code>::null(); | 235 return Handle<Code>::null(); |
(...skipping 30 matching lines...) Expand all Loading... |
253 | 266 |
254 Isolate* isolate_; | 267 Isolate* isolate_; |
255 | 268 |
256 // The original code target that missed. | 269 // The original code target that missed. |
257 Handle<Code> target_; | 270 Handle<Code> target_; |
258 State state_; | 271 State state_; |
259 bool target_set_; | 272 bool target_set_; |
260 | 273 |
261 ExtraICState extra_ic_state_; | 274 ExtraICState extra_ic_state_; |
262 | 275 |
| 276 TypeHandleList types_; |
| 277 CodeHandleList handlers_; |
| 278 |
263 DISALLOW_IMPLICIT_CONSTRUCTORS(IC); | 279 DISALLOW_IMPLICIT_CONSTRUCTORS(IC); |
264 }; | 280 }; |
265 | 281 |
266 | 282 |
267 // An IC_Utility encapsulates IC::UtilityId. It exists mainly because you | 283 // An IC_Utility encapsulates IC::UtilityId. It exists mainly because you |
268 // cannot make forward declarations to an enum. | 284 // cannot make forward declarations to an enum. |
269 class IC_Utility { | 285 class IC_Utility { |
270 public: | 286 public: |
271 explicit IC_Utility(IC::UtilityId id) | 287 explicit IC_Utility(IC::UtilityId id) |
272 : address_(IC::AddressFromUtilityId(id)), id_(id) {} | 288 : address_(IC::AddressFromUtilityId(id)), id_(id) {} |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); | 906 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
891 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); | 907 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
892 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); | 908 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); |
893 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 909 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
894 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 910 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
895 | 911 |
896 | 912 |
897 } } // namespace v8::internal | 913 } } // namespace v8::internal |
898 | 914 |
899 #endif // V8_IC_H_ | 915 #endif // V8_IC_H_ |
OLD | NEW |