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