Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: src/compiler/property-access-builder.h

Issue 2936673005: [turbofan] Refactor property access building. (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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 <vector>
9
10 #include "src/handles.h"
11 #include "src/objects/map.h"
12 #include "src/zone/zone-containers.h"
13
14 namespace v8 {
15 namespace internal {
16
17 class CompilationDependencies;
18
19 namespace compiler {
20
21 class CommonOperatorBuilder;
22 class Graph;
23 class JSGraph;
24 class Node;
25 class PropertyAccessInfo;
26 class SimplifiedOperatorBuilder;
27
28 class PropertyAccessBuilder {
29 public:
30 PropertyAccessBuilder(JSGraph* jsgraph, CompilationDependencies* dependencies)
31 : jsgraph_(jsgraph), dependencies_(dependencies) {}
32
33 // Builds the appropriate string check if the maps are only string
34 // maps.
35 bool TryBuildStringCheck(MapHandles const& maps, Node** receiver,
36 Node** effect, Node* control);
37 // Builds a number check if all maps are number maps.
38 bool TryBuildNumberCheck(MapHandles const& maps, Node** receiver,
39 Node** effect, Node* control);
40
41 Node* BuildCheckHeapObject(Node* receiver, Node** effect, Node* control);
42 void BuildCheckMaps(Node* receiver, Node** effect, Node* control,
43 std::vector<Handle<Map>> const& receiver_maps);
44
45 // Adds stability dependencies on all prototypes of every class in
46 // {receiver_type} up to (and including) the {holder}.
47 void AssumePrototypesStable(Handle<Context> native_context,
48 std::vector<Handle<Map>> const& receiver_maps,
49 Handle<JSObject> holder);
50
51 // Builds the actual load for data-field and data-constant-field
52 // properties (without heap-object or map checks).
53 Node* BuildLoadDataField(Handle<Name> name,
54 PropertyAccessInfo const& access_info,
55 Node* receiver, Node** effect, Node** control);
56
57 private:
58 JSGraph* jsgraph() const { return jsgraph_; }
59 CompilationDependencies* dependencies() const { return dependencies_; }
60 Graph* graph() const;
61 Isolate* isolate() const;
62 CommonOperatorBuilder* common() const;
63 SimplifiedOperatorBuilder* simplified() const;
64
65 Node* TryBuildLoadConstantDataField(Handle<Name> name,
66 PropertyAccessInfo const& access_info,
67 Node* receiver);
68 // Returns a node with the holder for the property access described by
69 // {access_info}.
70 Node* ResolveHolder(PropertyAccessInfo const& access_info, Node* receiver);
71
72 JSGraph* jsgraph_;
73 CompilationDependencies* dependencies_;
74 };
75
76 } // namespace compiler
77 } // namespace internal
78 } // namespace v8
79
80 #endif // V8_COMPILER_PROPERTY_ACCESS_BUILDER_H_
OLDNEW
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | src/compiler/property-access-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698