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

Unified Diff: src/compiler/machine-operator-reducer.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/machine-operator.h ('k') | src/compiler/machine-operator-reducer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator-reducer.h
diff --git a/src/compiler/machine-operator-reducer.h b/src/compiler/machine-operator-reducer.h
new file mode 100644
index 0000000000000000000000000000000000000000..46d2931e9949a9b674c1e8baca5382b8f6253e9f
--- /dev/null
+++ b/src/compiler/machine-operator-reducer.h
@@ -0,0 +1,52 @@
+// 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_MACHINE_OPERATOR_REDUCER_H_
+#define V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_
+
+#include "src/compiler/common-operator.h"
+#include "src/compiler/graph-reducer.h"
+#include "src/compiler/machine-operator.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+// Forward declarations.
+class CommonNodeCache;
+
+// Performs constant folding and strength reduction on nodes that have
+// machine operators.
+class MachineOperatorReducer : public Reducer {
+ public:
+ explicit MachineOperatorReducer(Graph* graph);
+
+ MachineOperatorReducer(Graph* graph, CommonNodeCache* cache);
+
+ virtual Reduction Reduce(Node* node);
+
+ private:
+ Graph* graph_;
+ CommonNodeCache* cache_;
+ CommonOperatorBuilder common_;
+ MachineOperatorBuilder machine_;
+
+ Node* Int32Constant(int32_t value);
+ Node* Float64Constant(volatile double value);
+
+ Reduction ReplaceBool(bool value) { return ReplaceInt32(value ? 1 : 0); }
+
+ Reduction ReplaceInt32(int32_t value) {
+ return Replace(Int32Constant(value));
+ }
+
+ Reduction ReplaceFloat64(volatile double value) {
+ return Replace(Float64Constant(value));
+ }
+};
+}
+}
+} // namespace v8::internal::compiler
+
+#endif // V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_
« no previous file with comments | « src/compiler/machine-operator.h ('k') | src/compiler/machine-operator-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698