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
3 // found in the LICENSE file.
5 #ifndef V8_TYPE_FEEDBACK_VECTOR_H_
6 #define V8_TYPE_FEEDBACK_VECTOR_H_
8 #include "src/checks.h"
9 #include "src/elements-kind.h"
10 #include "src/heap/heap.h"
11 #include "src/isolate.h"
12 #include "src/objects.h"
17 class TypeFeedbackVector : public FixedArray {
20 static TypeFeedbackVector* cast(Object* obj) {
21 DCHECK(obj->IsTypeFeedbackVector());
22 return reinterpret_cast<TypeFeedbackVector*>(obj);
25 static Handle<TypeFeedbackVector> Copy(Isolate* isolate,
26 Handle<TypeFeedbackVector> vector);
28 // The object that indicates an uninitialized cache.
29 static inline Handle<Object> UninitializedSentinel(Isolate* isolate);
31 // The object that indicates a megamorphic state.
32 static inline Handle<Object> MegamorphicSentinel(Isolate* isolate);
34 // The object that indicates a premonomorphic state.
35 static inline Handle<Object> PremonomorphicSentinel(Isolate* isolate);
37 // The object that indicates a generic state.
38 static inline Handle<Object> GenericSentinel(Isolate* isolate);
40 // The object that indicates a monomorphic state of Array with
42 static inline Handle<Object> MonomorphicArraySentinel(
43 Isolate* isolate, ElementsKind elements_kind);
45 // A raw version of the uninitialized sentinel that's safe to read during
46 // garbage collection (e.g., for patching the cache).
47 static inline Object* RawUninitializedSentinel(Heap* heap);
50 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector);
53 } // namespace v8::internal
55 #endif // V8_TRANSITIONS_H_