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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 Code::Kind GetKind(FeedbackVectorICSlot slot) const; | 159 Code::Kind GetKind(FeedbackVectorICSlot slot) const; |
160 | 160 |
161 static Handle<TypeFeedbackVector> Allocate(Isolate* isolate, | 161 static Handle<TypeFeedbackVector> Allocate(Isolate* isolate, |
162 const FeedbackVectorSpec& spec); | 162 const FeedbackVectorSpec& spec); |
163 | 163 |
164 static Handle<TypeFeedbackVector> Copy(Isolate* isolate, | 164 static Handle<TypeFeedbackVector> Copy(Isolate* isolate, |
165 Handle<TypeFeedbackVector> vector); | 165 Handle<TypeFeedbackVector> vector); |
166 | 166 |
167 // Clears the vector slots and the vector ic slots. | 167 // Clears the vector slots and the vector ic slots. |
168 void ClearSlots(SharedFunctionInfo* shared); | 168 void ClearSlots(SharedFunctionInfo* shared); |
| 169 void ClearICSlots(SharedFunctionInfo* shared) { |
| 170 ClearICSlotsImpl(shared, true); |
| 171 } |
| 172 void ClearICSlotsAtGCTime(SharedFunctionInfo* shared) { |
| 173 ClearICSlotsImpl(shared, false); |
| 174 } |
169 | 175 |
170 // The object that indicates an uninitialized cache. | 176 // The object that indicates an uninitialized cache. |
171 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); | 177 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); |
172 | 178 |
173 // The object that indicates a megamorphic state. | 179 // The object that indicates a megamorphic state. |
174 static inline Handle<Object> MegamorphicSentinel(Isolate* isolate); | 180 static inline Handle<Object> MegamorphicSentinel(Isolate* isolate); |
175 | 181 |
176 // The object that indicates a premonomorphic state. | 182 // The object that indicates a premonomorphic state. |
177 static inline Handle<Object> PremonomorphicSentinel(Isolate* isolate); | 183 static inline Handle<Object> PremonomorphicSentinel(Isolate* isolate); |
178 | 184 |
(...skipping 15 matching lines...) Expand all Loading... |
194 }; | 200 }; |
195 | 201 |
196 static const int kVectorICKindBits = 2; | 202 static const int kVectorICKindBits = 2; |
197 static VectorICKind FromCodeKind(Code::Kind kind); | 203 static VectorICKind FromCodeKind(Code::Kind kind); |
198 static Code::Kind FromVectorICKind(VectorICKind kind); | 204 static Code::Kind FromVectorICKind(VectorICKind kind); |
199 void SetKind(FeedbackVectorICSlot slot, Code::Kind kind); | 205 void SetKind(FeedbackVectorICSlot slot, Code::Kind kind); |
200 | 206 |
201 typedef BitSetComputer<VectorICKind, kVectorICKindBits, kSmiValueSize, | 207 typedef BitSetComputer<VectorICKind, kVectorICKindBits, kSmiValueSize, |
202 uint32_t> VectorICComputer; | 208 uint32_t> VectorICComputer; |
203 | 209 |
| 210 void ClearICSlotsImpl(SharedFunctionInfo* shared, bool force_clear); |
| 211 |
204 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); | 212 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); |
205 }; | 213 }; |
206 | 214 |
207 | 215 |
208 // A FeedbackNexus is the combination of a TypeFeedbackVector and a slot. | 216 // A FeedbackNexus is the combination of a TypeFeedbackVector and a slot. |
209 // Derived classes customize the update and retrieval of feedback. | 217 // Derived classes customize the update and retrieval of feedback. |
210 class FeedbackNexus { | 218 class FeedbackNexus { |
211 public: | 219 public: |
212 FeedbackNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorICSlot slot) | 220 FeedbackNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorICSlot slot) |
213 : vector_handle_(vector), vector_(NULL), slot_(slot) {} | 221 : vector_handle_(vector), vector_(NULL), slot_(slot) {} |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 int ExtractMaps(MapHandleList* maps) const OVERRIDE; | 367 int ExtractMaps(MapHandleList* maps) const OVERRIDE; |
360 MaybeHandle<Code> FindHandlerForMap(Handle<Map> map) const OVERRIDE; | 368 MaybeHandle<Code> FindHandlerForMap(Handle<Map> map) const OVERRIDE; |
361 virtual bool FindHandlers(CodeHandleList* code_list, | 369 virtual bool FindHandlers(CodeHandleList* code_list, |
362 int length = -1) const OVERRIDE; | 370 int length = -1) const OVERRIDE; |
363 Name* FindFirstName() const OVERRIDE; | 371 Name* FindFirstName() const OVERRIDE; |
364 }; | 372 }; |
365 } | 373 } |
366 } // namespace v8::internal | 374 } // namespace v8::internal |
367 | 375 |
368 #endif // V8_TRANSITIONS_H_ | 376 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |