v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
property.h
Go to the documentation of this file.
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.
4
5#ifndef V8_OBJECTS_PROPERTY_H_
6#define V8_OBJECTS_PROPERTY_H_
7
8#include <iosfwd>
9
10#include "src/common/globals.h"
11#include "src/handles/handles.h"
13#include "src/objects/name.h"
14#include "src/objects/objects.h"
16
17namespace v8 {
18namespace internal {
19
20// Abstraction for elements in instance-descriptor arrays.
21//
22// Each descriptor has a key, property attributes, property type,
23// property index (in the actual instance-descriptor array) and
24// optionally a piece of data.
26 public:
27 Descriptor();
28
29 DirectHandle<Name> GetKey() const { return key_; }
31 PropertyDetails GetDetails() const { return details_; }
32
33 void SetSortedKeyIndex(int index) { details_ = details_.set_pointer(index); }
34
35 static Descriptor DataField(Isolate* isolate, DirectHandle<Name> key,
36 int field_index, PropertyAttributes attributes,
37 Representation representation);
38
39 static Descriptor DataField(
40 DirectHandle<Name> key, int field_index, PropertyAttributes attributes,
41 PropertyConstness constness, Representation representation,
42 const MaybeObjectDirectHandle& wrapped_field_type);
43
44 static Descriptor DataConstant(DirectHandle<Name> key,
46 PropertyAttributes attributes);
47
48 static Descriptor DataConstant(Isolate* isolate, DirectHandle<Name> key,
49 int field_index, DirectHandle<Object> value,
50 PropertyAttributes attributes);
51
52 static Descriptor AccessorConstant(DirectHandle<Name> key,
54 PropertyAttributes attributes);
55
56 private:
60
61 protected:
63 PropertyDetails details);
64
67 PropertyLocation location, PropertyConstness constness,
68 Representation representation, int field_index);
69
70 friend class MapUpdater;
71};
72
73} // namespace internal
74} // namespace v8
75
76#endif // V8_OBJECTS_PROPERTY_H_
Builtins::Kind kind
Definition builtins.cc:40
DirectHandle< Name > key_
Definition property.h:57
MaybeObjectDirectHandle GetValue() const
Definition property.h:30
DirectHandle< Name > GetKey() const
Definition property.h:29
MaybeObjectDirectHandle value_
Definition property.h:58
PropertyDetails details_
Definition property.h:59
PropertyDetails GetDetails() const
Definition property.h:31
void SetSortedKeyIndex(int index)
Definition property.h:33
Register const value_
Handle< SharedFunctionInfo > key_
#define V8_EXPORT_PRIVATE
Definition macros.h:460
std::unique_ptr< ValueMirror > key