Revision: 7659
Author:   [email protected]
Date:     Tue Apr 19 02:11:21 2011
Log: Reduce the number of virtual function in hydrogen-instruction.h classes

Instead of using virtual type-tester functions we can just
generate non-virtual ones for all concrete IR classes.

This is changes reduces the V8 binary size by ~2%.

I also simplified the macros to declare new hydrogen instructions slightly.
The name used for debug output is no longer passed as a separate string.
Instead we just use the class name.
Review URL: http://codereview.chromium.org/6880014
http://code.google.com/p/v8/source/detail?r=7659

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Thu Apr 14 23:04:50 2011 +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Tue Apr 19 02:11:21 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) {
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri Apr 15 00:58:22 2011 +++ /branches/bleeding_edge/src/hydrogen-instructions.h Tue Apr 19 02:11:21 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.***

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

Reply via email to