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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/property-access-builder.h
diff --git a/src/compiler/property-access-builder.h b/src/compiler/property-access-builder.h
new file mode 100644
index 0000000000000000000000000000000000000000..2774423b4cdcdd680f92334bcd40ba5bb2f8ca41
--- /dev/null
+++ b/src/compiler/property-access-builder.h
@@ -0,0 +1,80 @@
+// 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_COMPILER_PROPERTY_ACCESS_BUILDER_H_
+#define V8_COMPILER_PROPERTY_ACCESS_BUILDER_H_
+
+#include <vector>
+
+#include "src/handles.h"
+#include "src/objects/map.h"
+#include "src/zone/zone-containers.h"
+
+namespace v8 {
+namespace internal {
+
+class CompilationDependencies;
+
+namespace compiler {
+
+class CommonOperatorBuilder;
+class Graph;
+class JSGraph;
+class Node;
+class PropertyAccessInfo;
+class SimplifiedOperatorBuilder;
+
+class PropertyAccessBuilder {
+ public:
+ PropertyAccessBuilder(JSGraph* jsgraph, CompilationDependencies* dependencies)
+ : jsgraph_(jsgraph), dependencies_(dependencies) {}
+
+ // Builds the appropriate string check if the maps are only string
+ // maps.
+ bool TryBuildStringCheck(MapHandles const& maps, Node** receiver,
+ Node** effect, Node* control);
+ // Builds a number check if all maps are number maps.
+ bool TryBuildNumberCheck(MapHandles const& maps, Node** receiver,
+ Node** effect, Node* control);
+
+ Node* BuildCheckHeapObject(Node* receiver, Node** effect, Node* control);
+ void BuildCheckMaps(Node* receiver, Node** effect, Node* control,
+ std::vector<Handle<Map>> const& receiver_maps);
+
+ // Adds stability dependencies on all prototypes of every class in
+ // {receiver_type} up to (and including) the {holder}.
+ void AssumePrototypesStable(Handle<Context> native_context,
+ std::vector<Handle<Map>> const& receiver_maps,
+ Handle<JSObject> holder);
+
+ // Builds the actual load for data-field and data-constant-field
+ // properties (without heap-object or map checks).
+ Node* BuildLoadDataField(Handle<Name> name,
+ PropertyAccessInfo const& access_info,
+ Node* receiver, Node** effect, Node** control);
+
+ private:
+ JSGraph* jsgraph() const { return jsgraph_; }
+ CompilationDependencies* dependencies() const { return dependencies_; }
+ Graph* graph() const;
+ Isolate* isolate() const;
+ CommonOperatorBuilder* common() const;
+ SimplifiedOperatorBuilder* simplified() const;
+
+ Node* TryBuildLoadConstantDataField(Handle<Name> name,
+ PropertyAccessInfo const& access_info,
+ Node* receiver);
+ // Returns a node with the holder for the property access described by
+ // {access_info}.
+ Node* ResolveHolder(PropertyAccessInfo const& access_info, Node* receiver);
+
+ JSGraph* jsgraph_;
+ CompilationDependencies* dependencies_;
+};
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
+
+#endif // V8_COMPILER_PROPERTY_ACCESS_BUILDER_H_
« 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