Revision: 7673
Author:   [email protected]
Date:     Wed Apr 20 02:44:50 2011
Log:      Version 3.3.1

Reduced V8 binary size by removing virtual functions from hydrogen.

Fixed crash bug on x64.

Performance improvements on ARM and IA32.

http://code.google.com/p/v8/source/detail?r=7673

Added:
 /trunk/test/mjsunit/regress/regress-1337.js
Modified:
 /trunk
 /trunk/ChangeLog
 /trunk/src/arm/lithium-codegen-arm.cc
 /trunk/src/arm/macro-assembler-arm.cc
 /trunk/src/arm/simulator-arm.cc
 /trunk/src/arm/simulator-arm.h
 /trunk/src/ast.cc
 /trunk/src/date.js
 /trunk/src/debug-debugger.js
 /trunk/src/hydrogen-instructions.cc
 /trunk/src/hydrogen-instructions.h
 /trunk/src/ia32/lithium-gap-resolver-ia32.cc
 /trunk/src/json.js
 /trunk/src/lithium-allocator.cc
 /trunk/src/messages.cc
 /trunk/src/mirror-debugger.js
 /trunk/src/regexp-macro-assembler-irregexp-inl.h
 /trunk/src/regexp.js
 /trunk/src/version.cc
 /trunk/test/cctest/cctest.status
 /trunk/test/cctest/test-api.cc
 /trunk/test/cctest/test-assembler-arm.cc
 /trunk/test/mjsunit/array-constructor.js
 /trunk/test/mjsunit/array-functions-prototype-misc.js
 /trunk/test/mjsunit/global-load-from-eval-in-with.js
 /trunk/test/mjsunit/local-load-from-eval.js
 /trunk/test/mjsunit/property-load-across-eval.js
 /trunk/test/mjsunit/regress/regress-269.js
 /trunk/test/mjsunit/regress/regress-334.js

=======================================
--- /dev/null
+++ /trunk/test/mjsunit/regress/regress-1337.js Wed Apr 20 02:44:50 2011
@@ -0,0 +1,40 @@
+// Copyright 2011 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax
+
+// Test that the throw is not inlined if object literals cannot be
+// inlined.
+function bar() { throw {}; }
+
+function foo() { bar(); }
+
+for (var i = 0; i < 5; ++i) {
+    try { foo() } catch (e) { }
+}
+%OptimizeFunctionOnNextCall(foo)
+try { foo() } catch (e) { }
=======================================
--- /trunk/ChangeLog    Mon Apr 18 08:51:38 2011
+++ /trunk/ChangeLog    Wed Apr 20 02:44:50 2011
@@ -1,3 +1,12 @@
+2011-04-20: Version 3.3.1
+
+        Reduced V8 binary size by removing virtual functions from hydrogen.
+
+        Fixed crash bug on x64.
+
+        Performance improvements on ARM and IA32.
+
+
 2011-04-18: Version 3.3.0

         Fixed bug in floating point rounding in Crankshaft on ARM
=======================================
--- /trunk/src/arm/lithium-codegen-arm.cc       Mon Apr 18 08:51:38 2011
+++ /trunk/src/arm/lithium-codegen-arm.cc       Wed Apr 20 02:44:50 2011
@@ -3614,10 +3614,13 @@
   LOperand* input = instr->InputAt(0);
   ASSERT(input->IsRegister() && input->Equals(instr->result()));
   if (instr->needs_check()) {
-    __ tst(ToRegister(input), Operand(kSmiTagMask));
-    DeoptimizeIf(ne, instr->environment());
-  }
-  __ SmiUntag(ToRegister(input));
+    ASSERT(kHeapObjectTag == 1);
+    // If the input is a HeapObject, SmiUntag will set the carry flag.
+    __ SmiUntag(ToRegister(input), SetCC);
+    DeoptimizeIf(cs, instr->environment());
+  } else {
+    __ SmiUntag(ToRegister(input));
+  }
 }


@@ -3688,6 +3691,12 @@

   Label done;

+  // The input was optimistically untagged; revert it.
+ // The carry flag is set when we reach this deferred code as we just executed
+  // SmiUntag(heap_object, SetCC)
+  ASSERT(kHeapObjectTag == 1);
+  __ adc(input_reg, input_reg, Operand(input_reg));
+
   // Heap number map check.
   __ ldr(scratch1, FieldMemOperand(input_reg, HeapObject::kMapOffset));
   __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
@@ -3760,13 +3769,12 @@

   DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr);

-  // Smi check.
-  __ tst(input_reg, Operand(kSmiTagMask));
-  __ b(ne, deferred->entry());
-
-  // Smi to int32 conversion
-  __ SmiUntag(input_reg);  // Untag smi.
-
+  // Optimistically untag the input.
+  // If the input is a HeapObject, SmiUntag will set the carry flag.
+  __ SmiUntag(input_reg, SetCC);
+  // Branch to deferred code if the input was tagged.
+  // The deferred code will take care of restoring the tag.
+  __ b(cs, deferred->entry());
   __ bind(deferred->exit());
 }

