forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-handler.h
More file actions
73 lines (56 loc) Β· 2.68 KB
/
data-handler.h
File metadata and controls
73 lines (56 loc) Β· 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_OBJECTS_DATA_HANDLER_H_
#define V8_OBJECTS_DATA_HANDLER_H_
#include "src/objects/struct.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
#include "src/objects/tagged-field.h"
namespace v8 {
namespace internal {
#include "torque-generated/src/objects/data-handler-tq.inc"
// DataHandler is a base class for load and store handlers that can't be
// encoded in one Smi. Kind of a handler can be deduced from instance type.
V8_OBJECT class DataHandler : public StructLayout {
public:
static constexpr int OffsetOf(int index);
static constexpr int SizeFor(int count);
// [smi_handler]: A Smi which encodes a handler or Code object
// (we still use code handlers for accessing lexical environment variables,
// but soon only smi handlers will remain). See LoadHandler and StoreHandler
// for details about encoding.
inline Tagged<UnionOf<Smi, Code>> smi_handler() const;
inline void set_smi_handler(Tagged<Smi> value);
inline void set_smi_handler(Tagged<Code> value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
// [validity_cell]: A validity Cell that guards prototype chain modifications.
inline Tagged<UnionOf<Smi, Cell>> validity_cell() const;
inline void set_validity_cell(Tagged<UnionOf<Smi, Cell>> value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
// Returns number of optional data fields available in the object.
inline int data_field_count() const;
// [data1-3]: These are optional general-purpose fields whose content and
// presence depends on the handler kind.
inline Tagged<MaybeObject> data1() const;
inline void set_data1(Tagged<MaybeObject> value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
inline Tagged<MaybeObject> data2() const;
inline void set_data2(Tagged<MaybeObject> value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
inline Tagged<MaybeObject> data3() const;
inline void set_data3(Tagged<MaybeObject> value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
DECL_VERIFIER(DataHandler)
DECL_PRINTER(DataHandler)
class BodyDescriptor;
private:
friend class AccessorAssembler;
TaggedMember<UnionOf<Smi, Code>> smi_handler_;
TaggedMember<UnionOf<Smi, Cell>> validity_cell_;
FLEXIBLE_ARRAY_MEMBER(TaggedMember<MaybeObject>, data);
} V8_OBJECT_END;
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_OBJECTS_DATA_HANDLER_H_