v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
field-type.h
Go to the documentation of this file.
1// Copyright 2016 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.
4
5#ifndef V8_OBJECTS_FIELD_TYPE_H_
6#define V8_OBJECTS_FIELD_TYPE_H_
7
10#include "src/objects/tagged.h"
11
12namespace v8 {
13namespace internal {
14
15class FieldType;
16
17class FieldType : public AllStatic {
18 public:
19 // If the GC can clear field types we must ensure that every store updates
20 // field types.
21 static constexpr bool kFieldTypesCanBeClearedOnGC = true;
22
29 Isolate* isolate);
30
31 static bool NowContains(Tagged<FieldType> type, Tagged<Object> value);
32
34 return NowContains(type, *value);
35 }
36
39 static bool NowStable(Tagged<FieldType> type);
40 static bool NowIs(Tagged<FieldType> type, Tagged<FieldType> other);
41 static bool NowIs(Tagged<FieldType> type, DirectHandle<FieldType> other);
42
44 Tagged<FieldType> other);
46 std::ostream& os);
47};
48
50inline bool IsNone(Tagged<FieldType> obj) { return obj == FieldType::None(); }
51inline bool IsAny(Tagged<FieldType> obj) { return obj == FieldType::Any(); }
52
53} // namespace internal
54} // namespace v8
55
56#endif // V8_OBJECTS_FIELD_TYPE_H_
static bool NowContains(Tagged< FieldType > type, DirectHandle< Object > value)
Definition field-type.h:33
static V8_EXPORT_PRIVATE void PrintTo(Tagged< FieldType > type, std::ostream &os)
Definition field-type.cc:94
static bool NowStable(Tagged< FieldType > type)
Definition field-type.cc:63
static V8_EXPORT_PRIVATE bool Equals(Tagged< FieldType > type, Tagged< FieldType > other)
Definition field-type.cc:79
static V8_EXPORT_PRIVATE Tagged< FieldType > Class(Tagged< Map > map)
Definition field-type.cc:37
static Tagged< Map > AsClass(Tagged< FieldType > type)
Definition field-type.cc:51
static V8_EXPORT_PRIVATE Tagged< FieldType > Any()
Definition field-type.cc:22
static constexpr bool kFieldTypesCanBeClearedOnGC
Definition field-type.h:21
static V8_EXPORT_PRIVATE Tagged< FieldType > None()
Definition field-type.cc:17
static bool NowContains(Tagged< FieldType > type, Tagged< Object > value)
static bool NowIs(Tagged< FieldType > type, Tagged< FieldType > other)
Definition field-type.cc:68
bool IsNone(Tagged< FieldType > obj)
Definition field-type.h:50
Tagged(T object) -> Tagged< T >
bool IsClass(Tagged< FieldType > obj)
Definition field-type.cc:48
bool IsAny(Tagged< FieldType > obj)
Definition field-type.h:51
#define V8_EXPORT_PRIVATE
Definition macros.h:460