v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
property-cell-inl.h
Go to the documentation of this file.
1// Copyright 2018 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_CELL_INL_H_
6#define V8_OBJECTS_PROPERTY_CELL_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
14
15// Has to be the last include (doesn't have include guards):
17
18namespace v8 {
19namespace internal {
20
21#include "torque-generated/src/objects/property-cell-tq-inl.inc"
22
24
26 kDependentCodeOffset)
27ACCESSORS(PropertyCell, name, Tagged<Name>, kNameOffset)
29 kPropertyDetailsRawOffset)
31 kPropertyDetailsRawOffset)
32ACCESSORS(PropertyCell, value, Tagged<Object>, kValueOffset)
34
35PropertyDetails PropertyCell::property_details() const {
37}
38
39PropertyDetails PropertyCell::property_details(AcquireLoadTag tag) const {
40 return PropertyDetails(Cast<Smi>(property_details_raw(tag)));
41}
42
44 PropertyDetails details) {
46 PropertyDetails old_details = property_details();
47 CHECK_EQ(old_details.cell_type(), details.cell_type());
48 set_property_details_raw(details.AsSmi(), kReleaseStore);
49 // Deopt when making a writable property read-only. The reverse direction
50 // is uninteresting because Turbofan does not currently rely on read-only
51 // unless the property is also configurable, in which case it will stay
52 // read-only forever.
53 if (!old_details.IsReadOnly() && details.IsReadOnly()) {
54 // TODO(11527): pass Isolate as an argument.
55 Isolate* isolate = GetIsolateFromWritableObject(*this);
58 }
59}
60
62 DirectHandle<Object> new_value) {
63 DCHECK(CanTransitionTo(new_details, *new_value));
64 // This code must be in sync with its counterpart in
65 // PropertyCellData::Serialize.
66 PropertyDetails transition_marker = new_details;
68 set_property_details_raw(transition_marker.AsSmi(), kReleaseStore);
69 set_value(*new_value, kReleaseStore);
70 set_property_details_raw(new_details.AsSmi(), kReleaseStore);
71}
72
74
76 Tagged<Smi>, kPropertyDetailsRawOffset)
77
79 kDependentCodeOffset)
80
82ContextSidePropertyCell::context_side_property() const {
83 return FromSmi(context_side_property_raw(kAcquireLoad));
84}
85
86} // namespace internal
87} // namespace v8
88
90
91#endif // V8_OBJECTS_PROPERTY_CELL_INL_H_
static void DeoptimizeDependencyGroups(Isolate *isolate, ObjectT object, DependencyGroups groups)
PropertyDetails property_details() const
void Transition(PropertyDetails new_details, DirectHandle< Object > new_value)
static bool CheckDataIsCompatible(PropertyDetails details, Tagged< Object > value)
Definition objects.cc:6525
void UpdatePropertyDetailsExceptCellType(PropertyDetails details)
PropertyDetails set_cell_type(PropertyCellType type) const
Tagged< Smi > AsSmi() const
Definition objects-inl.h:79
V8_INLINE Isolate * GetIsolateFromWritableObject(Tagged< HeapObject > object)
return value
Definition map-inl.h:893
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Definition casting.h:150
static constexpr ReleaseStoreTag kReleaseStore
Definition globals.h:2910
static constexpr AcquireLoadTag kAcquireLoad
Definition globals.h:2908
#define ACCESSORS(holder, name, type, offset)
#define TQ_OBJECT_CONSTRUCTORS_IMPL(Type)
#define RELEASE_ACQUIRE_ACCESSORS(holder, name, type, offset)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
Definition logging.h:482