Reviewers: Kasper Lund, Mads Ager,

Message:
Added reviewers.  Hopefully this doesn't send a duplicate mail.

Description:
Cleanup to HEnvironment::CopyForInlining

* src/hydrogen.cc (HEnvironment::CopyForInlining): As the code for both
  the ::HYDROGEN and ::LITHIUM compilation phases is the same, just use
  one code path and remove the arg.

* src/hydrogen.h (HEnvironment): Remove now-unused CompilationPhase
  enum type and arg to CopyForInlining.

* src/arm/lithium-arm.cc (LChunkBuilder::DoEnterInlined):
* src/ia32/lithium-ia32.cc (LChunkBuilder::DoEnterInlined):
* src/x64/lithium-x64.cc (LChunkBuilder::DoEnterInlined): Adapt
  callers.

* AUTHORS: Add Igalia.

BUG=
TEST=I ran tools/test.py.


Please review this at http://codereview.chromium.org/7272002/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M AUTHORS
  M src/arm/lithium-arm.cc
  M src/hydrogen.h
  M src/hydrogen.cc
  M src/ia32/lithium-ia32.cc
  M src/x64/lithium-x64.cc


Index: AUTHORS
diff --git a/AUTHORS b/AUTHORS
index 60d5998e5e8ed48081932193fb679baee526663b..d2dab733d21a5c1cbf443ee8bce0f9832a501cc9 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,6 +7,7 @@ Google Inc.
 Sigma Designs Inc.
 ARM Ltd.
 Hewlett-Packard Development Company, LP
+Igalia, S.L.

 Akinori MUSHA <[email protected]>
 Alexander Botero-Lowry <[email protected]>
Index: src/arm/lithium-arm.cc
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
index 141b555adae7d91035f152db5dc129f202bbb55a..9849f4a094018a6c3b9b4a3ad811ab451cdc386d 100644
--- a/src/arm/lithium-arm.cc
+++ b/src/arm/lithium-arm.cc
@@ -2217,7 +2217,6 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
   HConstant* undefined = graph()->GetConstantUndefined();
   HEnvironment* inner = outer->CopyForInlining(instr->closure(),
                                                instr->function(),
-                                               HEnvironment::LITHIUM,
                                                undefined,
                                                instr->call_kind());
   current_block_->UpdateEnvironment(inner);
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 64bca9ed1b45fe4e03266af1f30a0f84c372cf9d..5e6b42ebd7c36ee9b0ad346ca2a77faf6750e924 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4449,7 +4449,6 @@ bool HGraphBuilder::TryInline(Call* expr) {
   HEnvironment* inner_env =
       environment()->CopyForInlining(target,
                                      function,
-                                     HEnvironment::HYDROGEN,
                                      undefined,
                                      call_kind);
   HBasicBlock* body_entry = CreateBasicBlock(inner_env);
@@ -6212,7 +6211,6 @@ HEnvironment* HEnvironment::CopyAsLoopHeader(HBasicBlock* loop_header) const {
 HEnvironment* HEnvironment::CopyForInlining(
     Handle<JSFunction> target,
     FunctionLiteral* function,
-    CompilationPhase compilation_phase,
     HConstant* undefined,
     CallKind call_kind) const {
   // Outer environment is a copy of this one without the arguments.
@@ -6224,17 +6222,9 @@ HEnvironment* HEnvironment::CopyForInlining(
   HEnvironment* inner =
       new(zone) HEnvironment(outer, function->scope(), target);
   // Get the argument values from the original environment.
-  if (compilation_phase == HYDROGEN) {
-    for (int i = 0; i <= arity; ++i) {  // Include receiver.
-      HValue* push = ExpressionStackAt(arity - i);
-      inner->SetValueAt(i, push);
-    }
-  } else {
-    ASSERT(compilation_phase == LITHIUM);
-    for (int i = 0; i <= arity; ++i) {  // Include receiver.
-      HValue* push = ExpressionStackAt(arity - i);
-      inner->SetValueAt(i, push);
-    }
+  for (int i = 0; i <= arity; ++i) {  // Include receiver.
+    HValue* push = ExpressionStackAt(arity - i);
+    inner->SetValueAt(i, push);
   }
   // If the function we are inlining is a strict mode function or a
   // builtin function, pass undefined as the receiver for function
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index d8192b2dae68eb6f612c2e0e7fd671c45c1d9fc8..88413ed9d251b60cc924e3fa38b9b0893c6e0f91 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -329,8 +329,6 @@ Zone* HBasicBlock::zone() { return graph_->zone(); }

 class HEnvironment: public ZoneObject {
  public:
-  enum CompilationPhase { HYDROGEN, LITHIUM };
-
   HEnvironment(HEnvironment* outer,
                Scope* scope,
                Handle<JSFunction> closure);
@@ -417,12 +415,9 @@ class HEnvironment: public ZoneObject {

   // Create an "inlined version" of this environment, where the original
   // environment is the outer environment but the top expression stack
-  // elements are moved to an inner environment as parameters. If
-  // is_speculative, the argument values are expected to be PushArgument
-  // instructions, otherwise they are the actual values.
+  // elements are moved to an inner environment as parameters.
   HEnvironment* CopyForInlining(Handle<JSFunction> target,
                                 FunctionLiteral* function,
-                                CompilationPhase compilation_phase,
                                 HConstant* undefined,
                                 CallKind call_kind) const;

Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index 6b9178d70e587e421f12f60c5fd2ff147d42aa92..99819913894d07401965c02d35b9f563fe8abc28 100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -2267,7 +2267,6 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
   HConstant* undefined = graph()->GetConstantUndefined();
   HEnvironment* inner = outer->CopyForInlining(instr->closure(),
                                                instr->function(),
-                                               HEnvironment::LITHIUM,
                                                undefined,
                                                instr->call_kind());
   current_block_->UpdateEnvironment(inner);
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index 3151ce3678ae47a04d75fb4d2c513dfa231fdfa5..42e60c3d906fa679f3d0378613e3de98afb7b5a3 100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -2208,7 +2208,6 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
   HConstant* undefined = graph()->GetConstantUndefined();
   HEnvironment* inner = outer->CopyForInlining(instr->closure(),
                                                instr->function(),
-                                               HEnvironment::LITHIUM,
                                                undefined,
                                                instr->call_kind());
   current_block_->UpdateEnvironment(inner);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to