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

Unified Diff: src/compiler/graph.cc

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: src/compiler/graph.cc
diff --git a/src/compiler/graph.cc b/src/compiler/graph.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c22c5059ab76b9a5eb60d0b8c0c52ca62921dee7
--- /dev/null
+++ b/src/compiler/graph.cc
@@ -0,0 +1,55 @@
+// Copyright 2013 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 "src/compiler/graph.h"
+
+#include "src/compiler/common-operator.h"
+#include "src/compiler/generic-node-inl.h"
+#include "src/compiler/graph-inl.h"
+#include "src/compiler/node.h"
+#include "src/compiler/node-aux-data-inl.h"
+#include "src/compiler/node-properties.h"
+#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/operator-properties.h"
+#include "src/compiler/operator-properties-inl.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+Graph::Graph(Zone* zone)
+ : GenericGraph(zone),
+ decorators_(DecoratorVector::allocator_type(zone)) {}
+
+
+Node* Graph::NewNode(Operator* op, int input_count, Node** inputs) {
+ ASSERT(op->InputCount() <= input_count);
+ Node* result = Node::New(this, input_count, inputs);
+ result->Initialize(op);
+ for (DecoratorVector::iterator i = decorators_.begin();
+ i != decorators_.end(); ++i) {
+ (*i)->Decorate(result);
+ }
+ return result;
+}
+
+
+void Graph::ChangeOperator(Node* node, Operator* op) {
+ node->set_op(op);
+}
+
+
+void Graph::DeleteNode(Node* node) {
+#if DEBUG
+ // Nodes can't be deleted if they have uses.
+ Node::Uses::iterator use_iterator(node->uses().begin());
+ ASSERT(use_iterator == node->uses().end());
+#endif
+
+#if DEBUG
+ memset(node, 0xDE, sizeof(Node));
+#endif
+}
+
+} } } // namespace v8::internal::compiler
« no previous file with comments | « src/compiler/graph.h ('k') | src/compiler/graph-builder.h » ('j') | src/lithium-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698