Index: src/ia32/lithium-ia32.h |
=================================================================== |
--- src/ia32/lithium-ia32.h (revision 6230) |
+++ src/ia32/lithium-ia32.h (working copy) |
@@ -292,8 +292,8 @@ |
virtual void CompileToNative(LCodeGen* generator) = 0; |
virtual const char* Mnemonic() const = 0; |
- virtual void PrintTo(StringStream* stream) const; |
- virtual void PrintDataTo(StringStream* stream) const { } |
+ virtual void PrintTo(StringStream* stream); |
+ virtual void PrintDataTo(StringStream* stream) { } |
// Declare virtual type testers. |
#define DECLARE_DO(type) virtual bool Is##type() const { return false; } |
@@ -309,9 +309,7 @@ |
LPointerMap* pointer_map() const { return pointer_map_.get(); } |
bool HasPointerMap() const { return pointer_map_.is_set(); } |
- void set_result(LOperand* operand) { result_.set(operand); } |
- LOperand* result() const { return result_.get(); } |
- bool HasResult() const { return result_.is_set(); } |
+ virtual bool HasResult() const = 0; |
void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
HValue* hydrogen_value() const { return hydrogen_value_; } |
@@ -329,12 +327,35 @@ |
private: |
SetOncePointer<LEnvironment> environment_; |
SetOncePointer<LPointerMap> pointer_map_; |
- SetOncePointer<LOperand> result_; |
HValue* hydrogen_value_; |
SetOncePointer<LEnvironment> deoptimization_environment_; |
}; |
+template <int Result> |
+class LTemplateInstruction: public LInstruction { }; |
+ |
+ |
+template<> |
+class LTemplateInstruction<0>: public LInstruction { |
+ virtual bool HasResult() const { return false; } |
+}; |
+ |
+template<> |
+class LTemplateInstruction<1>: public LInstruction { |
+ public: |
+ static LTemplateInstruction<1>* cast(LInstruction* instr) { |
+ ASSERT(instr->HasResult()); |
+ return reinterpret_cast<LTemplateInstruction<1>*>(instr); |
+ } |
+ void set_result(LOperand* operand) { result_.set(operand); } |
+ LOperand* result() const { return result_.get(); } |
+ virtual bool HasResult() const { return result_.is_set(); } |
+ private: |
+ SetOncePointer<LOperand> result_; |
+}; |
+ |
+ |
class LParallelMove : public ZoneObject { |
public: |
LParallelMove() : move_operands_(4) { } |
@@ -349,14 +370,14 @@ |
return &move_operands_; |
} |
- void PrintDataTo(StringStream* stream) const; |
+ void PrintDataTo(StringStream* stream); |
private: |
ZoneList<LMoveOperands> move_operands_; |
}; |
-class LGap: public LInstruction { |
+class LGap: public LTemplateInstruction<0> { |
public: |
explicit LGap(HBasicBlock* block) |
: block_(block) { |
@@ -367,7 +388,7 @@ |
} |
DECLARE_CONCRETE_INSTRUCTION(Gap, "gap") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
bool IsRedundant() const; |
@@ -397,13 +418,13 @@ |
}; |
-class LGoto: public LInstruction { |
+class LGoto: public LTemplateInstruction<0> { |
public: |
LGoto(int block_id, bool include_stack_check = false) |
: block_id_(block_id), include_stack_check_(include_stack_check) { } |
DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int block_id() const { return block_id_; } |
@@ -415,7 +436,7 @@ |
}; |
-class LLazyBailout: public LInstruction { |
+class LLazyBailout: public LTemplateInstruction<0> { |
public: |
LLazyBailout() : gap_instructions_size_(0) { } |
@@ -431,7 +452,7 @@ |
}; |
-class LDeoptimize: public LInstruction { |
+class LDeoptimize: public LTemplateInstruction<0> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
}; |
@@ -444,7 +465,7 @@ |
DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
int block_id() const { return block()->block_id(); } |
bool is_loop_header() const { return block()->IsLoopHeader(); } |
@@ -459,13 +480,13 @@ |
}; |
-class LParameter: public LInstruction { |
+class LParameter: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
}; |
-class LCallStub: public LInstruction { |
+class LCallStub: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
DECLARE_HYDROGEN_ACCESSOR(CallStub) |
@@ -476,13 +497,14 @@ |
}; |
-class LUnknownOSRValue: public LInstruction { |
+class LUnknownOSRValue: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
}; |
-class LUnaryOperation: public LInstruction { |
+template<int R> |
+class LUnaryOperation: public LTemplateInstruction<R> { |
public: |
explicit LUnaryOperation(LOperand* input) : input_(input) { } |
@@ -490,14 +512,14 @@ |
LOperand* input() const { return input_; } |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
private: |
LOperand* input_; |
}; |
-class LBinaryOperation: public LInstruction { |
+class LBinaryOperation: public LTemplateInstruction<1> { |
public: |
LBinaryOperation(LOperand* left, LOperand* right) |
: left_(left), right_(right) { } |
@@ -506,7 +528,7 @@ |
LOperand* left() const { return left_; } |
LOperand* right() const { return right_; } |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
private: |
LOperand* left_; |
@@ -537,7 +559,7 @@ |
}; |
-class LAccessArgumentsAt: public LInstruction { |
+class LAccessArgumentsAt: public LTemplateInstruction<1> { |
public: |
LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) |
: arguments_(arguments), length_(length), index_(index) { } |
@@ -548,7 +570,7 @@ |
LOperand* length() const { return length_; } |
LOperand* index() const { return index_; } |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
private: |
LOperand* arguments_; |
@@ -557,15 +579,16 @@ |
}; |
-class LArgumentsLength: public LUnaryOperation { |
+class LArgumentsLength: public LUnaryOperation<1> { |
public: |
- explicit LArgumentsLength(LOperand* elements) : LUnaryOperation(elements) {} |
+ explicit LArgumentsLength(LOperand* elements) |
+ : LUnaryOperation<1>(elements) {} |
DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") |
}; |
-class LArgumentsElements: public LInstruction { |
+class LArgumentsElements: public LTemplateInstruction<1> { |
public: |
LArgumentsElements() { } |
@@ -636,7 +659,7 @@ |
false_block_id_(false_block_id) { } |
DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -648,15 +671,15 @@ |
}; |
-class LUnaryMathOperation: public LUnaryOperation { |
+class LUnaryMathOperation: public LUnaryOperation<1> { |
public: |
explicit LUnaryMathOperation(LOperand* value) |
- : LUnaryOperation(value) { } |
+ : LUnaryOperation<1>(value) { } |
DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") |
DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
BuiltinFunctionId op() const { return hydrogen()->op(); } |
}; |
@@ -692,10 +715,10 @@ |
}; |
-class LIsNull: public LUnaryOperation { |
+class LIsNull: public LUnaryOperation<1> { |
public: |
LIsNull(LOperand* value, bool is_strict) |
- : LUnaryOperation(value), is_strict_(is_strict) {} |
+ : LUnaryOperation<1>(value), is_strict_(is_strict) {} |
DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") |
@@ -719,7 +742,7 @@ |
false_block_id_(false_block_id) { } |
DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -734,10 +757,10 @@ |
}; |
-class LIsObject: public LUnaryOperation { |
+class LIsObject: public LUnaryOperation<1> { |
public: |
LIsObject(LOperand* value, LOperand* temp) |
- : LUnaryOperation(value), temp_(temp) {} |
+ : LUnaryOperation<1>(value), temp_(temp) {} |
DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object") |
@@ -761,7 +784,7 @@ |
false_block_id_(false_block_id) { } |
DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -776,9 +799,9 @@ |
}; |
-class LIsSmi: public LUnaryOperation { |
+class LIsSmi: public LUnaryOperation<1> { |
public: |
- explicit LIsSmi(LOperand* value) : LUnaryOperation(value) {} |
+ explicit LIsSmi(LOperand* value) : LUnaryOperation<1>(value) {} |
DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") |
DECLARE_HYDROGEN_ACCESSOR(IsSmi) |
@@ -795,7 +818,7 @@ |
false_block_id_(false_block_id) { } |
DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -807,10 +830,10 @@ |
}; |
-class LHasInstanceType: public LUnaryOperation { |
+class LHasInstanceType: public LUnaryOperation<1> { |
public: |
explicit LHasInstanceType(LOperand* value) |
- : LUnaryOperation(value) { } |
+ : LUnaryOperation<1>(value) { } |
DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") |
DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) |
@@ -833,7 +856,7 @@ |
DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
"has-instance-type-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -848,9 +871,9 @@ |
}; |
-class LHasCachedArrayIndex: public LUnaryOperation { |
+class LHasCachedArrayIndex: public LUnaryOperation<1> { |
public: |
- explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation(value) {} |
+ explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation<1>(value) {} |
DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") |
DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) |
@@ -868,7 +891,7 @@ |
DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
"has-cached-array-index-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -880,15 +903,15 @@ |
}; |
-class LClassOfTest: public LUnaryOperation { |
+class LClassOfTest: public LUnaryOperation<1> { |
public: |
LClassOfTest(LOperand* value, LOperand* temp) |
- : LUnaryOperation(value), temporary_(temp) {} |
+ : LUnaryOperation<1>(value), temporary_(temp) {} |
DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") |
DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
LOperand* temporary() { return temporary_; } |
@@ -911,7 +934,7 @@ |
DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, |
"class-of-test-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -987,10 +1010,10 @@ |
}; |
-class LInstanceOfKnownGlobal: public LUnaryOperation { |
+class LInstanceOfKnownGlobal: public LUnaryOperation<1> { |
public: |
LInstanceOfKnownGlobal(LOperand* left, LOperand* temp) |
- : LUnaryOperation(left), temp_(temp) { } |
+ : LUnaryOperation<1>(left), temp_(temp) { } |
DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, |
"instance-of-known-global") |
@@ -1057,7 +1080,7 @@ |
}; |
-class LConstant: public LInstruction { |
+class LConstant: public LTemplateInstruction<1> { |
DECLARE_INSTRUCTION(Constant) |
}; |
@@ -1098,17 +1121,17 @@ |
}; |
-class LBranch: public LUnaryOperation { |
+class LBranch: public LUnaryOperation<1> { |
public: |
LBranch(LOperand* input, int true_block_id, int false_block_id) |
- : LUnaryOperation(input), |
+ : LUnaryOperation<1>(input), |
true_block_id_(true_block_id), |
false_block_id_(false_block_id) { } |
DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
DECLARE_HYDROGEN_ACCESSOR(Value) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -1120,9 +1143,9 @@ |
}; |
-class LCmpMapAndBranch: public LUnaryOperation { |
+class LCmpMapAndBranch: public LUnaryOperation<1> { |
public: |
- explicit LCmpMapAndBranch(LOperand* value) : LUnaryOperation(value) { } |
+ explicit LCmpMapAndBranch(LOperand* value) : LUnaryOperation<1>(value) { } |
DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") |
DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch) |
@@ -1139,28 +1162,28 @@ |
}; |
-class LJSArrayLength: public LUnaryOperation { |
+class LJSArrayLength: public LUnaryOperation<1> { |
public: |
- explicit LJSArrayLength(LOperand* input) : LUnaryOperation(input) { } |
+ explicit LJSArrayLength(LOperand* input) : LUnaryOperation<1>(input) { } |
DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") |
DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) |
}; |
-class LFixedArrayLength: public LUnaryOperation { |
+class LFixedArrayLength: public LUnaryOperation<1> { |
public: |
- explicit LFixedArrayLength(LOperand* input) : LUnaryOperation(input) { } |
+ explicit LFixedArrayLength(LOperand* input) : LUnaryOperation<1>(input) { } |
DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") |
DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) |
}; |
-class LValueOf: public LUnaryOperation { |
+class LValueOf: public LUnaryOperation<1> { |
public: |
LValueOf(LOperand* input, LOperand* temporary) |
- : LUnaryOperation(input), temporary_(temporary) { } |
+ : LUnaryOperation<1>(input), temporary_(temporary) { } |
LOperand* temporary() const { return temporary_; } |
@@ -1172,17 +1195,17 @@ |
}; |
-class LThrow: public LUnaryOperation { |
+class LThrow: public LUnaryOperation<1> { |
public: |
- explicit LThrow(LOperand* value) : LUnaryOperation(value) { } |
+ explicit LThrow(LOperand* value) : LUnaryOperation<1>(value) { } |
DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") |
}; |
-class LBitNotI: public LUnaryOperation { |
+class LBitNotI: public LUnaryOperation<1> { |
public: |
- explicit LBitNotI(LOperand* use) : LUnaryOperation(use) { } |
+ explicit LBitNotI(LOperand* use) : LUnaryOperation<1>(use) { } |
DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") |
}; |
@@ -1238,26 +1261,26 @@ |
}; |
-class LReturn: public LUnaryOperation { |
+class LReturn: public LUnaryOperation<1> { |
public: |
- explicit LReturn(LOperand* use) : LUnaryOperation(use) { } |
+ explicit LReturn(LOperand* use) : LUnaryOperation<1>(use) { } |
DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
}; |
-class LLoadNamedField: public LUnaryOperation { |
+class LLoadNamedField: public LUnaryOperation<1> { |
public: |
- explicit LLoadNamedField(LOperand* object) : LUnaryOperation(object) { } |
+ explicit LLoadNamedField(LOperand* object) : LUnaryOperation<1>(object) { } |
DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
}; |
-class LLoadNamedGeneric: public LUnaryOperation { |
+class LLoadNamedGeneric: public LUnaryOperation<1> { |
public: |
- explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation(object) { } |
+ explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation<1>(object) { } |
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") |
DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) |
@@ -1267,10 +1290,10 @@ |
}; |
-class LLoadFunctionPrototype: public LUnaryOperation { |
+class LLoadFunctionPrototype: public LUnaryOperation<1> { |
public: |
LLoadFunctionPrototype(LOperand* function, LOperand* temporary) |
- : LUnaryOperation(function), temporary_(temporary) { } |
+ : LUnaryOperation<1>(function), temporary_(temporary) { } |
DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") |
DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) |
@@ -1283,9 +1306,9 @@ |
}; |
-class LLoadElements: public LUnaryOperation { |
+class LLoadElements: public LUnaryOperation<1> { |
public: |
- explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { } |
+ explicit LLoadElements(LOperand* obj) : LUnaryOperation<1>(obj) { } |
DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") |
}; |
@@ -1323,78 +1346,78 @@ |
}; |
-class LLoadGlobal: public LInstruction { |
+class LLoadGlobal: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global") |
DECLARE_HYDROGEN_ACCESSOR(LoadGlobal) |
}; |
-class LStoreGlobal: public LUnaryOperation { |
+class LStoreGlobal: public LUnaryOperation<1> { |
public: |
- explicit LStoreGlobal(LOperand* value) : LUnaryOperation(value) {} |
+ explicit LStoreGlobal(LOperand* value) : LUnaryOperation<1>(value) {} |
DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") |
DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) |
}; |
-class LPushArgument: public LUnaryOperation { |
+class LPushArgument: public LUnaryOperation<1> { |
public: |
- explicit LPushArgument(LOperand* argument) : LUnaryOperation(argument) {} |
+ explicit LPushArgument(LOperand* argument) : LUnaryOperation<1>(argument) {} |
DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
}; |
-class LGlobalObject: public LInstruction { |
+class LGlobalObject: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") |
}; |
-class LGlobalReceiver: public LInstruction { |
+class LGlobalReceiver: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") |
}; |
-class LCallConstantFunction: public LInstruction { |
+class LCallConstantFunction: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") |
DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
Handle<JSFunction> function() const { return hydrogen()->function(); } |
int arity() const { return hydrogen()->argument_count() - 1; } |
}; |
-class LCallKeyed: public LInstruction { |
+class LCallKeyed: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") |
DECLARE_HYDROGEN_ACCESSOR(CallKeyed) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
int arity() const { return hydrogen()->argument_count() - 1; } |
}; |
-class LCallNamed: public LInstruction { |
+class LCallNamed: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named") |
DECLARE_HYDROGEN_ACCESSOR(CallNamed) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
Handle<String> name() const { return hydrogen()->name(); } |
int arity() const { return hydrogen()->argument_count() - 1; } |
}; |
-class LCallFunction: public LInstruction { |
+class LCallFunction: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") |
DECLARE_HYDROGEN_ACCESSOR(CallFunction) |
@@ -1403,44 +1426,44 @@ |
}; |
-class LCallGlobal: public LInstruction { |
+class LCallGlobal: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global") |
DECLARE_HYDROGEN_ACCESSOR(CallGlobal) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
Handle<String> name() const {return hydrogen()->name(); } |
int arity() const { return hydrogen()->argument_count() - 1; } |
}; |
-class LCallKnownGlobal: public LInstruction { |
+class LCallKnownGlobal: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global") |
DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
Handle<JSFunction> target() const { return hydrogen()->target(); } |
int arity() const { return hydrogen()->argument_count() - 1; } |
}; |
-class LCallNew: public LUnaryOperation { |
+class LCallNew: public LUnaryOperation<1> { |
public: |
- explicit LCallNew(LOperand* constructor) : LUnaryOperation(constructor) { } |
+ explicit LCallNew(LOperand* constructor) : LUnaryOperation<1>(constructor) { } |
DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") |
DECLARE_HYDROGEN_ACCESSOR(CallNew) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
int arity() const { return hydrogen()->argument_count() - 1; } |
}; |
-class LCallRuntime: public LInstruction { |
+class LCallRuntime: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
@@ -1450,26 +1473,26 @@ |
}; |
-class LInteger32ToDouble: public LUnaryOperation { |
+class LInteger32ToDouble: public LUnaryOperation<1> { |
public: |
- explicit LInteger32ToDouble(LOperand* use) : LUnaryOperation(use) { } |
+ explicit LInteger32ToDouble(LOperand* use) : LUnaryOperation<1>(use) { } |
DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
}; |
-class LNumberTagI: public LUnaryOperation { |
+class LNumberTagI: public LUnaryOperation<1> { |
public: |
- explicit LNumberTagI(LOperand* use) : LUnaryOperation(use) { } |
+ explicit LNumberTagI(LOperand* use) : LUnaryOperation<1>(use) { } |
DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") |
}; |
-class LNumberTagD: public LUnaryOperation { |
+class LNumberTagD: public LUnaryOperation<1> { |
public: |
explicit LNumberTagD(LOperand* value, LOperand* temp) |
- : LUnaryOperation(value), temp_(temp) { } |
+ : LUnaryOperation<1>(value), temp_(temp) { } |
DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
@@ -1481,9 +1504,9 @@ |
// Sometimes truncating conversion from a tagged value to an int32. |
-class LDoubleToI: public LUnaryOperation { |
+class LDoubleToI: public LUnaryOperation<1> { |
public: |
- explicit LDoubleToI(LOperand* value) : LUnaryOperation(value) { } |
+ explicit LDoubleToI(LOperand* value) : LUnaryOperation<1>(value) { } |
DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
DECLARE_HYDROGEN_ACCESSOR(Change) |
@@ -1493,10 +1516,10 @@ |
// Truncating conversion from a tagged value to an int32. |
-class LTaggedToI: public LUnaryOperation { |
+class LTaggedToI: public LUnaryOperation<1> { |
public: |
LTaggedToI(LOperand* value, LOperand* temp) |
- : LUnaryOperation(value), temp_(temp) { } |
+ : LUnaryOperation<1>(value), temp_(temp) { } |
DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
DECLARE_HYDROGEN_ACCESSOR(Change) |
@@ -1509,26 +1532,26 @@ |
}; |
-class LSmiTag: public LUnaryOperation { |
+class LSmiTag: public LUnaryOperation<1> { |
public: |
- explicit LSmiTag(LOperand* use) : LUnaryOperation(use) { } |
+ explicit LSmiTag(LOperand* use) : LUnaryOperation<1>(use) { } |
DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
}; |
-class LNumberUntagD: public LUnaryOperation { |
+class LNumberUntagD: public LUnaryOperation<1> { |
public: |
- explicit LNumberUntagD(LOperand* value) : LUnaryOperation(value) { } |
+ explicit LNumberUntagD(LOperand* value) : LUnaryOperation<1>(value) { } |
DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
}; |
-class LSmiUntag: public LUnaryOperation { |
+class LSmiUntag: public LUnaryOperation<1> { |
public: |
LSmiUntag(LOperand* use, bool needs_check) |
- : LUnaryOperation(use), needs_check_(needs_check) { } |
+ : LUnaryOperation<1>(use), needs_check_(needs_check) { } |
DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
@@ -1539,14 +1562,14 @@ |
}; |
-class LStoreNamed: public LInstruction { |
+class LStoreNamed: public LTemplateInstruction<0> { |
public: |
LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val) |
: object_(obj), name_(name), value_(val) { } |
DECLARE_INSTRUCTION(StoreNamed) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
LOperand* object() const { return object_; } |
Handle<Object> name() const { return name_; } |
@@ -1605,14 +1628,14 @@ |
}; |
-class LStoreKeyed: public LInstruction { |
+class LStoreKeyed: public LTemplateInstruction<0> { |
public: |
LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) |
: object_(obj), key_(key), value_(val) { } |
DECLARE_INSTRUCTION(StoreKeyed) |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
LOperand* object() const { return object_; } |
LOperand* key() const { return key_; } |
@@ -1645,19 +1668,19 @@ |
}; |
-class LCheckFunction: public LUnaryOperation { |
+class LCheckFunction: public LUnaryOperation<0> { |
public: |
- explicit LCheckFunction(LOperand* use) : LUnaryOperation(use) { } |
+ explicit LCheckFunction(LOperand* use) : LUnaryOperation<0>(use) { } |
DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") |
DECLARE_HYDROGEN_ACCESSOR(CheckFunction) |
}; |
-class LCheckInstanceType: public LUnaryOperation { |
+class LCheckInstanceType: public LUnaryOperation<0> { |
public: |
LCheckInstanceType(LOperand* use, LOperand* temp) |
- : LUnaryOperation(use), temp_(temp) { } |
+ : LUnaryOperation<0>(use), temp_(temp) { } |
DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") |
DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) |
@@ -1669,16 +1692,16 @@ |
}; |
-class LCheckMap: public LUnaryOperation { |
+class LCheckMap: public LUnaryOperation<0> { |
public: |
- explicit LCheckMap(LOperand* use) : LUnaryOperation(use) { } |
+ explicit LCheckMap(LOperand* use) : LUnaryOperation<0>(use) { } |
DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") |
DECLARE_HYDROGEN_ACCESSOR(CheckMap) |
}; |
-class LCheckPrototypeMaps: public LInstruction { |
+class LCheckPrototypeMaps: public LTemplateInstruction<0> { |
public: |
LCheckPrototypeMaps(LOperand* temp, |
Handle<JSObject> holder, |
@@ -1700,10 +1723,10 @@ |
}; |
-class LCheckSmi: public LUnaryOperation { |
+class LCheckSmi: public LUnaryOperation<0> { |
public: |
LCheckSmi(LOperand* use, Condition condition) |
- : LUnaryOperation(use), condition_(condition) { } |
+ : LUnaryOperation<0>(use), condition_(condition) { } |
Condition condition() const { return condition_; } |
@@ -1717,7 +1740,7 @@ |
}; |
-class LMaterializedLiteral: public LInstruction { |
+class LMaterializedLiteral: public LTemplateInstruction<1> { |
public: |
DECLARE_INSTRUCTION(MaterializedLiteral) |
}; |
@@ -1744,7 +1767,7 @@ |
}; |
-class LFunctionLiteral: public LInstruction { |
+class LFunctionLiteral: public LTemplateInstruction<1> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
@@ -1753,18 +1776,18 @@ |
}; |
-class LTypeof: public LUnaryOperation { |
+class LTypeof: public LUnaryOperation<1> { |
public: |
- explicit LTypeof(LOperand* input) : LUnaryOperation(input) { } |
+ explicit LTypeof(LOperand* input) : LUnaryOperation<1>(input) { } |
DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
}; |
-class LTypeofIs: public LUnaryOperation { |
+class LTypeofIs: public LUnaryOperation<1> { |
public: |
- explicit LTypeofIs(LOperand* input) : LUnaryOperation(input) { } |
- virtual void PrintDataTo(StringStream* stream) const; |
+ explicit LTypeofIs(LOperand* input) : LUnaryOperation<1>(input) { } |
+ virtual void PrintDataTo(StringStream* stream); |
DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") |
DECLARE_HYDROGEN_ACCESSOR(TypeofIs) |
@@ -1784,7 +1807,7 @@ |
DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
- virtual void PrintDataTo(StringStream* stream) const; |
+ virtual void PrintDataTo(StringStream* stream); |
virtual bool IsControl() const { return true; } |
int true_block_id() const { return true_block_id_; } |
@@ -1807,7 +1830,7 @@ |
}; |
-class LOsrEntry: public LInstruction { |
+class LOsrEntry: public LTemplateInstruction<0> { |
public: |
LOsrEntry(); |
@@ -1830,7 +1853,7 @@ |
}; |
-class LStackCheck: public LInstruction { |
+class LStackCheck: public LTemplateInstruction<0> { |
public: |
DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
}; |
@@ -1851,7 +1874,7 @@ |
} |
void RecordPointer(LOperand* op); |
- void PrintTo(StringStream* stream) const; |
+ void PrintTo(StringStream* stream); |
private: |
ZoneList<LOperand*> pointer_operands_; |
@@ -1917,7 +1940,7 @@ |
// Emit frame translation commands for this environment. |
void WriteTranslation(LCodeGen* cgen, Translation* translation) const; |
- void PrintTo(StringStream* stream) const; |
+ void PrintTo(StringStream* stream); |
private: |
Handle<JSFunction> closure_; |
@@ -2077,13 +2100,14 @@ |
// Methods for setting up define-use relationships. |
// Return the same instruction that they are passed. |
- LInstruction* Define(LInstruction* instr, LUnallocated* result); |
- LInstruction* Define(LInstruction* instr); |
- LInstruction* DefineAsRegister(LInstruction* instr); |
- LInstruction* DefineAsSpilled(LInstruction* instr, int index); |
- LInstruction* DefineSameAsFirst(LInstruction* instr); |
- LInstruction* DefineFixed(LInstruction* instr, Register reg); |
- LInstruction* DefineFixedDouble(LInstruction* instr, XMMRegister reg); |
+ LInstruction* Define(LTemplateInstruction<1>* instr, LUnallocated* result); |
+ LInstruction* Define(LTemplateInstruction<1>* instr); |
+ LInstruction* DefineAsRegister(LTemplateInstruction<1>* instr); |
+ LInstruction* DefineAsSpilled(LTemplateInstruction<1>* instr, int index); |
+ LInstruction* DefineSameAsFirst(LTemplateInstruction<1>* instr); |
+ LInstruction* DefineFixed(LTemplateInstruction<1>* instr, Register reg); |
+ LInstruction* DefineFixedDouble(LTemplateInstruction<1>* instr, |
+ XMMRegister reg); |
LInstruction* AssignEnvironment(LInstruction* instr); |
LInstruction* AssignPointerMap(LInstruction* instr); |