| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_TYPE_FEEDBACK_VECTOR_H_ | 5 #ifndef V8_TYPE_FEEDBACK_VECTOR_H_ |
| 6 #define V8_TYPE_FEEDBACK_VECTOR_H_ | 6 #define V8_TYPE_FEEDBACK_VECTOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "src/checks.h" | 10 #include "src/checks.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 Code::Kind GetKind(FeedbackVectorICSlot slot) const; | 188 Code::Kind GetKind(FeedbackVectorICSlot slot) const; |
| 189 | 189 |
| 190 template <typename Spec> | 190 template <typename Spec> |
| 191 static Handle<TypeFeedbackVector> Allocate(Isolate* isolate, | 191 static Handle<TypeFeedbackVector> Allocate(Isolate* isolate, |
| 192 const Spec* spec); | 192 const Spec* spec); |
| 193 | 193 |
| 194 static Handle<TypeFeedbackVector> Copy(Isolate* isolate, | 194 static Handle<TypeFeedbackVector> Copy(Isolate* isolate, |
| 195 Handle<TypeFeedbackVector> vector); | 195 Handle<TypeFeedbackVector> vector); |
| 196 | 196 |
| 197 // Clears the vector slots and the vector ic slots. | 197 // Clears the vector slots and the vector ic slots. |
| 198 void ClearSlots(SharedFunctionInfo* shared); | 198 void ClearSlots(SharedFunctionInfo* shared) { ClearSlotsImpl(shared, true); } |
| 199 void ClearSlotsAtGCTime(SharedFunctionInfo* shared) { |
| 200 ClearSlotsImpl(shared, false); |
| 201 } |
| 202 |
| 199 void ClearICSlots(SharedFunctionInfo* shared) { | 203 void ClearICSlots(SharedFunctionInfo* shared) { |
| 200 ClearICSlotsImpl(shared, true); | 204 ClearICSlotsImpl(shared, true); |
| 201 } | 205 } |
| 202 void ClearICSlotsAtGCTime(SharedFunctionInfo* shared) { | 206 void ClearICSlotsAtGCTime(SharedFunctionInfo* shared) { |
| 203 ClearICSlotsImpl(shared, false); | 207 ClearICSlotsImpl(shared, false); |
| 204 } | 208 } |
| 205 | 209 |
| 206 // The object that indicates an uninitialized cache. | 210 // The object that indicates an uninitialized cache. |
| 207 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); | 211 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); |
| 208 | 212 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 230 }; | 234 }; |
| 231 | 235 |
| 232 static const int kVectorICKindBits = 2; | 236 static const int kVectorICKindBits = 2; |
| 233 static VectorICKind FromCodeKind(Code::Kind kind); | 237 static VectorICKind FromCodeKind(Code::Kind kind); |
| 234 static Code::Kind FromVectorICKind(VectorICKind kind); | 238 static Code::Kind FromVectorICKind(VectorICKind kind); |
| 235 void SetKind(FeedbackVectorICSlot slot, Code::Kind kind); | 239 void SetKind(FeedbackVectorICSlot slot, Code::Kind kind); |
| 236 | 240 |
| 237 typedef BitSetComputer<VectorICKind, kVectorICKindBits, kSmiValueSize, | 241 typedef BitSetComputer<VectorICKind, kVectorICKindBits, kSmiValueSize, |
| 238 uint32_t> VectorICComputer; | 242 uint32_t> VectorICComputer; |
| 239 | 243 |
| 244 void ClearSlotsImpl(SharedFunctionInfo* shared, bool force_clear); |
| 240 void ClearICSlotsImpl(SharedFunctionInfo* shared, bool force_clear); | 245 void ClearICSlotsImpl(SharedFunctionInfo* shared, bool force_clear); |
| 241 | 246 |
| 242 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); | 247 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); |
| 243 }; | 248 }; |
| 244 | 249 |
| 245 | 250 |
| 246 // A FeedbackNexus is the combination of a TypeFeedbackVector and a slot. | 251 // A FeedbackNexus is the combination of a TypeFeedbackVector and a slot. |
| 247 // Derived classes customize the update and retrieval of feedback. | 252 // Derived classes customize the update and retrieval of feedback. |
| 248 class FeedbackNexus { | 253 class FeedbackNexus { |
| 249 public: | 254 public: |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 void ConfigurePolymorphic(Handle<Name> name, MapHandleList* maps, | 401 void ConfigurePolymorphic(Handle<Name> name, MapHandleList* maps, |
| 397 CodeHandleList* handlers); | 402 CodeHandleList* handlers); |
| 398 | 403 |
| 399 InlineCacheState StateFromFeedback() const OVERRIDE; | 404 InlineCacheState StateFromFeedback() const OVERRIDE; |
| 400 Name* FindFirstName() const OVERRIDE; | 405 Name* FindFirstName() const OVERRIDE; |
| 401 }; | 406 }; |
| 402 } | 407 } |
| 403 } // namespace v8::internal | 408 } // namespace v8::internal |
| 404 | 409 |
| 405 #endif // V8_TRANSITIONS_H_ | 410 #endif // V8_TRANSITIONS_H_ |
| OLD | NEW |