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

Unified Diff: test/cctest/compiler/simplified-graph-builder.h

Issue 543763002: Remove overly complex MachineNodeFactory. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | « test/cctest/compiler/graph-builder-tester.h ('k') | test/cctest/compiler/structured-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/simplified-graph-builder.h
diff --git a/test/cctest/compiler/simplified-graph-builder.h b/test/cctest/compiler/simplified-graph-builder.h
index c04585f1ccf6cfb1707b8b669e3f11436b53fb7d..5fb2675307eddb680f965fe87ffe9afa019553fa 100644
--- a/test/cctest/compiler/simplified-graph-builder.h
+++ b/test/cctest/compiler/simplified-graph-builder.h
@@ -7,7 +7,6 @@
#include "src/compiler/common-operator.h"
#include "src/compiler/graph-builder.h"
-#include "src/compiler/machine-node-factory.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/simplified-operator.h"
#include "test/cctest/cctest.h"
@@ -17,9 +16,7 @@ namespace v8 {
namespace internal {
namespace compiler {
-class SimplifiedGraphBuilder
- : public GraphBuilder,
- public MachineNodeFactory<SimplifiedGraphBuilder> {
+class SimplifiedGraphBuilder : public GraphBuilder {
public:
SimplifiedGraphBuilder(Graph* graph, CommonOperatorBuilder* common,
MachineOperatorBuilder* machine,
@@ -40,6 +37,19 @@ class SimplifiedGraphBuilder
// Close the graph.
void End();
+ Node* PointerConstant(void* value) {
+ intptr_t intptr_value = reinterpret_cast<intptr_t>(value);
+ return kPointerSize == 8 ? NewNode(common()->Int64Constant(intptr_value))
+ : Int32Constant(static_cast<int>(intptr_value));
+ }
+ Node* Int32Constant(int32_t value) {
+ return NewNode(common()->Int32Constant(value));
+ }
+ Node* HeapConstant(Handle<Object> object) {
+ Unique<Object> val = Unique<Object>::CreateUninitialized(object);
+ return NewNode(common()->HeapConstant(val));
+ }
+
Node* BooleanNot(Node* a) { return NewNode(simplified()->BooleanNot(), a); }
Node* NumberEqual(Node* a, Node* b) {
« no previous file with comments | « test/cctest/compiler/graph-builder-tester.h ('k') | test/cctest/compiler/structured-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698