Push version 3.0.3 to trunk.

Reapplied all changes for version 3.0.1.

Improved debugger protocol for remote debugging.

Added experimental support for using gyp to generate build files for V8.

Fixed implementation of String::Write in the API (issue 975).


git-svn-id: http://v8.googlecode.com/svn/trunk@6061 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index ff1ab1a..aafa7a8 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -77,6 +77,7 @@
 //         HLoadKeyedFastElement
 //         HLoadKeyedGeneric
 //       HLoadNamedGeneric
+//       HPower
 //       HStoreNamed
 //         HStoreNamedField
 //         HStoreNamedGeneric
@@ -93,13 +94,13 @@
 //     HCallStub
 //     HConstant
 //     HControlInstruction
+//       HDeoptimize
 //       HGoto
 //       HUnaryControlInstruction
 //         HBranch
 //         HCompareMapAndBranch
 //         HReturn
 //         HThrow
-//     HDeoptimize
 //     HEnterInlined
 //     HFunctionLiteral
 //     HGlobalObject
@@ -139,6 +140,7 @@
 //         HHasCachedArrayIndex
 //         HHasInstanceType
 //         HIsNull
+//         HIsObject
 //         HIsSmi
 //       HValueOf
 //     HUnknownOSRValue
@@ -207,6 +209,7 @@
   V(Goto)                                      \
   V(InstanceOf)                                \
   V(IsNull)                                    \
+  V(IsObject)                                  \
   V(IsSmi)                                     \
   V(HasInstanceType)                           \
   V(HasCachedArrayIndex)                       \
@@ -223,6 +226,7 @@
   V(ObjectLiteral)                             \
   V(OsrEntry)                                  \
   V(Parameter)                                 \
+  V(Power)                                     \
   V(PushArgument)                              \
   V(RegExpLiteral)                             \
   V(Return)                                    \
@@ -330,6 +334,9 @@
     set_can_be_minus_zero(false);
   }
 
+  // Adds a constant to the lower and upper bound of the range.
+  void AddConstant(int32_t value);
+
   void StackUpon(Range* other) {
     Intersect(other);
     next_ = other;
@@ -349,7 +356,8 @@
     set_can_be_minus_zero(b);
   }
 
-  void Add(int32_t value);
+  // Compute a new result range and return true, if the operation
+  // can overflow.
   bool AddAndCheckOverflow(Range* other);
   bool SubAndCheckOverflow(Range* other);
   bool MulAndCheckOverflow(Range* other);
@@ -1364,7 +1372,7 @@
 
 class HUnaryMathOperation: public HUnaryOperation {
  public:
-  HUnaryMathOperation(HValue* value, MathFunctionId op)
+  HUnaryMathOperation(HValue* value, BuiltinFunctionId op)
       : HUnaryOperation(value), op_(op) {
     switch (op) {
       case kMathFloor:
@@ -1377,8 +1385,12 @@
         SetFlag(kFlexibleRepresentation);
         break;
       case kMathSqrt:
-      default:
+      case kMathPowHalf:
+      case kMathLog:
         set_representation(Representation::Double());
+        break;
+      default:
+        UNREACHABLE();
     }
     SetFlag(kUseGVN);
   }
@@ -1395,6 +1407,8 @@
       case kMathRound:
       case kMathCeil:
       case kMathSqrt:
+      case kMathPowHalf:
+      case kMathLog:
         return Representation::Double();
         break;
       case kMathAbs:
@@ -1415,13 +1429,19 @@
     return this;
   }
 
-  MathFunctionId op() const { return op_; }
+  BuiltinFunctionId op() const { return op_; }
   const char* OpName() const;
 
   DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary_math_operation")
 
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HUnaryMathOperation* b = HUnaryMathOperation::cast(other);
+    return op_ == b->op();
+  }
+
  private:
-  MathFunctionId op_;
+  BuiltinFunctionId op_;
 };
 
 
@@ -2087,11 +2107,25 @@
 
   DECLARE_CONCRETE_INSTRUCTION(IsNull, "is_null")
 
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HIsNull* b = HIsNull::cast(other);
+    return is_strict_ == b->is_strict();
+  }
+
  private:
   bool is_strict_;
 };
 
 
+class HIsObject: public HUnaryPredicate {
+ public:
+  explicit HIsObject(HValue* value) : HUnaryPredicate(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object")
+};
+
+
 class HIsSmi: public HUnaryPredicate {
  public:
   explicit HIsSmi(HValue* value) : HUnaryPredicate(value) { }
@@ -2116,6 +2150,12 @@
 
   DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has_instance_type")
 
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HHasInstanceType* b = HHasInstanceType::cast(other);
+    return (from_ == b->from()) && (to_ == b->to());
+  }
+
  private:
   InstanceType from_;
   InstanceType to_;  // Inclusive range, not all combinations work.
@@ -2141,6 +2181,12 @@
 
   Handle<String> class_name() const { return class_name_; }
 
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HClassOfTest* b = HClassOfTest::cast(other);
+    return class_name_.is_identical_to(b->class_name_);
+  }
+
  private:
   Handle<String> class_name_;
 };
@@ -2184,6 +2230,22 @@
 };
 
 
+class HPower: public HBinaryOperation {
+ public:
+  HPower(HValue* left, HValue* right)
+      : HBinaryOperation(left, right) {
+    set_representation(Representation::Double());
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return (index == 1) ? Representation::None() : Representation::Double();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(Power, "power")
+};
+
+
 class HAdd: public HArithmeticBinaryOperation {
  public:
   HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {