Revision: 5993
Author: [email protected]
Date: Mon Dec 13 09:49:55 2010
Log: Fix ARM and x64 compilation.

Fix compilation on ARM and x64 due to a change in the architecture-shared
API of the nonoptimizing code generator.  Also added new PrepareForBailout
to ARM (they are not yet fully implemented on x64).

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

Modified:
 /branches/bleeding_edge/src/arm/full-codegen-arm.cc
 /branches/bleeding_edge/src/x64/full-codegen-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Tue Dec 7 03:31:57 2010 +++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Mon Dec 13 09:49:55 2010
@@ -890,7 +890,9 @@
   __ bind(&update_each);
   __ mov(result_register(), r3);
   // Perform the assignment as if via '='.
-  EmitAssignment(stmt->each());
+  { EffectContext context(this);
+    EmitAssignment(stmt->each(), stmt->AssignmentId());
+  }

   // Generate code for the body of the loop.
   Visit(stmt->body());
@@ -1444,7 +1446,7 @@
     // For property compound assignments we need another deoptimization
     // point after the property load.
     if (property != NULL) {
-      PrepareForBailoutForId(expr->compound_bailout_id(), TOS_REG);
+      PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
     }

     Token::Value op = expr->binary_op();
@@ -1536,7 +1538,7 @@
 }


-void FullCodeGenerator::EmitAssignment(Expression* expr) {
+void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
   // Invalid left-hand sides are rewritten to have a 'throw
   // ReferenceError' on the left-hand side.
   if (!expr->IsValidLeftHandSide()) {
@@ -1584,6 +1586,8 @@
       break;
     }
   }
+  PrepareForBailoutForId(bailout_ast_id, TOS_REG);
+  context()->Plug(r0);
 }


@@ -1657,8 +1661,6 @@
     }
     __ bind(&done);
   }
-
-  context()->Plug(result_register());
 }


@@ -1701,10 +1703,10 @@
     __ push(ip);
     __ CallRuntime(Runtime::kToFastProperties, 1);
     __ pop(r0);
-    context()->DropAndPlug(1, r0);
-  } else {
-    context()->Plug(r0);
-  }
+    __ Drop(1);
+  }
+  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+  context()->Plug(r0);
 }


@@ -1745,10 +1747,10 @@
     __ push(ip);
     __ CallRuntime(Runtime::kToFastProperties, 1);
     __ pop(r0);
-    context()->DropAndPlug(1, r0);
-  } else {
-    context()->Plug(r0);
-  }
+    __ Drop(1);
+  }
+  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+  context()->Plug(r0);
 }


@@ -3200,6 +3202,8 @@
         { EffectContext context(this);
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
                                  Token::ASSIGN);
+          PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+          context.Plug(r0);
         }
         // For all contexts except EffectConstant We have the result on
         // top of the stack.
@@ -3209,6 +3213,8 @@
       } else {
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
                                Token::ASSIGN);
+        PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+        context()->Plug(r0);
       }
       break;
     case NAMED_PROPERTY: {
@@ -3216,6 +3222,7 @@
       __ pop(r1);
       Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
       EmitCallIC(ic, RelocInfo::CODE_TARGET);
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
       if (expr->is_postfix()) {
         if (!context()->IsEffect()) {
           context()->PlugTOS();
@@ -3230,6 +3237,7 @@
       __ pop(r2);  // Receiver.
Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
       EmitCallIC(ic, RelocInfo::CODE_TARGET);
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
       if (expr->is_postfix()) {
         if (!context()->IsEffect()) {
           context()->PlugTOS();
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Tue Dec 7 03:31:57 2010 +++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Mon Dec 13 09:49:55 2010
@@ -839,7 +839,9 @@
   __ bind(&update_each);
   __ movq(result_register(), rbx);
   // Perform the assignment as if via '='.
-  EmitAssignment(stmt->each());
+  { EffectContext context(this);
+    EmitAssignment(stmt->each(), stmt->AssignmentId());
+  }

   // Generate code for the body of the loop.
   Visit(stmt->body());
@@ -1521,7 +1523,7 @@
 }


-void FullCodeGenerator::EmitAssignment(Expression* expr) {
+void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_id) {
   // Invalid left-hand sides are rewritten to have a 'throw
   // ReferenceError' on the left-hand side.
   if (!expr->IsValidLeftHandSide()) {
@@ -1569,6 +1571,7 @@
       break;
     }
   }
+  context()->Plug(rax);
 }


@@ -1641,8 +1644,6 @@
     }
     __ bind(&done);
   }
-
-  context()->Plug(rax);
 }


@@ -1679,10 +1680,9 @@
     __ push(Operand(rsp, kPointerSize));  // Receiver is under value.
     __ CallRuntime(Runtime::kToFastProperties, 1);
     __ pop(rax);
-    context()->DropAndPlug(1, rax);
-  } else {
-    context()->Plug(rax);
-  }
+    __ Drop(1);
+  }
+  context()->Plug(rax);
 }


@@ -3127,6 +3127,7 @@
         { EffectContext context(this);
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
                                  Token::ASSIGN);
+          context.Plug(rax);
         }
         // For all contexts except kEffect: We have the result on
         // top of the stack.
@@ -3137,6 +3138,7 @@
         // Perform the assignment as if via '='.
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
                                Token::ASSIGN);
+        context()->Plug(rax);
       }
       break;
     case NAMED_PROPERTY: {

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

Reply via email to