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_IC_H_ | 5 #ifndef V8_IC_H_ |
6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
7 | 7 |
8 #include "src/macro-assembler.h" | 8 #include "src/macro-assembler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 Handle<Object> object, | 168 Handle<Object> object, |
169 Handle<Object> key); | 169 Handle<Object> key); |
170 MaybeHandle<Object> ReferenceError(const char* type, Handle<String> name); | 170 MaybeHandle<Object> ReferenceError(const char* type, Handle<String> name); |
171 | 171 |
172 // Access the target code for the given IC address. | 172 // Access the target code for the given IC address. |
173 static inline Code* GetTargetAtAddress(Address address, | 173 static inline Code* GetTargetAtAddress(Address address, |
174 ConstantPoolArray* constant_pool); | 174 ConstantPoolArray* constant_pool); |
175 static inline void SetTargetAtAddress(Address address, | 175 static inline void SetTargetAtAddress(Address address, |
176 Code* target, | 176 Code* target, |
177 ConstantPoolArray* constant_pool); | 177 ConstantPoolArray* constant_pool); |
| 178 static void OnTypeFeedbackChanged(Isolate* isolate, Address address, |
| 179 State old_state, State new_state, |
| 180 bool target_remains_ic_stub); |
178 static void PostPatching(Address address, Code* target, Code* old_target); | 181 static void PostPatching(Address address, Code* target, Code* old_target); |
179 | 182 |
180 // Compute the handler either by compiling or by retrieving a cached version. | 183 // Compute the handler either by compiling or by retrieving a cached version. |
181 Handle<Code> ComputeHandler(LookupIterator* lookup, Handle<Object> object, | 184 Handle<Code> ComputeHandler(LookupIterator* lookup, Handle<Object> object, |
182 Handle<String> name, | 185 Handle<String> name, |
183 Handle<Object> value = Handle<Code>::null()); | 186 Handle<Object> value = Handle<Code>::null()); |
184 virtual Handle<Code> CompileHandler(LookupIterator* lookup, | 187 virtual Handle<Code> CompileHandler(LookupIterator* lookup, |
185 Handle<Object> object, | 188 Handle<Object> object, |
186 Handle<String> name, Handle<Object> value, | 189 Handle<String> name, Handle<Object> value, |
187 CacheHolderFlag cache_holder) { | 190 CacheHolderFlag cache_holder) { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 Handle<Smi> slot, | 373 Handle<Smi> slot, |
371 const State& state); | 374 const State& state); |
372 | 375 |
373 // Code generator routines. | 376 // Code generator routines. |
374 static Handle<Code> initialize_stub(Isolate* isolate, | 377 static Handle<Code> initialize_stub(Isolate* isolate, |
375 int argc, | 378 int argc, |
376 CallType call_type); | 379 CallType call_type); |
377 | 380 |
378 static void Clear(Isolate* isolate, Address address, Code* target, | 381 static void Clear(Isolate* isolate, Address address, Code* target, |
379 ConstantPoolArray* constant_pool); | 382 ConstantPoolArray* constant_pool); |
| 383 |
| 384 private: |
| 385 void UpdateTypeFeedbackInfo(Object* old_feedback, Object* new_feedback); |
| 386 inline IC::State FeedbackObjectToState(Object* feedback) const; |
380 }; | 387 }; |
381 | 388 |
382 | 389 |
383 OStream& operator<<(OStream& os, const CallIC::State& s); | 390 OStream& operator<<(OStream& os, const CallIC::State& s); |
384 | 391 |
385 | 392 |
386 class LoadIC: public IC { | 393 class LoadIC: public IC { |
387 public: | 394 public: |
388 enum ParameterIndices { | 395 enum ParameterIndices { |
389 kReceiverIndex, | 396 kReceiverIndex, |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss); | 1039 DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss); |
1033 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss); | 1040 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss); |
1034 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite); | 1041 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite); |
1035 DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss); | 1042 DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss); |
1036 DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss); | 1043 DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss); |
1037 | 1044 |
1038 | 1045 |
1039 } } // namespace v8::internal | 1046 } } // namespace v8::internal |
1040 | 1047 |
1041 #endif // V8_IC_H_ | 1048 #endif // V8_IC_H_ |
OLD | NEW |