=======================================
--- /trunk/src/arm/macro-assembler-arm.cc       Tue Apr 19 09:18:47 2011
+++ /trunk/src/arm/macro-assembler-arm.cc       Wed Apr 20 02:44:50 2011
@@ -83,7 +83,7 @@
 void MacroAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
                           Condition cond) {
 #if USE_BX
-  mov(ip, Operand(target, rmode), LeaveCC, cond);
+  mov(ip, Operand(target, rmode));
   bx(ip, cond);
 #else
   mov(pc, Operand(target, rmode), LeaveCC, cond);
@@ -167,7 +167,7 @@
   // we have to do it explicitly.
   positions_recorder()->WriteRecordedPositions();

-  mov(ip, Operand(target, rmode), LeaveCC, cond);
+  mov(ip, Operand(target, rmode));
   blx(ip, cond);

   ASSERT(kCallTargetAddressOffset == 2 * kInstrSize);
@@ -2863,7 +2863,7 @@
   Call(function);
int stack_passed_arguments = (num_arguments <= kRegisterPassedArguments) ? 0 : num_arguments - kRegisterPassedArguments;
-  if (OS::ActivationFrameAlignment() > kPointerSize) {
+  if (ActivationFrameAlignment() > kPointerSize) {
     ldr(sp, MemOperand(sp, stack_passed_arguments * kPointerSize));
   } else {
     add(sp, sp, Operand(stack_passed_arguments * sizeof(kPointerSize)));
=======================================
--- /trunk/src/arm/simulator-arm.cc     Mon Apr 18 08:51:38 2011
+++ /trunk/src/arm/simulator-arm.cc     Wed Apr 20 02:44:50 2011
@@ -1282,12 +1282,13 @@


 // Calculate C flag value for additions.
-bool Simulator::CarryFrom(int32_t left, int32_t right) {
+bool Simulator::CarryFrom(int32_t left, int32_t right, int32_t carry) {
   uint32_t uleft = static_cast<uint32_t>(left);
   uint32_t uright = static_cast<uint32_t>(right);
   uint32_t urest  = 0xffffffffU - uleft;

-  return (uright > urest);
+  return (uright > urest) ||
+         (carry && (((uright + 1) > urest) || (uright > (urest - 1))));
 }


@@ -2209,8 +2210,15 @@
       }

       case ADC: {
-        Format(instr, "adc'cond's 'rd, 'rn, 'shift_rm");
-        Format(instr, "adc'cond's 'rd, 'rn, 'imm");
+        // Format(instr, "adc'cond's 'rd, 'rn, 'shift_rm");
+        // Format(instr, "adc'cond's 'rd, 'rn, 'imm");
+        alu_out = rn_val + shifter_operand + GetCarry();
+        set_register(rd, alu_out);
+        if (instr->HasS()) {
+          SetNZFlags(alu_out);
+          SetCFlag(CarryFrom(rn_val, shifter_operand, GetCarry()));
+          SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, true));
+        }
         break;
       }

=======================================
--- /trunk/src/arm/simulator-arm.h      Mon Apr 18 08:51:38 2011
+++ /trunk/src/arm/simulator-arm.h      Wed Apr 20 02:44:50 2011
@@ -223,13 +223,17 @@
   void SetNZFlags(int32_t val);
   void SetCFlag(bool val);
   void SetVFlag(bool val);
-  bool CarryFrom(int32_t left, int32_t right);
+  bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0);
   bool BorrowFrom(int32_t left, int32_t right);
   bool OverflowFrom(int32_t alu_out,
                     int32_t left,
                     int32_t right,
                     bool addition);

+  inline int GetCarry() {
+    return c_flag_ ? 1 : 0;
+  };
+
   // Support for VFP.
   void Compute_FPSCR_Flags(double val1, double val2);
   void Copy_FPSCR_to_APSR();
=======================================
--- /trunk/src/ast.cc   Mon Apr 18 08:51:38 2011
+++ /trunk/src/ast.cc   Wed Apr 20 02:44:50 2011
@@ -413,7 +413,7 @@


 bool Throw::IsInlineable() const {
-  return true;
+  return exception()->IsInlineable();
 }


=======================================
--- /trunk/src/hydrogen-instructions.cc Mon Apr 18 08:51:38 2011
+++ /trunk/src/hydrogen-instructions.cc Wed Apr 20 02:44:50 2011
@@ -315,6 +315,17 @@
   }
   return result;
 }
+
+
+const char* HValue::Mnemonic() const {
+  switch (opcode()) {
+#define MAKE_CASE(type) case k##type: return #type;
+    HYDROGEN_CONCRETE_INSTRUCTION_LIST(MAKE_CASE)
+#undef MAKE_CASE
+    case kPhi: return "Phi";
+    default: return "";
+  }
+}


 void HValue::SetOperandAt(int index, HValue* value) {
=======================================
--- /trunk/src/hydrogen-instructions.h  Mon Apr 18 08:51:38 2011
+++ /trunk/src/hydrogen-instructions.h  Wed Apr 20 02:44:50 2011
@@ -48,18 +48,10 @@
 class LChunkBuilder;


-#define HYDROGEN_ALL_INSTRUCTION_LIST(V)       \
-  V(ArithmeticBinaryOperation)                 \
-  V(BinaryCall)                                \
-  V(BinaryOperation)                           \
+#define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V)  \
   V(BitwiseBinaryOperation)                    \
   V(ControlInstruction)                        \
   V(Instruction)                               \
-  V(Phi)                                       \
-  V(UnaryCall)                                 \
-  V(UnaryControlInstruction)                   \
-  V(UnaryOperation)                            \
-  HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)


 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)  \
