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

Unified Diff: src/compiler/js-type-hint-lowering.h

Issue 2858933004: [turbofan] Lower monomorphic loads during graph building.
Patch Set: Prune headers 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-inlining.cc ('k') | src/compiler/js-type-hint-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-type-hint-lowering.h
diff --git a/src/compiler/js-type-hint-lowering.h b/src/compiler/js-type-hint-lowering.h
index 6627a66c691bf59448bc7f9d3ef2261c953c0d1e..6cd91611881e980a4dde3c46c4b37f3aa0aec2e1 100644
--- a/src/compiler/js-type-hint-lowering.h
+++ b/src/compiler/js-type-hint-lowering.h
@@ -14,6 +14,7 @@ namespace v8 {
namespace internal {
// Forward declarations.
+class CompilationDependencies;
class FeedbackNexus;
class FeedbackSlot;
@@ -47,7 +48,8 @@ class JSTypeHintLowering {
typedef base::Flags<Flag> Flags;
JSTypeHintLowering(JSGraph* jsgraph, Handle<FeedbackVector> feedback_vector,
- Flags flags);
+ Handle<Context> native_context,
+ CompilationDependencies* dependencies, Flags flags);
// Potential reduction of binary (arithmetic, logical, shift and relational
// comparison) operations.
@@ -63,11 +65,53 @@ class JSTypeHintLowering {
Reduction ReduceToPrimitiveToStringOperation(Node* value, Node* effect,
Node* control,
FeedbackSlot slot) const;
+ class LoweringResult {
+ public:
+ Node* value() const { return value_; }
+ Node* effect() const { return effect_; }
+ Node* control() const { return control_; }
+
+ bool Changed() const { return kind_ != LoweringResultKind::kNoChange; }
+ bool IsExit() const { return kind_ == LoweringResultKind::kExit; }
+ bool IsSideEffectFree() const {
+ return kind_ == LoweringResultKind::kSideEffectFree;
+ }
+
+ static LoweringResult SideEffectFree(Node* value, Node* effect,
+ Node* control) {
+ DCHECK_NOT_NULL(effect);
+ DCHECK_NOT_NULL(control);
+ return LoweringResult(LoweringResultKind::kSideEffectFree, value, effect,
+ control);
+ }
+
+ static LoweringResult NoChange() {
+ return LoweringResult(LoweringResultKind::kNoChange, nullptr, nullptr,
+ nullptr);
+ }
+
+ static LoweringResult Exit(Node* control) {
+ return LoweringResult(LoweringResultKind::kExit, nullptr, nullptr,
+ control);
+ }
+
+ private:
+ enum class LoweringResultKind { kNoChange, kSideEffectFree, kExit };
+
+ LoweringResult(LoweringResultKind kind, Node* value, Node* effect,
+ Node* control)
+ : kind_(kind), value_(value), effect_(effect), control_(control) {}
+
+ LoweringResultKind kind_;
+ Node* value_;
+ Node* effect_;
+ Node* control_;
+ };
// Potential reduction of property access operations.
- Reduction ReduceLoadNamedOperation(const Operator* op, Node* obj,
- Node* effect, Node* control,
- FeedbackSlot slot) const;
+ LoweringResult ReduceLoadNamedOperation(const Operator* op, Node* obj,
+ Node* effect, Node* control,
+ FeedbackSlot slot) const;
Reduction ReduceLoadKeyedOperation(const Operator* op, Node* obj, Node* key,
Node* effect, Node* control,
FeedbackSlot slot) const;
@@ -88,11 +132,18 @@ class JSTypeHintLowering {
const Handle<FeedbackVector>& feedback_vector() const {
return feedback_vector_;
}
+ Graph* graph() const;
+
+ Handle<Context> native_context() const { return native_context_; }
+ CompilationDependencies* dependencies() const { return dependencies_; }
JSGraph* jsgraph_;
Flags const flags_;
Handle<FeedbackVector> feedback_vector_;
+ Handle<Context> native_context_;
+ CompilationDependencies* dependencies_;
+
DISALLOW_COPY_AND_ASSIGN(JSTypeHintLowering);
};
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/js-type-hint-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698