Revision: 9340
Author:   [email protected]
Date:     Tue Sep 20 04:32:40 2011
Log:      Merge svn revision 9331 to the 3.4 branch.

This fixes a bug that can give incorrect JavaScript results when
deoptimizing from inside an inlined function body.

[email protected]
BUG=
TEST=

Review URL: http://codereview.chromium.org/7979003
http://code.google.com/p/v8/source/detail?r=9340

Modified:
 /branches/3.4/src/arm/lithium-arm.cc
 /branches/3.4/src/arm/lithium-arm.h
 /branches/3.4/src/deoptimizer.cc
 /branches/3.4/src/ia32/lithium-ia32.cc
 /branches/3.4/src/ia32/lithium-ia32.h
 /branches/3.4/src/objects.cc
 /branches/3.4/src/version.cc
 /branches/3.4/src/x64/lithium-x64.cc
 /branches/3.4/src/x64/lithium-x64.h

=======================================
--- /branches/3.4/src/arm/lithium-arm.cc        Wed Jul 20 06:44:42 2011
+++ /branches/3.4/src/arm/lithium-arm.cc        Tue Sep 20 04:32:40 2011
@@ -710,7 +710,9 @@

 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
   HEnvironment* hydrogen_env = current_block_->last_environment();
-  instr->set_environment(CreateEnvironment(hydrogen_env));
+  int argument_index_accumulator = 0;
+  instr->set_environment(CreateEnvironment(hydrogen_env,
+                                           &argument_index_accumulator));
   return instr;
 }

@@ -993,10 +995,13 @@
 }


-LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
+LEnvironment* LChunkBuilder::CreateEnvironment(
+    HEnvironment* hydrogen_env,
+    int* argument_index_accumulator) {
   if (hydrogen_env == NULL) return NULL;

-  LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
+  LEnvironment* outer =
+      CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator);
   int ast_id = hydrogen_env->ast_id();
   ASSERT(ast_id != AstNode::kNoNumber);
   int value_count = hydrogen_env->length();
@@ -1006,7 +1011,6 @@
                                           argument_count_,
                                           value_count,
                                           outer);
-  int argument_index = 0;
   for (int i = 0; i < value_count; ++i) {
     if (hydrogen_env->is_special_index(i)) continue;

@@ -1015,7 +1019,7 @@
     if (value->IsArgumentsObject()) {
       op = NULL;
     } else if (value->IsPushArgument()) {
-      op = new LArgument(argument_index++);
+      op = new LArgument((*argument_index_accumulator)++);
     } else {
       op = UseAny(value);
     }
=======================================
--- /branches/3.4/src/arm/lithium-arm.h Wed Jul 20 06:44:42 2011
+++ /branches/3.4/src/arm/lithium-arm.h Tue Sep 20 04:32:40 2011
@@ -2170,7 +2170,8 @@
       LInstruction* instr, int ast_id);
   void ClearInstructionPendingDeoptimizationEnvironment();

-  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
+  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env,
+                                  int* argument_index_accumulator);

   void VisitInstruction(HInstruction* current);

=======================================
--- /branches/3.4/src/deoptimizer.cc    Wed Jul 20 06:44:42 2011
+++ /branches/3.4/src/deoptimizer.cc    Tue Sep 20 04:32:40 2011
@@ -613,11 +613,13 @@
       intptr_t input_value = input_->GetRegister(input_reg);
       if (FLAG_trace_deopt) {
         PrintF(
- " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; %s\n", + " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; %s ",
             output_[frame_index]->GetTop() + output_offset,
             output_offset,
             input_value,
             converter.NameOfCPURegister(input_reg));
+        reinterpret_cast<Object*>(input_value)->ShortPrint();
+        PrintF("\n");
       }
       output_[frame_index]->SetFrameSlot(output_offset, input_value);
       return;
@@ -675,10 +677,12 @@
       if (FLAG_trace_deopt) {
         PrintF("    0x%08" V8PRIxPTR ": ",
                output_[frame_index]->GetTop() + output_offset);
-        PrintF("[top + %d] <- 0x%08" V8PRIxPTR " ; [esp + %d]\n",
+        PrintF("[top + %d] <- 0x%08" V8PRIxPTR " ; [esp + %d] ",
                output_offset,
                input_value,
                input_offset);
+        reinterpret_cast<Object*>(input_value)->ShortPrint();
+        PrintF("\n");
       }
       output_[frame_index]->SetFrameSlot(output_offset, input_value);
       return;
=======================================
--- /branches/3.4/src/ia32/lithium-ia32.cc      Wed Jul 20 06:44:42 2011
+++ /branches/3.4/src/ia32/lithium-ia32.cc      Tue Sep 20 04:32:40 2011
@@ -706,7 +706,9 @@

 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
   HEnvironment* hydrogen_env = current_block_->last_environment();
-  instr->set_environment(CreateEnvironment(hydrogen_env));
+  int argument_index_accumulator = 0;
+  instr->set_environment(CreateEnvironment(hydrogen_env,
+                                           &argument_index_accumulator));
   return instr;
 }