@@ -182,19 +174,21 @@
   V(ContextSlots)                              \
   V(OsrEntries)

-#define DECLARE_INSTRUCTION(type)                   \
+#define DECLARE_ABSTRACT_INSTRUCTION(type)          \
   virtual bool Is##type() const { return true; }    \
   static H##type* cast(HValue* value) {             \
     ASSERT(value->Is##type());                      \
     return reinterpret_cast<H##type*>(value);       \
-  }                                                 \
-  Opcode opcode() const { return HValue::k##type; }
+  }


-#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)              \
+#define DECLARE_CONCRETE_INSTRUCTION(type)                        \
   virtual LInstruction* CompileToLithium(LChunkBuilder* builder); \
-  virtual const char* Mnemonic() const { return mnemonic; }       \
-  DECLARE_INSTRUCTION(type)
+  static H##type* cast(HValue* value) {                           \
+    ASSERT(value->Is##type());                                    \
+    return reinterpret_cast<H##type*>(value);                     \
+  }                                                               \
+  virtual Opcode opcode() const { return HValue::k##type; }


 class Range: public ZoneObject {
@@ -456,11 +450,25 @@

   enum Opcode {
     // Declare a unique enum value for each hydrogen instruction.
-  #define DECLARE_DO(type) k##type,
-    HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO)
-  #undef DECLARE_DO
-    kMaxInstructionClass
+  #define DECLARE_OPCODE(type) k##type,
+    HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE)
+    kPhi
+  #undef DECLARE_OPCODE
   };
+  virtual Opcode opcode() const = 0;
+
+ // Declare a non-virtual predicates for each concrete HInstruction or HValue.
+  #define DECLARE_PREDICATE(type) \
+    bool Is##type() const { return opcode() == k##type; }
+    HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE)
+  #undef DECLARE_PREDICATE
+    bool IsPhi() const { return opcode() == kPhi; }
+
+  // Declare virtual predicates for abstract HInstruction or HValue
+  #define DECLARE_PREDICATE(type) \
+    virtual bool Is##type() const { return false; }
+    HYDROGEN_ABSTRACT_INSTRUCTION_LIST(DECLARE_PREDICATE)
+  #undef DECLARE_PREDICATE

   HValue() : block_(NULL),
              id_(kNoNumber),
@@ -554,11 +562,6 @@
// instruction with a new one, first add the new instruction to the graph,
   // then return it.  Return NULL to have the instruction deleted.
   virtual HValue* Canonicalize() { return this; }
-
-  // Declare virtual type testers.
-#define DECLARE_DO(type) virtual bool Is##type() const { return false; }
-  HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO)
-#undef DECLARE_DO

   bool Equals(HValue* other);
   virtual intptr_t Hashcode();
@@ -568,8 +571,7 @@
   void PrintNameTo(StringStream* stream);
   static void PrintTypeTo(HType type, StringStream* stream);

-  virtual const char* Mnemonic() const = 0;
-  virtual Opcode opcode() const = 0;
+  const char* Mnemonic() const;

   // Updated the inferred type of this instruction and returns true if
   // it has changed.
@@ -657,7 +659,7 @@

   virtual bool IsCall() { return false; }

-  DECLARE_INSTRUCTION(Instruction)
+  DECLARE_ABSTRACT_INSTRUCTION(Instruction)

  protected:
   HInstruction()
@@ -694,7 +696,7 @@

   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_INSTRUCTION(ControlInstruction)
+  DECLARE_ABSTRACT_INSTRUCTION(ControlInstruction)

  private:
   HBasicBlock* first_successor_;
@@ -766,7 +768,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(BlockEntry, "block_entry")
+  DECLARE_CONCRETE_INSTRUCTION(BlockEntry)
 };


@@ -788,7 +790,7 @@
     SetOperandAt(values_.length() - 1, value);
   }

-  DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
+  DECLARE_CONCRETE_INSTRUCTION(Deoptimize)

  protected:
   virtual void InternalSetOperandAt(int index, HValue* value) {
@@ -815,7 +817,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
+  DECLARE_CONCRETE_INSTRUCTION(Goto)

  private:
   bool include_stack_check_;
@@ -834,8 +836,6 @@
   virtual void PrintDataTo(StringStream* stream);

   HValue* value() { return OperandAt(0); }
-
-  DECLARE_INSTRUCTION(UnaryControlInstruction)
 };


@@ -850,7 +850,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Test, "test")
+  DECLARE_CONCRETE_INSTRUCTION(Test)
 };


@@ -875,7 +875,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(CompareMap, "compare_map")
+  DECLARE_CONCRETE_INSTRUCTION(CompareMap)

  private:
   Handle<Map> map_;
