HEnvironmentMarker factory added
authorishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 21 Oct 2013 14:18:55 +0000 (14:18 +0000)
committerishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 21 Oct 2013 14:18:55 +0000 (14:18 +0000)
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/32513002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen-instructions.h
src/hydrogen.h

index de8e19a..993f79c 100644 (file)
@@ -1776,8 +1776,7 @@ class HEnvironmentMarker V8_FINAL : public HTemplateInstruction<1> {
  public:
   enum Kind { BIND, LOOKUP };
 
-  HEnvironmentMarker(Kind kind, int index)
-      : kind_(kind), index_(index), next_simulate_(NULL) { }
+  DECLARE_INSTRUCTION_FACTORY_P2(HEnvironmentMarker, Kind, int);
 
   Kind kind() { return kind_; }
   int index() { return index_; }
@@ -1804,6 +1803,9 @@ class HEnvironmentMarker V8_FINAL : public HTemplateInstruction<1> {
   DECLARE_CONCRETE_INSTRUCTION(EnvironmentMarker);
 
  private:
+  HEnvironmentMarker(Kind kind, int index)
+      : kind_(kind), index_(index), next_simulate_(NULL) { }
+
   Kind kind_;
   int index_;
   HSimulate* next_simulate_;
index edd9280..e671692 100644 (file)
@@ -1948,7 +1948,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
     env->Bind(index, value);
     if (IsEligibleForEnvironmentLivenessAnalysis(var, index, value, env)) {
       HEnvironmentMarker* bind =
-          new(zone()) HEnvironmentMarker(HEnvironmentMarker::BIND, index);
+          New<HEnvironmentMarker>(HEnvironmentMarker::BIND, index);
       AddInstruction(bind);
 #ifdef DEBUG
       bind->set_closure(env->closure());
@@ -1961,7 +1961,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
     HValue* value = env->Lookup(index);
     if (IsEligibleForEnvironmentLivenessAnalysis(var, index, value, env)) {
       HEnvironmentMarker* lookup =
-          new(zone()) HEnvironmentMarker(HEnvironmentMarker::LOOKUP, index);
+          New<HEnvironmentMarker>(HEnvironmentMarker::LOOKUP, index);
       AddInstruction(lookup);
 #ifdef DEBUG
       lookup->set_closure(env->closure());