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

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

Issue 1248743003: [turbofan] Get rid of overly abstract SimplifiedGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « test/cctest/compiler/simplified-graph-builder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/simplified-graph-builder.cc
diff --git a/test/cctest/compiler/simplified-graph-builder.cc b/test/cctest/compiler/simplified-graph-builder.cc
deleted file mode 100644
index 4d57719effa44aedadd4edd6e94fc681c7ed3371..0000000000000000000000000000000000000000
--- a/test/cctest/compiler/simplified-graph-builder.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// 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.
-
-#include "test/cctest/compiler/simplified-graph-builder.h"
-
-#include "src/compiler/operator-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-SimplifiedGraphBuilder::SimplifiedGraphBuilder(
- Isolate* isolate, Graph* graph, CommonOperatorBuilder* common,
- MachineOperatorBuilder* machine, SimplifiedOperatorBuilder* simplified)
- : GraphBuilder(isolate, graph),
- effect_(NULL),
- return_(NULL),
- common_(common),
- machine_(machine),
- simplified_(simplified) {}
-
-
-void SimplifiedGraphBuilder::Begin(int num_parameters) {
- DCHECK(graph()->start() == NULL);
- Node* start = graph()->NewNode(common()->Start(num_parameters + 3));
- graph()->SetStart(start);
- effect_ = start;
-}
-
-
-void SimplifiedGraphBuilder::Return(Node* value) {
- return_ =
- graph()->NewNode(common()->Return(), value, effect_, graph()->start());
- effect_ = NULL;
-}
-
-
-void SimplifiedGraphBuilder::End() {
- Node* end = graph()->NewNode(common()->End(1), return_);
- graph()->SetEnd(end);
-}
-
-
-Node* SimplifiedGraphBuilder::MakeNode(const Operator* op,
- int value_input_count,
- Node** value_inputs, bool incomplete) {
- DCHECK(op->ValueInputCount() == value_input_count);
-
- DCHECK(!OperatorProperties::HasContextInput(op));
- DCHECK_EQ(0, OperatorProperties::GetFrameStateInputCount(op));
- bool has_control = op->ControlInputCount() == 1;
- bool has_effect = op->EffectInputCount() == 1;
-
- DCHECK(op->ControlInputCount() < 2);
- DCHECK(op->EffectInputCount() < 2);
-
- Node* result = NULL;
- if (!has_control && !has_effect) {
- result = graph()->NewNode(op, value_input_count, value_inputs, incomplete);
- } else {
- int input_count_with_deps = value_input_count;
- if (has_control) ++input_count_with_deps;
- if (has_effect) ++input_count_with_deps;
- Node** buffer = zone()->NewArray<Node*>(input_count_with_deps);
- memcpy(buffer, value_inputs, kPointerSize * value_input_count);
- Node** current_input = buffer + value_input_count;
- if (has_effect) {
- *current_input++ = effect_;
- }
- if (has_control) {
- *current_input++ = graph()->start();
- }
- result = graph()->NewNode(op, input_count_with_deps, buffer, incomplete);
- if (has_effect) {
- effect_ = result;
- }
- // This graph builder does not support control flow.
- CHECK_EQ(0, op->ControlOutputCount());
- }
-
- return result;
-}
-
-} // namespace compiler
-} // namespace internal
-} // namespace v8
« no previous file with comments | « test/cctest/compiler/simplified-graph-builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698