@@ -892,7 +892,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
+  DECLARE_CONCRETE_INSTRUCTION(Return)
 };


@@ -904,7 +904,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(AbnormalExit, "abnormal_exit")
+  DECLARE_CONCRETE_INSTRUCTION(AbnormalExit)
 };


@@ -916,8 +916,6 @@

   HValue* value() { return OperandAt(0); }
   virtual void PrintDataTo(StringStream* stream);
-
-  DECLARE_INSTRUCTION(UnaryOperation)
 };


@@ -931,7 +929,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
+  DECLARE_CONCRETE_INSTRUCTION(Throw)
 };


@@ -965,8 +963,7 @@

   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(Change,
- CanTruncateToInt32() ? "truncate" : "change")
+  DECLARE_CONCRETE_INSTRUCTION(Change)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -1021,7 +1018,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Simulate, "simulate")
+  DECLARE_CONCRETE_INSTRUCTION(Simulate)

 #ifdef DEBUG
   virtual void Verify();
@@ -1057,7 +1054,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack_check")
+  DECLARE_CONCRETE_INSTRUCTION(StackCheck)
 };


@@ -1076,7 +1073,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(EnterInlined, "enter_inlined")
+  DECLARE_CONCRETE_INSTRUCTION(EnterInlined)

  private:
   Handle<JSFunction> closure_;
@@ -1092,7 +1089,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(LeaveInlined, "leave_inlined")
+  DECLARE_CONCRETE_INSTRUCTION(LeaveInlined)
 };


@@ -1108,7 +1105,7 @@

   HValue* argument() { return OperandAt(0); }

-  DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push_argument")
+  DECLARE_CONCRETE_INSTRUCTION(PushArgument)
 };


@@ -1123,7 +1120,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Context, "context");
+  DECLARE_CONCRETE_INSTRUCTION(Context);

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1137,7 +1134,7 @@
     SetFlag(kUseGVN);
   }

-  DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer_context");
+  DECLARE_CONCRETE_INSTRUCTION(OuterContext);

   virtual Representation RequiredInputRepresentation(int index) const {
     return Representation::Tagged();
@@ -1155,7 +1152,7 @@
     SetFlag(kUseGVN);
   }

-  DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global_object")
+  DECLARE_CONCRETE_INSTRUCTION(GlobalObject)

   virtual Representation RequiredInputRepresentation(int index) const {
     return Representation::Tagged();
@@ -1174,7 +1171,7 @@
     SetFlag(kUseGVN);
   }

-  DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global_receiver")
+  DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver)

   virtual Representation RequiredInputRepresentation(int index) const {
     return Representation::Tagged();
@@ -1219,8 +1216,6 @@
   virtual void PrintDataTo(StringStream* stream);

   HValue* value() { return OperandAt(0); }
-
-  DECLARE_INSTRUCTION(UnaryCall)
 };


@@ -1240,8 +1235,6 @@

   HValue* first() { return OperandAt(0); }
   HValue* second() { return OperandAt(1); }
-
-  DECLARE_INSTRUCTION(BinaryCall)
 };


@@ -1258,7 +1251,7 @@
   HValue* context() { return first(); }
   HValue* function() { return second(); }

-  DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke_function")
+  DECLARE_CONCRETE_INSTRUCTION(InvokeFunction)
 };


@@ -1280,7 +1273,7 @@
     return Representation::None();
   }

- DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call_constant_function")
+  DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction)

  private:
   Handle<JSFunction> function_;
@@ -1300,7 +1293,7 @@
   HValue* context() { return first(); }
   HValue* key() { return second(); }

-  DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call_keyed")
+  DECLARE_CONCRETE_INSTRUCTION(CallKeyed)
 };


@@ -1315,7 +1308,7 @@
   HValue* context() { return value(); }
   Handle<String> name() const { return name_; }

-  DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call_named")
+  DECLARE_CONCRETE_INSTRUCTION(CallNamed)

   virtual Representation RequiredInputRepresentation(int index) const {
     return Representation::Tagged();
@@ -1338,7 +1331,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call_function")
+  DECLARE_CONCRETE_INSTRUCTION(CallFunction)
 };


@@ -1357,7 +1350,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call_global")
+  DECLARE_CONCRETE_INSTRUCTION(CallGlobal)

  private:
   Handle<String> name_;
@@ -1377,7 +1370,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call_known_global")
+  DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal)

  private:
   Handle<JSFunction> target_;
@@ -1397,7 +1390,7 @@
   HValue* context() { return first(); }
   HValue* constructor() { return second(); }

-  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call_new")
+  DECLARE_CONCRETE_INSTRUCTION(CallNew)
 };


@@ -1416,7 +1409,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call_runtime")
+  DECLARE_CONCRETE_INSTRUCTION(CallRuntime)

  private:
   const Runtime::Function* c_function_;
@@ -1440,7 +1433,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js_array_length")
+  DECLARE_CONCRETE_INSTRUCTION(JSArrayLength)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1459,7 +1452,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length")
+  DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1480,7 +1473,7 @@
     return Representation::Tagged();
   }

- DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external_array_length")
+  DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1500,7 +1493,7 @@
   }
   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(BitNot, "bit_not")
+  DECLARE_CONCRETE_INSTRUCTION(BitNot)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1572,7 +1565,7 @@
   BuiltinFunctionId op() const { return op_; }
   const char* OpName() const;

-  DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary_math_operation")
+  DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -1597,7 +1590,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
+  DECLARE_CONCRETE_INSTRUCTION(LoadElements)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1620,8 +1613,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
-                               "load-external-array-pointer")
+  DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1651,7 +1643,7 @@

   Handle<Map> map() const { return map_; }

-  DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check_map")
+  DECLARE_CONCRETE_INSTRUCTION(CheckMap)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -1686,7 +1678,7 @@

   Handle<JSFunction> target() const { return target_; }

-  DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check_function")
+  DECLARE_CONCRETE_INSTRUCTION(CheckFunction)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -1741,7 +1733,7 @@
   InstanceType first() const { return first_; }
   InstanceType last() const { return last_; }

-  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check_instance_type")
+  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType)

  protected:
   // TODO(ager): It could be nice to allow the ommision of instance
@@ -1789,7 +1781,7 @@
     return this;
   }

-  DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check_non_smi")
+  DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1813,7 +1805,7 @@
   Handle<JSObject> prototype() const { return prototype_; }
   Handle<JSObject> holder() const { return holder_; }

-  DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check_prototype_maps")
+  DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps)

   virtual Representation RequiredInputRepresentation(int index) const {
     return Representation::None();
@@ -1857,7 +1849,7 @@
   virtual void Verify();
 #endif

-  DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check_smi")
+  DECLARE_CONCRETE_INSTRUCTION(CheckSmi)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -1909,8 +1901,6 @@
   bool IsReceiver() { return merged_index_ == 0; }

   int merged_index() const { return merged_index_; }
-
-  virtual const char* Mnemonic() const { return "phi"; }

   virtual void PrintTo(StringStream* stream);

@@ -1918,8 +1908,6 @@
   virtual void Verify();
 #endif

-  DECLARE_INSTRUCTION(Phi)
-
   void InitRealUses(int id);
   void AddNonPhiUsesFrom(HPhi* other);
   void AddIndirectUsesTo(int* use_count);
@@ -1945,6 +1933,12 @@
   int phi_id() { return phi_id_; }
   bool is_live() { return is_live_; }
   void set_is_live(bool b) { is_live_ = b; }
+
+  static HPhi* cast(HValue* value) {
+    ASSERT(value->IsPhi());
+    return reinterpret_cast<HPhi*>(value);
+  }
+  virtual Opcode opcode() const { return HValue::kPhi; }

  protected:
   virtual void DeleteFromGraph();
@@ -1974,7 +1968,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject, "arguments-object")
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject)
 };


@@ -2019,7 +2013,7 @@
   virtual void Verify() { }
 #endif

-  DECLARE_CONCRETE_INSTRUCTION(Constant, "constant")
+  DECLARE_CONCRETE_INSTRUCTION(Constant)

  protected:
   virtual Range* InferRange();
@@ -2067,8 +2061,6 @@
   virtual bool IsCommutative() const { return false; }

   virtual void PrintDataTo(StringStream* stream);
-
-  DECLARE_INSTRUCTION(BinaryOperation)
 };


@@ -2098,7 +2090,7 @@
   HValue* length() { return OperandAt(2); }
   HValue* elements() { return OperandAt(3); }

-  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments")
+  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments)
 };


@@ -2111,7 +2103,7 @@
     SetFlag(kUseGVN);
   }

-  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments_elements")
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements)

   virtual Representation RequiredInputRepresentation(int index) const {
     return Representation::None();
@@ -2133,7 +2125,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments_length")
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2163,7 +2155,7 @@
   HValue* length() { return OperandAt(1); }
   HValue* index() { return OperandAt(2); }

-  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access_arguments_at")
+  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt)

   virtual bool DataEquals(HValue* other) { return true; }
 };
@@ -2189,7 +2181,7 @@
   HValue* index() { return left(); }
   HValue* length() { return right(); }

-  DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds_check")
+  DECLARE_CONCRETE_INSTRUCTION(BoundsCheck)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2220,7 +2212,7 @@

   virtual HType CalculateInferredType();

-  DECLARE_INSTRUCTION(BitwiseBinaryOperation)
+  DECLARE_ABSTRACT_INSTRUCTION(BitwiseBinaryOperation)
 };


@@ -2250,8 +2242,6 @@
     }
     return HValue::InferredRepresentation();
   }
-
-  DECLARE_INSTRUCTION(ArithmeticBinaryOperation)
 };


@@ -2285,7 +2275,7 @@
     return HValue::Hashcode() * 7 + token_;
   }

-  DECLARE_CONCRETE_INSTRUCTION(Compare, "compare")
+  DECLARE_CONCRETE_INSTRUCTION(Compare)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -2317,7 +2307,7 @@
   }
   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq, "compare-js-object-eq")
+  DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2349,7 +2339,7 @@

   bool is_strict() const { return is_strict_; }

-  DECLARE_CONCRETE_INSTRUCTION(IsNull, "is_null")
+  DECLARE_CONCRETE_INSTRUCTION(IsNull)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -2366,7 +2356,7 @@
  public:
   explicit HIsObject(HValue* value) : HUnaryPredicate(value) { }

-  DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object")
+  DECLARE_CONCRETE_INSTRUCTION(IsObject)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2377,7 +2367,7 @@
  public:
   explicit HIsSmi(HValue* value) : HUnaryPredicate(value) { }

-  DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is_smi")
+  DECLARE_CONCRETE_INSTRUCTION(IsSmi)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2399,7 +2389,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is_construct_call")
+  DECLARE_CONCRETE_INSTRUCTION(IsConstructCall)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2420,7 +2410,7 @@

   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has_instance_type")
+  DECLARE_CONCRETE_INSTRUCTION(HasInstanceType)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -2438,7 +2428,7 @@
  public:
   explicit HHasCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { }

- DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has_cached_array_index")
+  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2449,7 +2439,7 @@
  public:
   explicit HGetCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { }

- DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get_cached_array_index")
+  DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2461,7 +2451,7 @@
   HClassOfTest(HValue* value, Handle<String> class_name)
       : HUnaryPredicate(value), class_name_(class_name) { }

-  DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class_of_test")
+  DECLARE_CONCRETE_INSTRUCTION(ClassOfTest)

   virtual void PrintDataTo(StringStream* stream);

@@ -2486,7 +2476,7 @@
   Handle<String> type_literal() { return type_literal_; }
   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof_is")
+  DECLARE_CONCRETE_INSTRUCTION(TypeofIs)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -2523,7 +2513,7 @@

   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of")
+  DECLARE_CONCRETE_INSTRUCTION(InstanceOf)
 };


@@ -2541,8 +2531,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
-                               "instance_of_known_global")
+  DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal)

  private:
   Handle<JSFunction> function_;
@@ -2561,7 +2550,7 @@
return (index == 1) ? Representation::None() : Representation::Double();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Power, "power")
+  DECLARE_CONCRETE_INSTRUCTION(Power)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2584,7 +2573,7 @@

   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(Add, "add")
+  DECLARE_CONCRETE_INSTRUCTION(Add)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2601,7 +2590,7 @@

   virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);

-  DECLARE_CONCRETE_INSTRUCTION(Sub, "sub")
+  DECLARE_CONCRETE_INSTRUCTION(Sub)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2623,7 +2612,7 @@
     return !representation().IsTagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Mul, "mul")
+  DECLARE_CONCRETE_INSTRUCTION(Mul)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2650,7 +2639,7 @@

   virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);

-  DECLARE_CONCRETE_INSTRUCTION(Mod, "mod")
+  DECLARE_CONCRETE_INSTRUCTION(Mod)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2668,7 +2657,7 @@

   virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);

-  DECLARE_CONCRETE_INSTRUCTION(Div, "div")
+  DECLARE_CONCRETE_INSTRUCTION(Div)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2685,7 +2674,7 @@
   virtual bool IsCommutative() const { return true; }
   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(BitAnd, "bit_and")
+  DECLARE_CONCRETE_INSTRUCTION(BitAnd)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2702,7 +2691,7 @@
   virtual bool IsCommutative() const { return true; }
   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(BitXor, "bit_xor")
+  DECLARE_CONCRETE_INSTRUCTION(BitXor)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2717,7 +2706,7 @@
   virtual bool IsCommutative() const { return true; }
   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(BitOr, "bit_or")
+  DECLARE_CONCRETE_INSTRUCTION(BitOr)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2734,7 +2723,7 @@
   virtual Range* InferRange();
   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(Shl, "shl")
+  DECLARE_CONCRETE_INSTRUCTION(Shl)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2748,7 +2737,7 @@

   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(Shr, "shr")
+  DECLARE_CONCRETE_INSTRUCTION(Shr)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2763,7 +2752,7 @@
   virtual Range* InferRange();
   virtual HType CalculateInferredType();

-  DECLARE_CONCRETE_INSTRUCTION(Sar, "sar")
+  DECLARE_CONCRETE_INSTRUCTION(Sar)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -2782,7 +2771,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr_entry")
+  DECLARE_CONCRETE_INSTRUCTION(OsrEntry)

  private:
   int ast_id_;
@@ -2803,7 +2792,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
+  DECLARE_CONCRETE_INSTRUCTION(Parameter)

  private:
   unsigned index_;
@@ -2835,7 +2824,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call_stub")
+  DECLARE_CONCRETE_INSTRUCTION(CallStub)

  private:
   CodeStub::Major major_key_;
@@ -2851,7 +2840,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value")
+  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue)
 };


@@ -2878,7 +2867,7 @@
     return Representation::None();
   }

-  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load_global_cell")
+  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -2916,7 +2905,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load_global_generic")
+  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric)

  private:
   Handle<Object> name_;
@@ -2943,7 +2932,7 @@
   }
   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store_global_cell")
+  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell)

  private:
   Handle<JSGlobalPropertyCell> cell_;
@@ -2979,7 +2968,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store_global_generic")
+  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric)

  private:
   Handle<Object> name_;
@@ -3004,7 +2993,7 @@

   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot")
+  DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -3044,7 +3033,7 @@

   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store_context_slot")
+  DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot)

  private:
   int slot_index_;
@@ -3076,7 +3065,7 @@
   }
   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load_named_field")
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField)

  protected:
   virtual bool DataEquals(HValue* other) {
@@ -3105,8 +3094,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(LoadNamedFieldPolymorphic,
-                               "load_named_field_polymorphic")
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedFieldPolymorphic)

   static const int kMaxLoadPolymorphism = 4;

@@ -3137,7 +3125,7 @@
     return Representation::Tagged();
   }

-  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic")
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)

  private:
   Handle<Object> name_;
@@ -3159,7 +3147,7 @@
     return Representation::Tagged();
   }

- DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load_function_prototype")
+  DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype)

  protected:
   virtual bool DataEquals(HValue* other) { return true; }
@@ -3185,8 +3173,7 @@

   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement,
-                               "load_keyed_fast_element")
+  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement)

  protected:
***The diff for this file has been truncated for email.***
=======================================
--- /trunk/src/ia32/lithium-gap-resolver-ia32.cc        Mon Apr  4 01:25:31 2011
+++ /trunk/src/ia32/lithium-gap-resolver-ia32.cc        Wed Apr 20 02:44:50 2011
@@ -309,12 +309,15 @@
     __ mov(dst, src);

   } else if (source->IsDoubleRegister()) {
-    ASSERT(destination->IsDoubleRegister() ||
-           destination->IsDoubleStackSlot());
     XMMRegister src = cgen_->ToDoubleRegister(source);
-    Operand dst = cgen_->ToOperand(destination);
-    __ movdbl(dst, src);
-
+    if (destination->IsDoubleRegister()) {
+      XMMRegister dst = cgen_->ToDoubleRegister(destination);
+      __ movaps(dst, src);
+    } else {
+      ASSERT(destination->IsDoubleStackSlot());
+      Operand dst = cgen_->ToOperand(destination);
+      __ movdbl(dst, src);
+    }
   } else if (source->IsDoubleStackSlot()) {
     ASSERT(destination->IsDoubleRegister() ||
            destination->IsDoubleStackSlot());
@@ -391,13 +394,19 @@
       __ mov(dst, tmp1);
       __ mov(src, tmp0);
     }
+ } else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) {
+    // XMM register-register swap. We rely on having xmm0
+    // available as a fixed scratch register.
+    XMMRegister src = cgen_->ToDoubleRegister(source);
+    XMMRegister dst = cgen_->ToDoubleRegister(destination);
+    __ movaps(xmm0, src);
+    __ movaps(src, dst);
+    __ movaps(dst, xmm0);

} else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) {
-    // XMM register-register or register-memory.  We rely on having xmm0
+    // XMM register-memory swap.  We rely on having xmm0
     // available as a fixed scratch register.
-    ASSERT(source->IsDoubleRegister() || source->IsDoubleStackSlot());
-    ASSERT(destination->IsDoubleRegister() ||
-           destination->IsDoubleStackSlot());
+ ASSERT(source->IsDoubleStackSlot() || destination->IsDoubleStackSlot());
     XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister()
                                                   ? source
                                                   : destination);
=======================================
--- /trunk/src/lithium-allocator.cc     Wed Mar 30 01:52:27 2011
+++ /trunk/src/lithium-allocator.cc     Wed Apr 20 02:44:50 2011
@@ -1029,6 +1029,22 @@
       chunk_->AddGapMove(cur_block->last_instruction_index() - 1,
                          operand,
                          phi_operand);
+
+      // We are going to insert a move before the branch instruction.
+      // Some branch instructions (e.g. loops' back edges)
+      // can potentially cause a GC so they have a pointer map.
+      // By inserting a move we essentially create a copy of a
+ // value which is invisible to PopulatePointerMaps(), because we store
+      // it into a location different from the operand of a live range
+      // covering a branch instruction.
+      // Thus we need to manually record a pointer.
+      if (phi->representation().IsTagged()) {
+        LInstruction* branch =
+            InstructionAt(cur_block->last_instruction_index());
+        if (branch->HasPointerMap()) {
+          branch->pointer_map()->RecordPointer(phi_operand);
+        }
+      }
     }

     LiveRange* live_range = LiveRangeFor(phi->id());
@@ -1116,7 +1132,7 @@
         // We are going to insert a move before the branch instruction.
         // Some branch instructions (e.g. loops' back edges)
         // can potentially cause a GC so they have a pointer map.
-        // By insterting a move we essentially create a copy of a
+        // By inserting a move we essentially create a copy of a
// value which is invisible to PopulatePointerMaps(), because we store
         // it into a location different from the operand of a live range
         // covering a branch instruction.
