v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
property-access-builder.h
Go to the documentation of this file.
1// Copyright 2017 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_COMPILER_PROPERTY_ACCESS_BUILDER_H_
6#define V8_COMPILER_PROPERTY_ACCESS_BUILDER_H_
7
8#include <optional>
9
13#include "src/compiler/node.h"
14#include "src/handles/handles.h"
16
17namespace v8 {
18namespace internal {
19namespace compiler {
20
21class CommonOperatorBuilder;
22class CompilationDependencies;
23class TFGraph;
24class JSGraph;
25class JSHeapBroker;
26class PropertyAccessInfo;
27class SimplifiedOperatorBuilder;
28struct FieldAccess;
29
31 public:
34
35 // Builds the appropriate string check if the maps are only string
36 // maps.
38 Node** receiver, Effect* effect, Control control);
39 // Builds a number check if all maps are number maps.
41 Node** receiver, Effect* effect, Control control);
42
43 void BuildCheckMaps(Node* object, Effect* effect, Control control,
44 ZoneVector<MapRef> const& maps,
45 bool has_deprecated_map_without_migration_target = false);
46
47 Node* BuildCheckValue(Node* receiver, Effect* effect, Control control,
48 ObjectRef value);
49
50 Node* BuildCheckSmi(Node* value, Effect* effect, Control control,
51 FeedbackSource feedback_source = FeedbackSource());
52
53 Node* BuildCheckNumber(Node* value, Effect* effect, Control control,
54 FeedbackSource feedback_source = FeedbackSource());
55
57 Node* value, Effect* effect, Control control,
58 FeedbackSource feedback_source = FeedbackSource());
59
60 // Builds the actual load for data-field and data-constant-field
61 // properties (without heap-object or map checks).
62 Node* BuildLoadDataField(NameRef name, PropertyAccessInfo const& access_info,
63 Node* lookup_start_object, Node** effect,
64 Node** control);
65
66 // Tries to load a constant value from a prototype object in dictionary mode
67 // and constant-folds it. Returns {} if the constant couldn't be safely
68 // retrieved.
69 std::optional<Node*> FoldLoadDictPrototypeConstant(
70 PropertyAccessInfo const& access_info);
71
73 Representation representation);
74
75 private:
76 JSGraph* jsgraph() const { return jsgraph_; }
77 JSHeapBroker* broker() const { return broker_; }
81 TFGraph* graph() const;
82 Isolate* isolate() const;
85
87 PropertyAccessInfo const& access_info,
88 Node* lookup_start_object);
89 // Returns a node with the holder for the property access described by
90 // {access_info}.
91 Node* ResolveHolder(PropertyAccessInfo const& access_info,
92 Node* lookup_start_object);
93
94 Node* BuildLoadDataField(NameRef name, Node* holder,
95 FieldAccess&& field_access, bool is_inobject,
96 Node** effect, Node** control);
97
100};
101
104 ZoneVector<MapRef> const& maps);
106 ZoneVector<MapRef> const& maps);
107
108} // namespace compiler
109} // namespace internal
110} // namespace v8
111
112#endif // V8_COMPILER_PROPERTY_ACCESS_BUILDER_H_
CompilationDependencies * dependencies() const
Node * TryFoldLoadConstantDataField(NameRef name, PropertyAccessInfo const &access_info, Node *lookup_start_object)
static MachineRepresentation ConvertRepresentation(Representation representation)
PropertyAccessBuilder(JSGraph *jsgraph, JSHeapBroker *broker)
Node * ResolveHolder(PropertyAccessInfo const &access_info, Node *lookup_start_object)
Node * BuildCheckNumberFitsInt32(Node *value, Effect *effect, Control control, FeedbackSource feedback_source=FeedbackSource())
bool TryBuildNumberCheck(JSHeapBroker *broker, ZoneVector< MapRef > const &maps, Node **receiver, Effect *effect, Control control)
Node * BuildCheckValue(Node *receiver, Effect *effect, Control control, ObjectRef value)
Node * BuildCheckSmi(Node *value, Effect *effect, Control control, FeedbackSource feedback_source=FeedbackSource())
Node * BuildCheckNumber(Node *value, Effect *effect, Control control, FeedbackSource feedback_source=FeedbackSource())
bool TryBuildStringCheck(JSHeapBroker *broker, ZoneVector< MapRef > const &maps, Node **receiver, Effect *effect, Control control)
void BuildCheckMaps(Node *object, Effect *effect, Control control, ZoneVector< MapRef > const &maps, bool has_deprecated_map_without_migration_target=false)
std::optional< Node * > FoldLoadDictPrototypeConstant(PropertyAccessInfo const &access_info)
Node * BuildLoadDataField(NameRef name, PropertyAccessInfo const &access_info, Node *lookup_start_object, Node **effect, Node **control)
JSHeapBroker * broker
TNode< Object > receiver
bool HasOnlyNonResizableTypedArrayMaps(JSHeapBroker *broker, ZoneVector< MapRef > const &maps)
bool HasOnlyStringMaps(JSHeapBroker *broker, ZoneVector< MapRef > const &maps)
bool HasOnlyStringWrapperMaps(JSHeapBroker *broker, ZoneVector< MapRef > const &maps)