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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7659 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b06ce8dd
......@@ -317,6 +317,17 @@ intptr_t HValue::Hashcode() {
}
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) {
ASSERT(value == NULL || !value->representation().IsNone());
RegisterUse(index, value);
......
......@@ -48,18 +48,10 @@ class LInstruction;
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 @@ class LChunkBuilder;
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 @@ class HValue: public ZoneObject {
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),
......@@ -555,11 +563,6 @@ class HValue: public ZoneObject {
// 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 @@ class HValue: public ZoneObject {
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 @@ class HInstruction: public HValue {
virtual bool IsCall() { return false; }
DECLARE_INSTRUCTION(Instruction)
DECLARE_ABSTRACT_INSTRUCTION(Instruction)
protected:
HInstruction()
......@@ -694,7 +696,7 @@ class HControlInstruction: public HInstruction {
virtual void PrintDataTo(StringStream* stream);
DECLARE_INSTRUCTION(ControlInstruction)
DECLARE_ABSTRACT_INSTRUCTION(ControlInstruction)
private:
HBasicBlock* first_successor_;
......@@ -766,7 +768,7 @@ class HBlockEntry: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(BlockEntry, "block_entry")
DECLARE_CONCRETE_INSTRUCTION(BlockEntry)
};
......@@ -788,7 +790,7 @@ class HDeoptimize: public HControlInstruction {
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 @@ class HGoto: public HTemplateControlInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
DECLARE_CONCRETE_INSTRUCTION(Goto)
private:
bool include_stack_check_;
......@@ -834,8 +836,6 @@ class HUnaryControlInstruction: public HTemplateControlInstruction<1> {
virtual void PrintDataTo(StringStream* stream);
HValue* value() { return OperandAt(0); }
DECLARE_INSTRUCTION(UnaryControlInstruction)
};
......@@ -850,7 +850,7 @@ class HTest: public HUnaryControlInstruction {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(Test, "test")
DECLARE_CONCRETE_INSTRUCTION(Test)
};
......@@ -875,7 +875,7 @@ class HCompareMap: public HUnaryControlInstruction {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(CompareMap, "compare_map")
DECLARE_CONCRETE_INSTRUCTION(CompareMap)
private:
Handle<Map> map_;
......@@ -892,7 +892,7 @@ class HReturn: public HUnaryControlInstruction {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(Return, "return")
DECLARE_CONCRETE_INSTRUCTION(Return)
};
......@@ -904,7 +904,7 @@ class HAbnormalExit: public HTemplateControlInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(AbnormalExit, "abnormal_exit")
DECLARE_CONCRETE_INSTRUCTION(AbnormalExit)
};
......@@ -916,8 +916,6 @@ class HUnaryOperation: public HTemplateInstruction<1> {
HValue* value() { return OperandAt(0); }
virtual void PrintDataTo(StringStream* stream);
DECLARE_INSTRUCTION(UnaryOperation)
};
......@@ -931,7 +929,7 @@ class HThrow: public HUnaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
DECLARE_CONCRETE_INSTRUCTION(Throw)
};
......@@ -965,8 +963,7 @@ class HChange: public HUnaryOperation {
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 @@ class HSimulate: public HInstruction {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(Simulate, "simulate")
DECLARE_CONCRETE_INSTRUCTION(Simulate)
#ifdef DEBUG
virtual void Verify();
......@@ -1057,7 +1054,7 @@ class HStackCheck: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack_check")
DECLARE_CONCRETE_INSTRUCTION(StackCheck)
};
......@@ -1076,7 +1073,7 @@ class HEnterInlined: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(EnterInlined, "enter_inlined")
DECLARE_CONCRETE_INSTRUCTION(EnterInlined)
private:
Handle<JSFunction> closure_;
......@@ -1092,7 +1089,7 @@ class HLeaveInlined: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(LeaveInlined, "leave_inlined")
DECLARE_CONCRETE_INSTRUCTION(LeaveInlined)
};
......@@ -1108,7 +1105,7 @@ class HPushArgument: public HUnaryOperation {
HValue* argument() { return OperandAt(0); }
DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push_argument")
DECLARE_CONCRETE_INSTRUCTION(PushArgument)
};
......@@ -1123,7 +1120,7 @@ class HContext: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(Context, "context");
DECLARE_CONCRETE_INSTRUCTION(Context);
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -1137,7 +1134,7 @@ class HOuterContext: public HUnaryOperation {
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 @@ class HGlobalObject: public HUnaryOperation {
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 @@ class HGlobalReceiver: public HUnaryOperation {
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 @@ class HUnaryCall: public HCall<1> {
virtual void PrintDataTo(StringStream* stream);
HValue* value() { return OperandAt(0); }
DECLARE_INSTRUCTION(UnaryCall)
};
......@@ -1240,8 +1235,6 @@ class HBinaryCall: public HCall<2> {
HValue* first() { return OperandAt(0); }
HValue* second() { return OperandAt(1); }
DECLARE_INSTRUCTION(BinaryCall)
};
......@@ -1258,7 +1251,7 @@ class HInvokeFunction: public HBinaryCall {
HValue* context() { return first(); }
HValue* function() { return second(); }
DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke_function")
DECLARE_CONCRETE_INSTRUCTION(InvokeFunction)
};
......@@ -1280,7 +1273,7 @@ class HCallConstantFunction: public HCall<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call_constant_function")
DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction)
private:
Handle<JSFunction> function_;
......@@ -1300,7 +1293,7 @@ class HCallKeyed: public HBinaryCall {
HValue* context() { return first(); }
HValue* key() { return second(); }
DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call_keyed")
DECLARE_CONCRETE_INSTRUCTION(CallKeyed)
};
......@@ -1315,7 +1308,7 @@ class HCallNamed: public HUnaryCall {
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 @@ class HCallFunction: public HUnaryCall {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call_function")
DECLARE_CONCRETE_INSTRUCTION(CallFunction)
};
......@@ -1357,7 +1350,7 @@ class HCallGlobal: public HUnaryCall {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call_global")
DECLARE_CONCRETE_INSTRUCTION(CallGlobal)
private:
Handle<String> name_;
......@@ -1377,7 +1370,7 @@ class HCallKnownGlobal: public HCall<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call_known_global")
DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal)
private:
Handle<JSFunction> target_;
......@@ -1397,7 +1390,7 @@ class HCallNew: public HBinaryCall {
HValue* context() { return first(); }
HValue* constructor() { return second(); }
DECLARE_CONCRETE_INSTRUCTION(CallNew, "call_new")
DECLARE_CONCRETE_INSTRUCTION(CallNew)
};
......@@ -1416,7 +1409,7 @@ class HCallRuntime: public HCall<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call_runtime")
DECLARE_CONCRETE_INSTRUCTION(CallRuntime)
private:
const Runtime::Function* c_function_;
......@@ -1440,7 +1433,7 @@ class HJSArrayLength: public HUnaryOperation {
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 @@ class HFixedArrayLength: public HUnaryOperation {
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 @@ class HExternalArrayLength: public HUnaryOperation {
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 @@ class HBitNot: public HUnaryOperation {
}
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 @@ class HUnaryMathOperation: public HUnaryOperation {
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 @@ class HLoadElements: public HUnaryOperation {
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 @@ class HLoadExternalArrayPointer: public HUnaryOperation {
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 @@ class HCheckMap: public HUnaryOperation {
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 @@ class HCheckFunction: public HUnaryOperation {
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 @@ class HCheckInstanceType: public HUnaryOperation {
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 @@ class HCheckNonSmi: public HUnaryOperation {
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 @@ class HCheckPrototypeMaps: public HTemplateInstruction<0> {
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 @@ class HCheckSmi: public HUnaryOperation {
virtual void Verify();
#endif
DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check_smi")
DECLARE_CONCRETE_INSTRUCTION(CheckSmi)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -1910,16 +1902,12 @@ class HPhi: public HValue {
int merged_index() const { return merged_index_; }
virtual const char* Mnemonic() const { return "phi"; }
virtual void PrintTo(StringStream* stream);
#ifdef DEBUG
virtual void Verify();
#endif
DECLARE_INSTRUCTION(Phi)
void InitRealUses(int id);
void AddNonPhiUsesFrom(HPhi* other);
void AddIndirectUsesTo(int* use_count);
......@@ -1946,6 +1934,12 @@ class HPhi: public HValue {
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();
virtual void InternalSetOperandAt(int index, HValue* value) {
......@@ -1974,7 +1968,7 @@ class HArgumentsObject: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject, "arguments-object")
DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject)
};
......@@ -2019,7 +2013,7 @@ class HConstant: public HTemplateInstruction<0> {
virtual void Verify() { }
#endif
DECLARE_CONCRETE_INSTRUCTION(Constant, "constant")
DECLARE_CONCRETE_INSTRUCTION(Constant)
protected:
virtual Range* InferRange();
......@@ -2067,8 +2061,6 @@ class HBinaryOperation: public HTemplateInstruction<2> {
virtual bool IsCommutative() const { return false; }
virtual void PrintDataTo(StringStream* stream);
DECLARE_INSTRUCTION(BinaryOperation)
};
......@@ -2098,7 +2090,7 @@ class HApplyArguments: public HTemplateInstruction<4> {
HValue* length() { return OperandAt(2); }
HValue* elements() { return OperandAt(3); }
DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments")
DECLARE_CONCRETE_INSTRUCTION(ApplyArguments)
};
......@@ -2111,7 +2103,7 @@ class HArgumentsElements: public HTemplateInstruction<0> {
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 @@ class HArgumentsLength: public HUnaryOperation {
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 @@ class HAccessArgumentsAt: public HTemplateInstruction<3> {
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 @@ class HBoundsCheck: public HBinaryOperation {
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 @@ class HBitwiseBinaryOperation: public HBinaryOperation {
virtual HType CalculateInferredType();
DECLARE_INSTRUCTION(BitwiseBinaryOperation)
DECLARE_ABSTRACT_INSTRUCTION(BitwiseBinaryOperation)
};
......@@ -2250,8 +2242,6 @@ class HArithmeticBinaryOperation: public HBinaryOperation {
}
return HValue::InferredRepresentation();
}
DECLARE_INSTRUCTION(ArithmeticBinaryOperation)
};
......@@ -2285,7 +2275,7 @@ class HCompare: public HBinaryOperation {
return HValue::Hashcode() * 7 + token_;
}
DECLARE_CONCRETE_INSTRUCTION(Compare, "compare")
DECLARE_CONCRETE_INSTRUCTION(Compare)
protected:
virtual bool DataEquals(HValue* other) {
......@@ -2317,7 +2307,7 @@ class HCompareJSObjectEq: public HBinaryOperation {
}
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 @@ class HIsNull: public HUnaryPredicate {
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 @@ class HIsObject: public HUnaryPredicate {
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 @@ class HIsSmi: public HUnaryPredicate {
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 @@ class HIsConstructCall: public HTemplateInstruction<0> {
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 @@ class HHasInstanceType: public HUnaryPredicate {
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 @@ class HHasCachedArrayIndex: public HUnaryPredicate {
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 @@ class HGetCachedArrayIndex: public HUnaryPredicate {
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 @@ class HClassOfTest: public HUnaryPredicate {
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 @@ class HTypeofIs: public HUnaryPredicate {
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 @@ class HInstanceOf: public HTemplateInstruction<3> {
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of")
DECLARE_CONCRETE_INSTRUCTION(InstanceOf)
};
......@@ -2541,8 +2531,7 @@ class HInstanceOfKnownGlobal: public HUnaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
"instance_of_known_global")
DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal)
private:
Handle<JSFunction> function_;
......@@ -2561,7 +2550,7 @@ class HPower: public HBinaryOperation {
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 @@ class HAdd: public HArithmeticBinaryOperation {
virtual HType CalculateInferredType();
DECLARE_CONCRETE_INSTRUCTION(Add, "add")
DECLARE_CONCRETE_INSTRUCTION(Add)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -2601,7 +2590,7 @@ class HSub: public HArithmeticBinaryOperation {
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 @@ class HMul: public HArithmeticBinaryOperation {
return !representation().IsTagged();
}
DECLARE_CONCRETE_INSTRUCTION(Mul, "mul")
DECLARE_CONCRETE_INSTRUCTION(Mul)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -2650,7 +2639,7 @@ class HMod: public HArithmeticBinaryOperation {
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 @@ class HDiv: public HArithmeticBinaryOperation {
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 @@ class HBitAnd: public HBitwiseBinaryOperation {
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 @@ class HBitXor: public HBitwiseBinaryOperation {
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 @@ class HBitOr: public HBitwiseBinaryOperation {
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 @@ class HShl: public HBitwiseBinaryOperation {
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 @@ class HShr: public HBitwiseBinaryOperation {
virtual HType CalculateInferredType();
DECLARE_CONCRETE_INSTRUCTION(Shr, "shr")
DECLARE_CONCRETE_INSTRUCTION(Shr)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -2763,7 +2752,7 @@ class HSar: public HBitwiseBinaryOperation {
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 @@ class HOsrEntry: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr_entry")
DECLARE_CONCRETE_INSTRUCTION(OsrEntry)
private:
int ast_id_;
......@@ -2803,7 +2792,7 @@ class HParameter: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
DECLARE_CONCRETE_INSTRUCTION(Parameter)
private:
unsigned index_;
......@@ -2835,7 +2824,7 @@ class HCallStub: public HUnaryCall {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(CallStub, "call_stub")
DECLARE_CONCRETE_INSTRUCTION(CallStub)
private:
CodeStub::Major major_key_;
......@@ -2851,7 +2840,7 @@ class HUnknownOSRValue: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value")
DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue)
};
......@@ -2878,7 +2867,7 @@ class HLoadGlobalCell: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load_global_cell")
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell)
protected:
virtual bool DataEquals(HValue* other) {
......@@ -2916,7 +2905,7 @@ class HLoadGlobalGeneric: public HBinaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load_global_generic")
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric)
private:
Handle<Object> name_;
......@@ -2943,7 +2932,7 @@ class HStoreGlobalCell: public HUnaryOperation {
}
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store_global_cell")
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell)
private:
Handle<JSGlobalPropertyCell> cell_;
......@@ -2979,7 +2968,7 @@ class HStoreGlobalGeneric: public HTemplateInstruction<3> {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store_global_generic")
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric)
private:
Handle<Object> name_;
......@@ -3004,7 +2993,7 @@ class HLoadContextSlot: public HUnaryOperation {
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 @@ class HStoreContextSlot: public HBinaryOperation {
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store_context_slot")
DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot)
private:
int slot_index_;
......@@ -3076,7 +3065,7 @@ class HLoadNamedField: public HUnaryOperation {
}
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 @@ class HLoadNamedFieldPolymorphic: public HUnaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(LoadNamedFieldPolymorphic,
"load_named_field_polymorphic")
DECLARE_CONCRETE_INSTRUCTION(LoadNamedFieldPolymorphic)
static const int kMaxLoadPolymorphism = 4;
......@@ -3137,7 +3125,7 @@ class HLoadNamedGeneric: public HBinaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic")
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)
private:
Handle<Object> name_;
......@@ -3159,7 +3147,7 @@ class HLoadFunctionPrototype: public HUnaryOperation {
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 @@ class HLoadKeyedFastElement: public HBinaryOperation {
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement,
"load_keyed_fast_element")
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -3224,8 +3211,7 @@ class HLoadKeyedSpecializedArrayElement: public HBinaryOperation {
HValue* key() { return OperandAt(1); }
ExternalArrayType array_type() const { return array_type_; }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
"load_keyed_specialized_array_element")
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement)
protected:
virtual bool DataEquals(HValue* other) {
......@@ -3260,7 +3246,7 @@ class HLoadKeyedGeneric: public HTemplateInstruction<3> {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic")
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric)
};
......@@ -3282,7 +3268,7 @@ class HStoreNamedField: public HBinaryOperation {
}
}
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store_named_field")
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField)
virtual Representation RequiredInputRepresentation(int index) const {
return Representation::Tagged();
......@@ -3337,7 +3323,7 @@ class HStoreNamedGeneric: public HTemplateInstruction<3> {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store_named_generic")
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric)
private:
Handle<String> name_;
......@@ -3370,8 +3356,7 @@ class HStoreKeyedFastElement: public HTemplateInstruction<3> {
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store_keyed_fast_element")
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement)
};
......@@ -3407,8 +3392,8 @@ class HStoreKeyedSpecializedArrayElement: public HTemplateInstruction<3> {
HValue* value() { return OperandAt(2); }
ExternalArrayType array_type() const { return array_type_; }
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
"store_keyed_specialized_array_element")
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement)
private:
ExternalArrayType array_type_;
};
......@@ -3441,7 +3426,7 @@ class HStoreKeyedGeneric: public HTemplateInstruction<4> {
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic")
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric)
private:
bool strict_mode_;
......@@ -3464,7 +3449,7 @@ class HStringAdd: public HBinaryOperation {
return HType::String();
}
DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string_add")
DECLARE_CONCRETE_INSTRUCTION(StringAdd)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -3489,7 +3474,7 @@ class HStringCharCodeAt: public HBinaryOperation {
HValue* string() { return OperandAt(0); }
HValue* index() { return OperandAt(1); }
DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at")
DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -3513,7 +3498,7 @@ class HStringCharFromCode: public HUnaryOperation {
virtual bool DataEquals(HValue* other) { return true; }
DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string_char_from_code")
DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode)
};
......@@ -3534,7 +3519,7 @@ class HStringLength: public HUnaryOperation {
return HType::Smi();
}
DECLARE_CONCRETE_INSTRUCTION(StringLength, "string_length")
DECLARE_CONCRETE_INSTRUCTION(StringLength)
protected:
virtual bool DataEquals(HValue* other) { return true; }
......@@ -3581,7 +3566,7 @@ class HArrayLiteral: public HMaterializedLiteral<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array_literal")
DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral)
private:
int length_;
......@@ -3615,7 +3600,7 @@ class HObjectLiteral: public HMaterializedLiteral<1> {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object_literal")
DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral)
private:
Handle<FixedArray> constant_properties_;
......@@ -3640,7 +3625,7 @@ class HRegExpLiteral: public HMaterializedLiteral<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp_literal")
DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral)
private:
Handle<String> pattern_;
......@@ -3659,7 +3644,7 @@ class HFunctionLiteral: public HTemplateInstruction<0> {
return Representation::None();
}
DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function_literal")
DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral)
Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
bool pretenure() const { return pretenure_; }
......@@ -3680,7 +3665,7 @@ class HTypeof: public HUnaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
DECLARE_CONCRETE_INSTRUCTION(Typeof)
};
......@@ -3698,7 +3683,7 @@ class HToFastProperties: public HUnaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to_fast_properties")
DECLARE_CONCRETE_INSTRUCTION(ToFastProperties)
};
......@@ -3712,7 +3697,7 @@ class HValueOf: public HUnaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value_of")
DECLARE_CONCRETE_INSTRUCTION(ValueOf)
};
......@@ -3728,7 +3713,7 @@ class HDeleteProperty: public HBinaryOperation {
return Representation::Tagged();
}
DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete_property")
DECLARE_CONCRETE_INSTRUCTION(DeleteProperty)
HValue* object() { return left(); }
HValue* key() { return right(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment