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

Unified Diff: src/compiler/js-typed-lowering.h

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 years, 5 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-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.h
diff --git a/src/compiler/js-typed-lowering.h b/src/compiler/js-typed-lowering.h
new file mode 100644
index 0000000000000000000000000000000000000000..184058b12ed83933495f539ebdbce43abc2fe0a3
--- /dev/null
+++ b/src/compiler/js-typed-lowering.h
@@ -0,0 +1,69 @@
+// Copyright 2014 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_OPERATOR_REDUCERS_H_
+#define V8_COMPILER_OPERATOR_REDUCERS_H_
+
+#include "src/compiler/graph-reducer.h"
+#include "src/compiler/js-graph.h"
+#include "src/compiler/lowering-builder.h"
+#include "src/compiler/machine-operator.h"
+#include "src/compiler/node.h"
+#include "src/compiler/simplified-operator.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+class JSBinopReduction;
+
+// Lowers JS-level operators to simplified operators based on types.
+class JSTypedLowering : public LoweringBuilder {
+ public:
+ explicit JSTypedLowering(JSGraph* jsgraph,
+ SourcePositionTable* source_positions)
+ : LoweringBuilder(jsgraph->graph(), source_positions),
+ jsgraph_(jsgraph),
+ simplified_(jsgraph->zone()),
+ machine_(jsgraph->zone()) {}
+ virtual ~JSTypedLowering() {}
+
+ Reduction Reduce(Node* node);
+ virtual void Lower(Node* node) { Reduce(node); }
+
+ JSGraph* jsgraph() { return jsgraph_; }
+ Graph* graph() { return jsgraph_->graph(); }
+
+ private:
+ friend class JSBinopReduction;
+ JSGraph* jsgraph_;
+ SimplifiedOperatorBuilder simplified_;
+ MachineOperatorBuilder machine_;
+
+ Reduction ReplaceEagerly(Node* old, Node* node);
+ Reduction NoChange() { return Reducer::NoChange(); }
+ Reduction ReplaceWith(Node* node) { return Reducer::Replace(node); }
+ Reduction Changed(Node* node) { return Reducer::Changed(node); }
+ Reduction ReduceJSAdd(Node* node);
+ Reduction ReduceJSComparison(Node* node);
+ Reduction ReduceJSEqual(Node* node, bool invert);
+ Reduction ReduceJSStrictEqual(Node* node, bool invert);
+ Reduction ReduceJSToNumberInput(Node* input);
+ Reduction ReduceJSToStringInput(Node* input);
+ Reduction ReduceJSToBooleanInput(Node* input);
+ Reduction ReduceNumberBinop(Node* node, Operator* numberOp);
+ Reduction ReduceI32Binop(Node* node, bool left_signed, bool right_signed,
+ Operator* intOp);
+ Reduction ReduceI32Shift(Node* node, bool left_signed, Operator* shift_op);
+
+ JSOperatorBuilder* javascript() { return jsgraph_->javascript(); }
+ CommonOperatorBuilder* common() { return jsgraph_->common(); }
+ SimplifiedOperatorBuilder* simplified() { return &simplified_; }
+ MachineOperatorBuilder* machine() { return &machine_; }
+};
+}
+}
+} // namespace v8::internal::compiler
+
+#endif // V8_COMPILER_OPERATOR_REDUCERS_H_
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698