Reviewers: jarin,

Description:
[turbofan] Inline hot functions for NodeMarkerBase.

R=ja...@chromium.org

Please review this at https://codereview.chromium.org/1184693002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+18, -32 lines):
  M src/compiler/node-marker.h
  M src/compiler/node-marker.cc


Index: src/compiler/node-marker.cc
diff --git a/src/compiler/node-marker.cc b/src/compiler/node-marker.cc
index fb7c1e192abb64ccb293d2cef67471cf18335471..3e56a11271a3ec0120ea820a7f1b0751ae47f269 100644
--- a/src/compiler/node-marker.cc
+++ b/src/compiler/node-marker.cc
@@ -5,7 +5,6 @@
 #include "src/compiler/node-marker.h"

 #include "src/compiler/graph.h"
-#include "src/compiler/node.h"

 namespace v8 {
 namespace internal {
@@ -18,24 +17,6 @@ NodeMarkerBase::NodeMarkerBase(Graph* graph, uint32_t num_states)
 }


-Mark NodeMarkerBase::Get(Node* node) {
-  Mark mark = node->mark();
-  if (mark < mark_min_) {
-    mark = mark_min_;
-    node->set_mark(mark_min_);
-  }
-  DCHECK_LT(mark, mark_max_);
-  return mark - mark_min_;
-}
-
-
-void NodeMarkerBase::Set(Node* node, Mark mark) {
-  DCHECK_LT(mark, mark_max_ - mark_min_);
-  DCHECK_LT(node->mark(), mark_max_);
-  node->set_mark(mark + mark_min_);
-}
-
-
 void NodeMarkerBase::Reset(Graph* graph) {
   uint32_t const num_states = mark_max_ - mark_min_;
   mark_min_ = graph->mark_max_;
Index: src/compiler/node-marker.h
diff --git a/src/compiler/node-marker.h b/src/compiler/node-marker.h
index 853ba2228814ba8d0032428c1b81f1fec7ea1714..9ce03b054b48a4167ca54e79ef9f03c96cf42cdf 100644
--- a/src/compiler/node-marker.h
+++ b/src/compiler/node-marker.h
@@ -5,7 +5,7 @@
 #ifndef V8_COMPILER_NODE_MARKER_H_
 #define V8_COMPILER_NODE_MARKER_H_

-#include "src/base/macros.h"
+#include "src/compiler/node.h"

 namespace v8 {
 namespace internal {
@@ -13,13 +13,6 @@ namespace compiler {

 // Forward declarations.
 class Graph;
-class Node;
-
-
-// Marks are used during traversal of the graph to distinguish states of nodes.
-// Each node has a mark which is a monotonically increasing integer, and a
-// {NodeMarker} has a range of values that indicate states of a node.
-typedef uint32_t Mark;


 // Base class for templatized NodeMarkers.
@@ -27,8 +20,20 @@ class NodeMarkerBase {
  public:
   NodeMarkerBase(Graph* graph, uint32_t num_states);

-  Mark Get(Node* node);
-  void Set(Node* node, Mark mark);
+  V8_INLINE Mark Get(Node* node) {
+    Mark mark = node->mark();
+    if (mark < mark_min_) {
+      mark = mark_min_;
+      node->set_mark(mark_min_);
+    }
+    DCHECK_LT(mark, mark_max_);
+    return mark - mark_min_;
+  }
+  V8_INLINE void Set(Node* node, Mark mark) {
+    DCHECK_LT(mark, mark_max_ - mark_min_);
+    DCHECK_LT(node->mark(), mark_max_);
+    node->set_mark(mark + mark_min_);
+  }
   void Reset(Graph* graph);

  private:
@@ -44,14 +49,14 @@ class NodeMarkerBase {
 template <typename State>
 class NodeMarker : public NodeMarkerBase {
  public:
-  NodeMarker(Graph* graph, uint32_t num_states)
+  V8_INLINE NodeMarker(Graph* graph, uint32_t num_states)
       : NodeMarkerBase(graph, num_states) {}

-  State Get(Node* node) {
+  V8_INLINE State Get(Node* node) {
     return static_cast<State>(NodeMarkerBase::Get(node));
   }

-  void Set(Node* node, State state) {
+  V8_INLINE void Set(Node* node, State state) {
     NodeMarkerBase::Set(node, static_cast<Mark>(state));
   }
 };


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to