Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / v8 / src / compiler / graph.h
index 65ea3b3..07eb02f 100644 (file)
@@ -25,39 +25,36 @@ class Graph : public GenericGraph<Node> {
   explicit Graph(Zone* zone);
 
   // Base implementation used by all factory methods.
-  Node* NewNode(Operator* op, int input_count, Node** inputs);
+  Node* NewNode(const Operator* op, int input_count, Node** inputs);
 
   // Factories for nodes with static input counts.
-  Node* NewNode(Operator* op) {
+  Node* NewNode(const Operator* op) {
     return NewNode(op, 0, static_cast<Node**>(NULL));
   }
-  Node* NewNode(Operator* op, Node* n1) { return NewNode(op, 1, &n1); }
-  Node* NewNode(Operator* op, Node* n1, Node* n2) {
+  Node* NewNode(const Operator* op, Node* n1) { return NewNode(op, 1, &n1); }
+  Node* NewNode(const Operator* op, Node* n1, Node* n2) {
     Node* nodes[] = {n1, n2};
-    return NewNode(op, ARRAY_SIZE(nodes), nodes);
+    return NewNode(op, arraysize(nodes), nodes);
   }
-  Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3) {
+  Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) {
     Node* nodes[] = {n1, n2, n3};
-    return NewNode(op, ARRAY_SIZE(nodes), nodes);
+    return NewNode(op, arraysize(nodes), nodes);
   }
-  Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) {
+  Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) {
     Node* nodes[] = {n1, n2, n3, n4};
-    return NewNode(op, ARRAY_SIZE(nodes), nodes);
+    return NewNode(op, arraysize(nodes), nodes);
   }
-  Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
+  Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
                 Node* n5) {
     Node* nodes[] = {n1, n2, n3, n4, n5};
-    return NewNode(op, ARRAY_SIZE(nodes), nodes);
+    return NewNode(op, arraysize(nodes), nodes);
   }
-  Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, Node* n5,
-                Node* n6) {
+  Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
+                Node* n5, Node* n6) {
     Node* nodes[] = {n1, n2, n3, n4, n5, n6};
-    return NewNode(op, ARRAY_SIZE(nodes), nodes);
+    return NewNode(op, arraysize(nodes), nodes);
   }
 
-  void ChangeOperator(Node* node, Operator* op);
-  void DeleteNode(Node* node);
-
   template <class Visitor>
   void VisitNodeUsesFrom(Node* node, Visitor* visitor);
 
@@ -72,16 +69,14 @@ class Graph : public GenericGraph<Node> {
   }
 
   void RemoveDecorator(GraphDecorator* decorator) {
-    DecoratorVector::iterator it =
+    ZoneVector<GraphDecorator*>::iterator it =
         std::find(decorators_.begin(), decorators_.end(), decorator);
     DCHECK(it != decorators_.end());
     decorators_.erase(it, it + 1);
   }
 
  private:
-  typedef std::vector<GraphDecorator*, zone_allocator<GraphDecorator*> >
-      DecoratorVector;
-  DecoratorVector decorators_;
+  ZoneVector<GraphDecorator*> decorators_;
 };
 
 
@@ -90,8 +85,9 @@ class GraphDecorator : public ZoneObject {
   virtual ~GraphDecorator() {}
   virtual void Decorate(Node* node) = 0;
 };
-}
-}
-}  // namespace v8::internal::compiler
+
+}  // namespace compiler
+}  // namespace internal
+}  // namespace v8
 
 #endif  // V8_COMPILER_GRAPH_H_