@@ -993,10 +995,13 @@
 }


-LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
+LEnvironment* LChunkBuilder::CreateEnvironment(
+    HEnvironment* hydrogen_env,
+    int* argument_index_accumulator) {
   if (hydrogen_env == NULL) return NULL;

-  LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
+  LEnvironment* outer =
+      CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator);
   int ast_id = hydrogen_env->ast_id();
   ASSERT(ast_id != AstNode::kNoNumber);
   int value_count = hydrogen_env->length();
@@ -1006,7 +1011,6 @@
                                           argument_count_,
                                           value_count,
                                           outer);
-  int argument_index = 0;
   for (int i = 0; i < value_count; ++i) {
     if (hydrogen_env->is_special_index(i)) continue;

@@ -1015,7 +1019,7 @@
     if (value->IsArgumentsObject()) {
       op = NULL;
     } else if (value->IsPushArgument()) {
-      op = new LArgument(argument_index++);
+      op = new LArgument((*argument_index_accumulator)++);
     } else {
       op = UseAny(value);
     }
=======================================
--- /branches/3.4/src/ia32/lithium-ia32.h       Wed Jul 20 06:44:42 2011
+++ /branches/3.4/src/ia32/lithium-ia32.h       Tue Sep 20 04:32:40 2011
@@ -2265,7 +2265,8 @@
       LInstruction* instr, int ast_id);
   void ClearInstructionPendingDeoptimizationEnvironment();

-  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
+  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env,
+                                  int* argument_index_accumulator);

   void VisitInstruction(HInstruction* current);

=======================================
--- /branches/3.4/src/objects.cc        Mon Sep 12 04:26:01 2011
+++ /branches/3.4/src/objects.cc        Tue Sep 20 04:32:40 2011
@@ -1009,7 +1009,6 @@
                        global_object ? "Global Object: " : "",
                        vowel ? "n" : "");
                 accumulator->Put(str);
-                accumulator->Put('>');
                 printed = true;
               }
             }
=======================================
--- /branches/3.4/src/version.cc        Mon Sep 12 04:26:01 2011
+++ /branches/3.4/src/version.cc        Tue Sep 20 04:32:40 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     4
 #define BUILD_NUMBER      14
-#define PATCH_LEVEL       21
+#define PATCH_LEVEL       22
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
=======================================
--- /branches/3.4/src/x64/lithium-x64.cc        Wed Jul 20 06:44:42 2011
+++ /branches/3.4/src/x64/lithium-x64.cc        Tue Sep 20 04:32:40 2011
@@ -705,7 +705,9 @@

 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
   HEnvironment* hydrogen_env = current_block_->last_environment();
-  instr->set_environment(CreateEnvironment(hydrogen_env));
+  int argument_index_accumulator = 0;
+  instr->set_environment(CreateEnvironment(hydrogen_env,
+                                           &argument_index_accumulator));
   return instr;
 }

@@ -988,10 +990,13 @@
 }


-LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
+LEnvironment* LChunkBuilder::CreateEnvironment(
+    HEnvironment* hydrogen_env,
+    int* argument_index_accumulator) {
   if (hydrogen_env == NULL) return NULL;

-  LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
+  LEnvironment* outer =
+      CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator);
   int ast_id = hydrogen_env->ast_id();
   ASSERT(ast_id != AstNode::kNoNumber);
   int value_count = hydrogen_env->length();
@@ -1001,7 +1006,6 @@
                                           argument_count_,
                                           value_count,
                                           outer);
-  int argument_index = 0;
   for (int i = 0; i < value_count; ++i) {
     if (hydrogen_env->is_special_index(i)) continue;

@@ -1010,7 +1014,7 @@
     if (value->IsArgumentsObject()) {
       op = NULL;
     } else if (value->IsPushArgument()) {
-      op = new LArgument(argument_index++);
+      op = new LArgument((*argument_index_accumulator)++);
     } else {
       op = UseAny(value);
     }
=======================================
--- /branches/3.4/src/x64/lithium-x64.h Wed Jul 20 06:44:42 2011
+++ /branches/3.4/src/x64/lithium-x64.h Tue Sep 20 04:32:40 2011
@@ -2153,7 +2153,8 @@
       LInstruction* instr, int ast_id);
   void ClearInstructionPendingDeoptimizationEnvironment();

-  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
+  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env,
+                                  int* argument_index_accumulator);

   void VisitInstruction(HInstruction* current);

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

Reply via email to