=======================================
--- /trunk/src/messages.cc      Wed Apr 13 01:46:07 2011
+++ /trunk/src/messages.cc      Wed Apr 20 02:44:50 2011
@@ -131,7 +131,7 @@
       Handle<Object> callback_data(listener.get(1));
       {
         // Do not allow exceptions to propagate.
-        v8::TryCatch tryCatch;
+        v8::TryCatch try_catch;
         callback(api_message_obj, v8::Utils::ToLocal(callback_data));
       }
       if (isolate->has_scheduled_exception()) {
=======================================
--- /trunk/src/version.cc       Tue Apr 19 09:18:47 2011
+++ /trunk/src/version.cc       Wed Apr 20 02:44:50 2011
@@ -34,8 +34,8 @@
 // cannot be changed without changing the SCons build script.
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     3
-#define BUILD_NUMBER      0
-#define PATCH_LEVEL       1
+#define BUILD_NUMBER      1
+#define PATCH_LEVEL       0
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
=======================================
--- /trunk/test/cctest/cctest.status    Wed Apr 13 01:46:07 2011
+++ /trunk/test/cctest/cctest.status    Wed Apr 20 02:44:50 2011
@@ -58,10 +58,10 @@
 test-sockets/Socket: SKIP

 # BUG(1075): Unresolved crashes.
-cctest/test-serialize/Deserialize: PASS || FAIL
-cctest/test-serialize/DeserializeFromSecondSerializationAndRunScript2: PASS || FAIL
-cctest/test-serialize/DeserializeAndRunScript2: PASS || FAIL
-cctest/test-serialize/DeserializeFromSecondSerialization: PASS || FAIL
+test-serialize/Deserialize: SKIP
+test-serialize/DeserializeFromSecondSerializationAndRunScript2: SKIP
+test-serialize/DeserializeAndRunScript2: SKIP
+test-serialize/DeserializeFromSecondSerialization: SKIP

##############################################################################
 [ $arch == arm && $crankshaft ]
=======================================
--- /trunk/test/cctest/test-api.cc      Wed Apr 13 01:46:07 2011
+++ /trunk/test/cctest/test-api.cc      Wed Apr 20 02:44:50 2011
@@ -8711,6 +8711,8 @@
     if (callback != NULL) {
       V8::AddMessageListener(callback);
     }
+    // Some small number to control number of times message handler should
+    // throw an exception.
     call_depth = 5;
     ExpectFalse(
         "var thrown = false;\n"
=======================================
--- /trunk/test/cctest/test-assembler-arm.cc    Wed Apr  6 04:17:46 2011
+++ /trunk/test/cctest/test-assembler-arm.cc    Wed Apr 20 02:44:50 2011
@@ -944,5 +944,70 @@
     CHECK_EQ(6.0, f.h);
   }
 }
+
+
+TEST(11) {
+  // Test instructions using the carry flag.
+  InitializeVM();
+  v8::HandleScope scope;
+
+  typedef struct {
+    int32_t a;
+    int32_t b;
+    int32_t c;
+    int32_t d;
+  } I;
+  I i;
+
+  i.a = 0xabcd0001;
+  i.b = 0xabcd0000;
+
+  Assembler assm(Isolate::Current(), NULL, 0);
+
+  // Test HeapObject untagging.
+  __ ldr(r1, MemOperand(r0, OFFSET_OF(I, a)));
+  __ mov(r1, Operand(r1, ASR, 1), SetCC);
+  __ adc(r1, r1, Operand(r1), LeaveCC, cs);
+  __ str(r1, MemOperand(r0, OFFSET_OF(I, a)));
+
+  __ ldr(r2, MemOperand(r0, OFFSET_OF(I, b)));
+  __ mov(r2, Operand(r2, ASR, 1), SetCC);
+  __ adc(r2, r2, Operand(r2), LeaveCC, cs);
+  __ str(r2, MemOperand(r0, OFFSET_OF(I, b)));
+
+  // Test corner cases.
+  __ mov(r1, Operand(0xffffffff));
+  __ mov(r2, Operand(0));
+  __ mov(r3, Operand(r1, ASR, 1), SetCC);  // Set the carry.
+  __ adc(r3, r1, Operand(r2));
+  __ str(r3, MemOperand(r0, OFFSET_OF(I, c)));
+
+  __ mov(r1, Operand(0xffffffff));
+  __ mov(r2, Operand(0));
+  __ mov(r3, Operand(r2, ASR, 1), SetCC);  // Unset the carry.
+  __ adc(r3, r1, Operand(r2));
+  __ str(r3, MemOperand(r0, OFFSET_OF(I, d)));
+
+  __ mov(pc, Operand(lr));
+
+  CodeDesc desc;
+  assm.GetCode(&desc);
+  Object* code = HEAP->CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(HEAP->undefined_value()))->ToObjectChecked();
+  CHECK(code->IsCode());
+#ifdef DEBUG
+  Code::cast(code)->Print();
+#endif
+  F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
+  Object* dummy = CALL_GENERATED_CODE(f, &i, 0, 0, 0, 0);
+  USE(dummy);
+
+  CHECK_EQ(0xabcd0001, i.a);
+  CHECK_EQ(static_cast<int32_t>(0xabcd0000) >> 1, i.b);
+  CHECK_EQ(0x00000000, i.c);
+  CHECK_EQ(0xffffffff, i.d);
+}

 #undef __

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

Reply via email to