| Index: src/arm/lithium-arm.h
|
| ===================================================================
|
| --- src/arm/lithium-arm.h (revision 6800)
|
| +++ src/arm/lithium-arm.h (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2010 the V8 project authors. All rights reserved.
|
| +// Copyright 2011 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -30,6 +30,7 @@
|
|
|
| #include "hydrogen.h"
|
| #include "lithium-allocator.h"
|
| +#include "lithium.h"
|
| #include "safepoint-table.h"
|
|
|
| namespace v8 {
|
| @@ -37,121 +38,12 @@
|
|
|
| // Forward declarations.
|
| class LCodeGen;
|
| -class LEnvironment;
|
| -class Translation;
|
|
|
| -
|
| -// Type hierarchy:
|
| -//
|
| -// LInstruction
|
| -// LAccessArgumentsAt
|
| -// LArgumentsElements
|
| -// LArgumentsLength
|
| -// LBinaryOperation
|
| -// LAddI
|
| -// LApplyArguments
|
| -// LArithmeticD
|
| -// LArithmeticT
|
| -// LBitI
|
| -// LBoundsCheck
|
| -// LCmpID
|
| -// LCmpIDAndBranch
|
| -// LCmpJSObjectEq
|
| -// LCmpJSObjectEqAndBranch
|
| -// LCmpT
|
| -// LDivI
|
| -// LInstanceOf
|
| -// LInstanceOfAndBranch
|
| -// LLoadKeyedFastElement
|
| -// LLoadKeyedGeneric
|
| -// LModI
|
| -// LMulI
|
| -// LShiftI
|
| -// LSubI
|
| -// LCallConstantFunction
|
| -// LCallFunction
|
| -// LCallGlobal
|
| -// LCallKeyed
|
| -// LCallKnownGlobal
|
| -// LCallNamed
|
| -// LCallRuntime
|
| -// LCallStub
|
| -// LConstant
|
| -// LConstantD
|
| -// LConstantI
|
| -// LConstantT
|
| -// LDeoptimize
|
| -// LFunctionLiteral
|
| -// LGlobalObject
|
| -// LGlobalReceiver
|
| -// LLabel
|
| -// LLayzBailout
|
| -// LLoadGlobal
|
| -// LMaterializedLiteral
|
| -// LArrayLiteral
|
| -// LObjectLiteral
|
| -// LRegExpLiteral
|
| -// LOsrEntry
|
| -// LParameter
|
| -// LStackCheck
|
| -// LStoreKeyed
|
| -// LStoreKeyedFastElement
|
| -// LStoreKeyedGeneric
|
| -// LStoreNamed
|
| -// LStoreNamedField
|
| -// LStoreNamedGeneric
|
| -// LUnaryOperation
|
| -// LJSArrayLength
|
| -// LFixedArrayLength
|
| -// LBitNotI
|
| -// LBranch
|
| -// LCallNew
|
| -// LCheckFunction
|
| -// LCheckInstanceType
|
| -// LCheckMap
|
| -// LCheckPrototypeMaps
|
| -// LCheckSmi
|
| -// LClassOfTest
|
| -// LClassOfTestAndBranch
|
| -// LDeleteProperty
|
| -// LDoubleToI
|
| -// LHasCachedArrayIndex
|
| -// LHasCachedArrayIndexAndBranch
|
| -// LHasInstanceType
|
| -// LHasInstanceTypeAndBranch
|
| -// LInteger32ToDouble
|
| -// LIsNull
|
| -// LIsNullAndBranch
|
| -// LIsObject
|
| -// LIsObjectAndBranch
|
| -// LIsSmi
|
| -// LIsSmiAndBranch
|
| -// LLoadNamedField
|
| -// LLoadNamedGeneric
|
| -// LLoadFunctionPrototype
|
| -// LNumberTagD
|
| -// LNumberTagI
|
| -// LPushArgument
|
| -// LReturn
|
| -// LSmiTag
|
| -// LStoreGlobal
|
| -// LTaggedToI
|
| -// LThrow
|
| -// LTypeof
|
| -// LTypeofIs
|
| -// LTypeofIsAndBranch
|
| -// LUnaryMathOperation
|
| -// LValueOf
|
| -// LUnknownOSRValue
|
| -
|
| #define LITHIUM_ALL_INSTRUCTION_LIST(V) \
|
| - V(BinaryOperation) \
|
| - V(Constant) \
|
| + V(ControlInstruction) \
|
| V(Call) \
|
| - V(MaterializedLiteral) \
|
| V(StoreKeyed) \
|
| V(StoreNamed) \
|
| - V(UnaryOperation) \
|
| LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
|
|
|
|
|
| @@ -182,6 +74,8 @@
|
| V(CheckMap) \
|
| V(CheckPrototypeMaps) \
|
| V(CheckSmi) \
|
| + V(ClassOfTest) \
|
| + V(ClassOfTestAndBranch) \
|
| V(CmpID) \
|
| V(CmpIDAndBranch) \
|
| V(CmpJSObjectEq) \
|
| @@ -192,6 +86,7 @@
|
| V(ConstantD) \
|
| V(ConstantI) \
|
| V(ConstantT) \
|
| + V(Context) \
|
| V(DeleteProperty) \
|
| V(Deoptimize) \
|
| V(DivI) \
|
| @@ -202,8 +97,13 @@
|
| V(GlobalObject) \
|
| V(GlobalReceiver) \
|
| V(Goto) \
|
| + V(HasCachedArrayIndex) \
|
| + V(HasCachedArrayIndexAndBranch) \
|
| + V(HasInstanceType) \
|
| + V(HasInstanceTypeAndBranch) \
|
| V(InstanceOf) \
|
| V(InstanceOfAndBranch) \
|
| + V(InstanceOfKnownGlobal) \
|
| V(Integer32ToDouble) \
|
| V(IsNull) \
|
| V(IsNullAndBranch) \
|
| @@ -212,21 +112,18 @@
|
| V(IsSmi) \
|
| V(IsSmiAndBranch) \
|
| V(JSArrayLength) \
|
| - V(HasInstanceType) \
|
| - V(HasInstanceTypeAndBranch) \
|
| - V(HasCachedArrayIndex) \
|
| - V(HasCachedArrayIndexAndBranch) \
|
| - V(ClassOfTest) \
|
| - V(ClassOfTestAndBranch) \
|
| V(Label) \
|
| V(LazyBailout) \
|
| + V(LoadContextSlot) \
|
| V(LoadElements) \
|
| + V(LoadFunctionPrototype) \
|
| V(LoadGlobal) \
|
| V(LoadKeyedFastElement) \
|
| V(LoadKeyedGeneric) \
|
| V(LoadNamedField) \
|
| V(LoadNamedGeneric) \
|
| - V(LoadFunctionPrototype) \
|
| + V(LoadPixelArrayElement) \
|
| + V(LoadPixelArrayExternalPointer) \
|
| V(ModI) \
|
| V(MulI) \
|
| V(NumberTagD) \
|
| @@ -234,7 +131,9 @@
|
| V(NumberUntagD) \
|
| V(ObjectLiteral) \
|
| V(OsrEntry) \
|
| + V(OuterContext) \
|
| V(Parameter) \
|
| + V(PixelArrayLength) \
|
| V(PushArgument) \
|
| V(RegExpLiteral) \
|
| V(Return) \
|
| @@ -242,17 +141,22 @@
|
| V(SmiTag) \
|
| V(SmiUntag) \
|
| V(StackCheck) \
|
| + V(StoreContextSlot) \
|
| V(StoreGlobal) \
|
| V(StoreKeyedFastElement) \
|
| V(StoreKeyedGeneric) \
|
| V(StoreNamedField) \
|
| V(StoreNamedGeneric) \
|
| + V(StringCharCodeAt) \
|
| + V(StringLength) \
|
| V(SubI) \
|
| V(TaggedToI) \
|
| V(Throw) \
|
| V(Typeof) \
|
| V(TypeofIs) \
|
| V(TypeofIsAndBranch) \
|
| + V(IsConstructCall) \
|
| + V(IsConstructCallAndBranch) \
|
| V(UnaryMathOperation) \
|
| V(UnknownOSRValue) \
|
| V(ValueOf)
|
| @@ -281,32 +185,34 @@
|
| class LInstruction: public ZoneObject {
|
| public:
|
| LInstruction()
|
| - : hydrogen_value_(NULL) { }
|
| + : environment_(NULL),
|
| + hydrogen_value_(NULL),
|
| + is_call_(false),
|
| + is_save_doubles_(false) { }
|
| virtual ~LInstruction() { }
|
|
|
| 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) = 0;
|
| + virtual void PrintOutputOperandTo(StringStream* stream) = 0;
|
|
|
| // Declare virtual type testers.
|
| #define DECLARE_DO(type) virtual bool Is##type() const { return false; }
|
| LITHIUM_ALL_INSTRUCTION_LIST(DECLARE_DO)
|
| #undef DECLARE_DO
|
| +
|
| virtual bool IsControl() const { return false; }
|
| + virtual void SetBranchTargets(int true_block_id, int false_block_id) { }
|
|
|
| - void set_environment(LEnvironment* env) { environment_.set(env); }
|
| - LEnvironment* environment() const { return environment_.get(); }
|
| - bool HasEnvironment() const { return environment_.is_set(); }
|
| + void set_environment(LEnvironment* env) { environment_ = env; }
|
| + LEnvironment* environment() const { return environment_; }
|
| + bool HasEnvironment() const { return environment_ != NULL; }
|
|
|
| void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
|
| 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(); }
|
| -
|
| void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
|
| HValue* hydrogen_value() const { return hydrogen_value_; }
|
|
|
| @@ -320,63 +226,98 @@
|
| return deoptimization_environment_.is_set();
|
| }
|
|
|
| + void MarkAsCall() { is_call_ = true; }
|
| + void MarkAsSaveDoubles() { is_save_doubles_ = true; }
|
| +
|
| + // Interface to the register allocator and iterators.
|
| + bool IsMarkedAsCall() const { return is_call_; }
|
| + bool IsMarkedAsSaveDoubles() const { return is_save_doubles_; }
|
| +
|
| + virtual bool HasResult() const = 0;
|
| + virtual LOperand* result() = 0;
|
| +
|
| + virtual int InputCount() = 0;
|
| + virtual LOperand* InputAt(int i) = 0;
|
| + virtual int TempCount() = 0;
|
| + virtual LOperand* TempAt(int i) = 0;
|
| +
|
| + LOperand* FirstInput() { return InputAt(0); }
|
| + LOperand* Output() { return HasResult() ? result() : NULL; }
|
| +
|
| +#ifdef DEBUG
|
| + void VerifyCall();
|
| +#endif
|
| +
|
| private:
|
| - SetOncePointer<LEnvironment> environment_;
|
| + LEnvironment* environment_;
|
| SetOncePointer<LPointerMap> pointer_map_;
|
| - SetOncePointer<LOperand> result_;
|
| HValue* hydrogen_value_;
|
| SetOncePointer<LEnvironment> deoptimization_environment_;
|
| + bool is_call_;
|
| + bool is_save_doubles_;
|
| };
|
|
|
|
|
| -class LGapNode;
|
| -
|
| -
|
| -class LGapResolver BASE_EMBEDDED {
|
| +template<typename ElementType, int NumElements>
|
| +class OperandContainer {
|
| public:
|
| - LGapResolver(const ZoneList<LMoveOperands>* moves, LOperand* marker_operand);
|
| - const ZoneList<LMoveOperands>* ResolveInReverseOrder();
|
| + OperandContainer() {
|
| + for (int i = 0; i < NumElements; i++) elems_[i] = NULL;
|
| + }
|
| + int length() { return NumElements; }
|
| + ElementType& operator[](int i) {
|
| + ASSERT(i < length());
|
| + return elems_[i];
|
| + }
|
| + void PrintOperandsTo(StringStream* stream);
|
|
|
| private:
|
| - LGapNode* LookupNode(LOperand* operand);
|
| - bool CanReach(LGapNode* a, LGapNode* b, int visited_id);
|
| - bool CanReach(LGapNode* a, LGapNode* b);
|
| - void RegisterMove(LMoveOperands move);
|
| - void AddResultMove(LOperand* from, LOperand* to);
|
| - void AddResultMove(LGapNode* from, LGapNode* to);
|
| - void ResolveCycle(LGapNode* start);
|
| -
|
| - ZoneList<LGapNode*> nodes_;
|
| - ZoneList<LGapNode*> identified_cycles_;
|
| - ZoneList<LMoveOperands> result_;
|
| - LOperand* marker_operand_;
|
| - int next_visited_id_;
|
| - int bailout_after_ast_id_;
|
| + ElementType elems_[NumElements];
|
| };
|
|
|
|
|
| -class LParallelMove : public ZoneObject {
|
| +template<typename ElementType>
|
| +class OperandContainer<ElementType, 0> {
|
| public:
|
| - LParallelMove() : move_operands_(4) { }
|
| -
|
| - void AddMove(LOperand* from, LOperand* to) {
|
| - move_operands_.Add(LMoveOperands(from, to));
|
| + int length() { return 0; }
|
| + void PrintOperandsTo(StringStream* stream) { }
|
| + ElementType& operator[](int i) {
|
| + UNREACHABLE();
|
| + static ElementType t = 0;
|
| + return t;
|
| }
|
| +};
|
|
|
| - bool IsRedundant() const;
|
|
|
| - const ZoneList<LMoveOperands>* move_operands() const {
|
| - return &move_operands_;
|
| - }
|
| +// R = number of result operands (0 or 1).
|
| +// I = number of input operands.
|
| +// T = number of temporary operands.
|
| +template<int R, int I, int T>
|
| +class LTemplateInstruction: public LInstruction {
|
| + public:
|
| + // Allow 0 or 1 output operands.
|
| + STATIC_ASSERT(R == 0 || R == 1);
|
| + virtual bool HasResult() const { return R != 0; }
|
| + void set_result(LOperand* operand) { results_[0] = operand; }
|
| + LOperand* result() { return results_[0]; }
|
|
|
| - void PrintDataTo(StringStream* stream) const;
|
| + int InputCount() { return I; }
|
| + LOperand* InputAt(int i) { return inputs_[i]; }
|
|
|
| - private:
|
| - ZoneList<LMoveOperands> move_operands_;
|
| + int TempCount() { return T; }
|
| + LOperand* TempAt(int i) { return temps_[i]; }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream);
|
| + virtual void PrintOutputOperandTo(StringStream* stream);
|
| +
|
| + protected:
|
| + OperandContainer<LOperand*, R> results_;
|
| + OperandContainer<LOperand*, I> inputs_;
|
| + OperandContainer<LOperand*, T> temps_;
|
| };
|
|
|
|
|
| -class LGap: public LInstruction {
|
| +class LGap: public LTemplateInstruction<0, 0, 0> {
|
| public:
|
| explicit LGap(HBasicBlock* block)
|
| : block_(block) {
|
| @@ -417,13 +358,13 @@
|
| };
|
|
|
|
|
| -class LGoto: public LInstruction {
|
| +class LGoto: public LTemplateInstruction<0, 0, 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_; }
|
| @@ -435,7 +376,7 @@
|
| };
|
|
|
|
|
| -class LLazyBailout: public LInstruction {
|
| +class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
|
| public:
|
| LLazyBailout() : gap_instructions_size_(0) { }
|
|
|
| @@ -451,7 +392,7 @@
|
| };
|
|
|
|
|
| -class LDeoptimize: public LInstruction {
|
| +class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
|
| };
|
| @@ -464,7 +405,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(); }
|
| @@ -479,109 +420,98 @@
|
| };
|
|
|
|
|
| -class LParameter: public LInstruction {
|
| +class LParameter: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
|
| };
|
|
|
|
|
| -class LCallStub: public LInstruction {
|
| +class LCallStub: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
|
| DECLARE_HYDROGEN_ACCESSOR(CallStub)
|
| +
|
| + TranscendentalCache::Type transcendental_type() {
|
| + return hydrogen()->transcendental_type();
|
| + }
|
| };
|
|
|
|
|
| -class LUnknownOSRValue: public LInstruction {
|
| +class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
|
| };
|
|
|
|
|
| -class LUnaryOperation: public LInstruction {
|
| +template<int I, int T>
|
| +class LControlInstruction: public LTemplateInstruction<0, I, T> {
|
| public:
|
| - explicit LUnaryOperation(LOperand* input) : input_(input) { }
|
| + DECLARE_INSTRUCTION(ControlInstruction)
|
| + virtual bool IsControl() const { return true; }
|
|
|
| - DECLARE_INSTRUCTION(UnaryOperation)
|
| + int true_block_id() const { return true_block_id_; }
|
| + int false_block_id() const { return false_block_id_; }
|
| + void SetBranchTargets(int true_block_id, int false_block_id) {
|
| + true_block_id_ = true_block_id;
|
| + false_block_id_ = false_block_id;
|
| + }
|
|
|
| - LOperand* input() const { return input_; }
|
| -
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| -
|
| private:
|
| - LOperand* input_;
|
| + int true_block_id_;
|
| + int false_block_id_;
|
| };
|
|
|
|
|
| -class LBinaryOperation: public LInstruction {
|
| +class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
|
| public:
|
| - LBinaryOperation(LOperand* left, LOperand* right)
|
| - : left_(left), right_(right) { }
|
| -
|
| - DECLARE_INSTRUCTION(BinaryOperation)
|
| -
|
| - LOperand* left() const { return left_; }
|
| - LOperand* right() const { return right_; }
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| -
|
| - private:
|
| - LOperand* left_;
|
| - LOperand* right_;
|
| -};
|
| -
|
| -
|
| -class LApplyArguments: public LBinaryOperation {
|
| - public:
|
| LApplyArguments(LOperand* function,
|
| LOperand* receiver,
|
| LOperand* length,
|
| - LOperand* elements)
|
| - : LBinaryOperation(function, receiver),
|
| - length_(length),
|
| - elements_(elements) { }
|
| + LOperand* elements) {
|
| + inputs_[0] = function;
|
| + inputs_[1] = receiver;
|
| + inputs_[2] = length;
|
| + inputs_[3] = elements;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
|
|
|
| - LOperand* function() const { return left(); }
|
| - LOperand* receiver() const { return right(); }
|
| - LOperand* length() const { return length_; }
|
| - LOperand* elements() const { return elements_; }
|
| -
|
| - private:
|
| - LOperand* length_;
|
| - LOperand* elements_;
|
| + LOperand* function() { return inputs_[0]; }
|
| + LOperand* receiver() { return inputs_[1]; }
|
| + LOperand* length() { return inputs_[2]; }
|
| + LOperand* elements() { return inputs_[3]; }
|
| };
|
|
|
|
|
| -class LAccessArgumentsAt: public LInstruction {
|
| +class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
|
| public:
|
| - LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index)
|
| - : arguments_(arguments), length_(length), index_(index) { }
|
| + LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
|
| + inputs_[0] = arguments;
|
| + inputs_[1] = length;
|
| + inputs_[2] = index;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
|
|
|
| - LOperand* arguments() const { return arguments_; }
|
| - LOperand* length() const { return length_; }
|
| - LOperand* index() const { return index_; }
|
| + LOperand* arguments() { return inputs_[0]; }
|
| + LOperand* length() { return inputs_[1]; }
|
| + LOperand* index() { return inputs_[2]; }
|
|
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| -
|
| - private:
|
| - LOperand* arguments_;
|
| - LOperand* length_;
|
| - LOperand* index_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LArgumentsLength: public LUnaryOperation {
|
| +class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LArgumentsLength(LOperand* elements) : LUnaryOperation(elements) {}
|
| + explicit LArgumentsLength(LOperand* elements) {
|
| + inputs_[0] = elements;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
|
| };
|
|
|
|
|
| -class LArgumentsElements: public LInstruction {
|
| +class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| LArgumentsElements() { }
|
|
|
| @@ -589,351 +519,272 @@
|
| };
|
|
|
|
|
| -class LModI: public LBinaryOperation {
|
| +class LModI: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LModI(LOperand* left, LOperand* right) : LBinaryOperation(left, right) { }
|
| + LModI(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
|
| DECLARE_HYDROGEN_ACCESSOR(Mod)
|
| };
|
|
|
|
|
| -class LDivI: public LBinaryOperation {
|
| +class LDivI: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LDivI(LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right) { }
|
| + LDivI(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
|
| DECLARE_HYDROGEN_ACCESSOR(Div)
|
| };
|
|
|
|
|
| -class LMulI: public LBinaryOperation {
|
| +class LMulI: public LTemplateInstruction<1, 2, 1> {
|
| public:
|
| - LMulI(LOperand* left, LOperand* right, LOperand* temp)
|
| - : LBinaryOperation(left, right), temp_(temp) { }
|
| + LMulI(LOperand* left, LOperand* right, LOperand* temp) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
|
| DECLARE_HYDROGEN_ACCESSOR(Mul)
|
| -
|
| - LOperand* temp() const { return temp_; }
|
| -
|
| - private:
|
| - LOperand* temp_;
|
| };
|
|
|
|
|
| -class LCmpID: public LBinaryOperation {
|
| +class LCmpID: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LCmpID(Token::Value op, LOperand* left, LOperand* right, bool is_double)
|
| - : LBinaryOperation(left, right), op_(op), is_double_(is_double) { }
|
| + LCmpID(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| - Token::Value op() const { return op_; }
|
| - bool is_double() const { return is_double_; }
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
|
| + DECLARE_HYDROGEN_ACCESSOR(Compare)
|
|
|
| - private:
|
| - Token::Value op_;
|
| - bool is_double_;
|
| + Token::Value op() const { return hydrogen()->token(); }
|
| + bool is_double() const {
|
| + return hydrogen()->GetInputRepresentation().IsDouble();
|
| + }
|
| };
|
|
|
|
|
| -class LCmpIDAndBranch: public LCmpID {
|
| +class LCmpIDAndBranch: public LControlInstruction<2, 0> {
|
| public:
|
| - LCmpIDAndBranch(Token::Value op,
|
| - LOperand* left,
|
| - LOperand* right,
|
| - int true_block_id,
|
| - int false_block_id,
|
| - bool is_double)
|
| - : LCmpID(op, left, right, is_double),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + LCmpIDAndBranch(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
| + DECLARE_HYDROGEN_ACCESSOR(Compare)
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| + Token::Value op() const { return hydrogen()->token(); }
|
| + bool is_double() const {
|
| + return hydrogen()->GetInputRepresentation().IsDouble();
|
| + }
|
|
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LUnaryMathOperation: public LUnaryOperation {
|
| +class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> {
|
| public:
|
| - explicit LUnaryMathOperation(LOperand* value)
|
| - : LUnaryOperation(value) { }
|
| + LUnaryMathOperation(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| 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(); }
|
| };
|
|
|
|
|
| -class LCmpJSObjectEq: public LBinaryOperation {
|
| +class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LCmpJSObjectEq(LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right) {}
|
| + LCmpJSObjectEq(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
|
| };
|
|
|
|
|
| -class LCmpJSObjectEqAndBranch: public LCmpJSObjectEq {
|
| +class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> {
|
| public:
|
| - LCmpJSObjectEqAndBranch(LOperand* left,
|
| - LOperand* right,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LCmpJSObjectEq(left, right),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch,
|
| "cmp-jsobject-eq-and-branch")
|
| -
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| -
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| };
|
|
|
|
|
| -class LIsNull: public LUnaryOperation {
|
| +class LIsNull: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - LIsNull(LOperand* value, bool is_strict)
|
| - : LUnaryOperation(value), is_strict_(is_strict) {}
|
| + explicit LIsNull(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
|
| + DECLARE_HYDROGEN_ACCESSOR(IsNull)
|
|
|
| - bool is_strict() const { return is_strict_; }
|
| -
|
| - private:
|
| - bool is_strict_;
|
| + bool is_strict() const { return hydrogen()->is_strict(); }
|
| };
|
|
|
| -
|
| -class LIsNullAndBranch: public LIsNull {
|
| +class LIsNullAndBranch: public LControlInstruction<1, 0> {
|
| public:
|
| - LIsNullAndBranch(LOperand* value,
|
| - bool is_strict,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LIsNull(value, is_strict),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + explicit LIsNullAndBranch(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
| + DECLARE_HYDROGEN_ACCESSOR(IsNull)
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| + bool is_strict() const { return hydrogen()->is_strict(); }
|
|
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LIsObject: public LUnaryOperation {
|
| +class LIsObject: public LTemplateInstruction<1, 1, 1> {
|
| public:
|
| - LIsObject(LOperand* value, LOperand* temp)
|
| - : LUnaryOperation(value), temp_(temp) {}
|
| + explicit LIsObject(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object")
|
| -
|
| - LOperand* temp() const { return temp_; }
|
| -
|
| - private:
|
| - LOperand* temp_;
|
| };
|
|
|
|
|
| -class LIsObjectAndBranch: public LIsObject {
|
| +class LIsObjectAndBranch: public LControlInstruction<1, 2> {
|
| public:
|
| - LIsObjectAndBranch(LOperand* value,
|
| - LOperand* temp,
|
| - LOperand* temp2,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LIsObject(value, temp),
|
| - temp2_(temp2),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + LIsObjectAndBranch(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| -
|
| - LOperand* temp2() const { return temp2_; }
|
| -
|
| - private:
|
| - LOperand* temp2_;
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LIsSmi: public LUnaryOperation {
|
| +class LIsSmi: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LIsSmi(LOperand* value) : LUnaryOperation(value) {}
|
| + explicit LIsSmi(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi")
|
| DECLARE_HYDROGEN_ACCESSOR(IsSmi)
|
| };
|
|
|
|
|
| -class LIsSmiAndBranch: public LIsSmi {
|
| +class LIsSmiAndBranch: public LControlInstruction<1, 0> {
|
| public:
|
| - LIsSmiAndBranch(LOperand* value,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LIsSmi(value),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + explicit LIsSmiAndBranch(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| -
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LHasInstanceType: public LUnaryOperation {
|
| +class LHasInstanceType: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LHasInstanceType(LOperand* value)
|
| - : LUnaryOperation(value) { }
|
| + explicit LHasInstanceType(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type")
|
| DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
|
| -
|
| - InstanceType TestType(); // The type to test against when generating code.
|
| - Condition BranchCondition(); // The branch condition for 'true'.
|
| };
|
|
|
|
|
| -class LHasInstanceTypeAndBranch: public LHasInstanceType {
|
| +class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
|
| public:
|
| - LHasInstanceTypeAndBranch(LOperand* value,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LHasInstanceType(value),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + explicit LHasInstanceTypeAndBranch(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
|
| "has-instance-type-and-branch")
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
| + DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| -
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LHasCachedArrayIndex: public LUnaryOperation {
|
| +class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation(value) {}
|
| + explicit LHasCachedArrayIndex(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
|
| DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
|
| };
|
|
|
|
|
| -class LHasCachedArrayIndexAndBranch: public LHasCachedArrayIndex {
|
| +class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
|
| public:
|
| - LHasCachedArrayIndexAndBranch(LOperand* value,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LHasCachedArrayIndex(value),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
|
| "has-cached-array-index-and-branch")
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
| -
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| -
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LClassOfTest: public LUnaryOperation {
|
| +class LClassOfTest: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - LClassOfTest(LOperand* value, LOperand* temp)
|
| - : LUnaryOperation(value), temporary_(temp) {}
|
| + explicit LClassOfTest(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
|
| DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
|
|
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| -
|
| - LOperand* temporary() { return temporary_; }
|
| -
|
| - private:
|
| - LOperand *temporary_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LClassOfTestAndBranch: public LClassOfTest {
|
| +class LClassOfTestAndBranch: public LControlInstruction<1, 1> {
|
| public:
|
| - LClassOfTestAndBranch(LOperand* value,
|
| - LOperand* temporary,
|
| - LOperand* temporary2,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LClassOfTest(value, temporary),
|
| - temporary2_(temporary2),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
|
| "class-of-test-and-branch")
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
| + DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| - LOperand* temporary2() { return temporary2_; }
|
| -
|
| - private:
|
| - LOperand* temporary2_;
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LCmpT: public LBinaryOperation {
|
| +class LCmpT: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LCmpT(LOperand* left, LOperand* right) : LBinaryOperation(left, right) {}
|
| + LCmpT(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
|
| DECLARE_HYDROGEN_ACCESSOR(Compare)
|
| @@ -942,73 +793,78 @@
|
| };
|
|
|
|
|
| -class LCmpTAndBranch: public LCmpT {
|
| +class LCmpTAndBranch: public LControlInstruction<2, 0> {
|
| public:
|
| - LCmpTAndBranch(LOperand* left,
|
| - LOperand* right,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LCmpT(left, right),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + LCmpTAndBranch(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch")
|
| + DECLARE_HYDROGEN_ACCESSOR(Compare)
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| -
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + Token::Value op() const { return hydrogen()->token(); }
|
| };
|
|
|
|
|
| -class LInstanceOf: public LBinaryOperation {
|
| +class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LInstanceOf(LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right) { }
|
| + LInstanceOf(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
|
| };
|
|
|
|
|
| -class LInstanceOfAndBranch: public LInstanceOf {
|
| +class LInstanceOfAndBranch: public LControlInstruction<2, 0> {
|
| public:
|
| - LInstanceOfAndBranch(LOperand* left,
|
| - LOperand* right,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LInstanceOf(left, right),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + LInstanceOfAndBranch(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch")
|
| +};
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
|
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| +class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
|
| + public:
|
| + LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
|
| + "instance-of-known-global")
|
| + DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
|
| +
|
| + Handle<JSFunction> function() const { return hydrogen()->function(); }
|
| };
|
|
|
|
|
| -class LBoundsCheck: public LBinaryOperation {
|
| +class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
|
| public:
|
| - LBoundsCheck(LOperand* index, LOperand* length)
|
| - : LBinaryOperation(index, length) { }
|
| + LBoundsCheck(LOperand* index, LOperand* length) {
|
| + inputs_[0] = index;
|
| + inputs_[1] = length;
|
| + }
|
|
|
| - LOperand* index() const { return left(); }
|
| - LOperand* length() const { return right(); }
|
| + LOperand* index() { return inputs_[0]; }
|
| + LOperand* length() { return inputs_[1]; }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
|
| };
|
|
|
|
|
| -class LBitI: public LBinaryOperation {
|
| +class LBitI: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| LBitI(Token::Value op, LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right), op_(op) { }
|
| + : op_(op) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| Token::Value op() const { return op_; }
|
|
|
| @@ -1019,10 +875,13 @@
|
| };
|
|
|
|
|
| -class LShiftI: public LBinaryOperation {
|
| +class LShiftI: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
|
| - : LBinaryOperation(left, right), op_(op), can_deopt_(can_deopt) { }
|
| + : op_(op), can_deopt_(can_deopt) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| Token::Value op() const { return op_; }
|
|
|
| @@ -1036,166 +895,164 @@
|
| };
|
|
|
|
|
| -class LSubI: public LBinaryOperation {
|
| +class LSubI: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LSubI(LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right) { }
|
| + LSubI(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
|
| DECLARE_HYDROGEN_ACCESSOR(Sub)
|
| };
|
|
|
|
|
| -class LConstant: public LInstruction {
|
| - DECLARE_INSTRUCTION(Constant)
|
| -};
|
| -
|
| -
|
| -class LConstantI: public LConstant {
|
| +class LConstantI: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| - explicit LConstantI(int32_t value) : value_(value) { }
|
| - int32_t value() const { return value_; }
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
|
| + DECLARE_HYDROGEN_ACCESSOR(Constant)
|
|
|
| - private:
|
| - int32_t value_;
|
| + int32_t value() const { return hydrogen()->Integer32Value(); }
|
| };
|
|
|
|
|
| -class LConstantD: public LConstant {
|
| +class LConstantD: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| - explicit LConstantD(double value) : value_(value) { }
|
| - double value() const { return value_; }
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
|
| + DECLARE_HYDROGEN_ACCESSOR(Constant)
|
|
|
| - private:
|
| - double value_;
|
| + double value() const { return hydrogen()->DoubleValue(); }
|
| };
|
|
|
|
|
| -class LConstantT: public LConstant {
|
| +class LConstantT: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| - explicit LConstantT(Handle<Object> value) : value_(value) { }
|
| - Handle<Object> value() const { return value_; }
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
|
| + DECLARE_HYDROGEN_ACCESSOR(Constant)
|
|
|
| - private:
|
| - Handle<Object> value_;
|
| + Handle<Object> value() const { return hydrogen()->handle(); }
|
| };
|
|
|
|
|
| -class LBranch: public LUnaryOperation {
|
| +class LBranch: public LControlInstruction<1, 0> {
|
| public:
|
| - LBranch(LOperand* input, int true_block_id, int false_block_id)
|
| - : LUnaryOperation(input),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + explicit LBranch(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
|
| DECLARE_HYDROGEN_ACCESSOR(Value)
|
|
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
| -
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| -
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LCmpMapAndBranch: public LUnaryOperation {
|
| +class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> {
|
| public:
|
| - LCmpMapAndBranch(LOperand* value, LOperand* temp)
|
| - : LUnaryOperation(value), temp_(temp) { }
|
| + LCmpMapAndBranch(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
|
| - DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch)
|
| + DECLARE_HYDROGEN_ACCESSOR(CompareMap)
|
|
|
| virtual bool IsControl() const { return true; }
|
|
|
| - LOperand* temp() const { return temp_; }
|
| Handle<Map> map() const { return hydrogen()->map(); }
|
| int true_block_id() const {
|
| - return hydrogen()->true_destination()->block_id();
|
| + return hydrogen()->FirstSuccessor()->block_id();
|
| }
|
| int false_block_id() const {
|
| - return hydrogen()->false_destination()->block_id();
|
| + return hydrogen()->SecondSuccessor()->block_id();
|
| }
|
| -
|
| - private:
|
| - LOperand* temp_;
|
| };
|
|
|
|
|
| -class LJSArrayLength: public LUnaryOperation {
|
| +class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LJSArrayLength(LOperand* input) : LUnaryOperation(input) { }
|
| + explicit LJSArrayLength(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
|
| DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
|
| };
|
|
|
|
|
| -class LFixedArrayLength: public LUnaryOperation {
|
| +class LPixelArrayLength: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LFixedArrayLength(LOperand* input) : LUnaryOperation(input) { }
|
| + explicit LPixelArrayLength(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| + DECLARE_CONCRETE_INSTRUCTION(PixelArrayLength, "pixel-array-length")
|
| + DECLARE_HYDROGEN_ACCESSOR(PixelArrayLength)
|
| +};
|
| +
|
| +
|
| +class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
|
| + public:
|
| + explicit LFixedArrayLength(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
|
| DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
|
| };
|
|
|
|
|
| -class LValueOf: public LUnaryOperation {
|
| +class LValueOf: public LTemplateInstruction<1, 1, 1> {
|
| public:
|
| - LValueOf(LOperand* input, LOperand* temporary)
|
| - : LUnaryOperation(input), temporary_(temporary) { }
|
| + LValueOf(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| - LOperand* temporary() const { return temporary_; }
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
|
| DECLARE_HYDROGEN_ACCESSOR(ValueOf)
|
| -
|
| - private:
|
| - LOperand* temporary_;
|
| };
|
|
|
|
|
| -class LThrow: public LUnaryOperation {
|
| +class LThrow: public LTemplateInstruction<0, 1, 0> {
|
| public:
|
| - explicit LThrow(LOperand* value) : LUnaryOperation(value) { }
|
| + explicit LThrow(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
|
| };
|
|
|
|
|
| -class LBitNotI: public LUnaryOperation {
|
| +class LBitNotI: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LBitNotI(LOperand* use) : LUnaryOperation(use) { }
|
| + explicit LBitNotI(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
|
| };
|
|
|
|
|
| -class LAddI: public LBinaryOperation {
|
| +class LAddI: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LAddI(LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right) { }
|
| + LAddI(LOperand* left, LOperand* right) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
|
| DECLARE_HYDROGEN_ACCESSOR(Add)
|
| };
|
|
|
|
|
| -class LArithmeticD: public LBinaryOperation {
|
| +class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right), op_(op) { }
|
| + : op_(op) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| Token::Value op() const { return op_; }
|
|
|
| @@ -1207,10 +1064,13 @@
|
| };
|
|
|
|
|
| -class LArithmeticT: public LBinaryOperation {
|
| +class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
|
| - : LBinaryOperation(left, right), op_(op) { }
|
| + : op_(op) {
|
| + inputs_[0] = left;
|
| + inputs_[1] = right;
|
| + }
|
|
|
| virtual void CompileToNative(LCodeGen* generator);
|
| virtual const char* Mnemonic() const;
|
| @@ -1222,159 +1082,267 @@
|
| };
|
|
|
|
|
| -class LReturn: public LUnaryOperation {
|
| +class LReturn: public LTemplateInstruction<0, 1, 0> {
|
| public:
|
| - explicit LReturn(LOperand* use) : LUnaryOperation(use) { }
|
| + explicit LReturn(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Return, "return")
|
| };
|
|
|
|
|
| -class LLoadNamedField: public LUnaryOperation {
|
| +class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LLoadNamedField(LOperand* object) : LUnaryOperation(object) { }
|
| + explicit LLoadNamedField(LOperand* object) {
|
| + inputs_[0] = object;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
|
| DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
|
| };
|
|
|
|
|
| -class LLoadNamedGeneric: public LUnaryOperation {
|
| +class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation(object) { }
|
| + explicit LLoadNamedGeneric(LOperand* object) {
|
| + inputs_[0] = object;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
|
| DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
|
|
|
| - LOperand* object() const { return input(); }
|
| + LOperand* object() { return inputs_[0]; }
|
| Handle<Object> name() const { return hydrogen()->name(); }
|
| };
|
|
|
|
|
| -class LLoadFunctionPrototype: public LUnaryOperation {
|
| +class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LLoadFunctionPrototype(LOperand* function)
|
| - : LUnaryOperation(function) { }
|
| + explicit LLoadFunctionPrototype(LOperand* function) {
|
| + inputs_[0] = function;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
|
| DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
|
|
|
| - LOperand* function() const { return input(); }
|
| + LOperand* function() { return inputs_[0]; }
|
| };
|
|
|
|
|
| -class LLoadElements: public LUnaryOperation {
|
| +class LLoadElements: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { }
|
| + explicit LLoadElements(LOperand* object) {
|
| + inputs_[0] = object;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
|
| };
|
|
|
|
|
| -class LLoadKeyedFastElement: public LBinaryOperation {
|
| +class LLoadPixelArrayExternalPointer: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - LLoadKeyedFastElement(LOperand* elements,
|
| - LOperand* key,
|
| - LOperand* load_result)
|
| - : LBinaryOperation(elements, key),
|
| - load_result_(load_result) { }
|
| + explicit LLoadPixelArrayExternalPointer(LOperand* object) {
|
| + inputs_[0] = object;
|
| + }
|
|
|
| + DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayExternalPointer,
|
| + "load-pixel-array-external-pointer")
|
| +};
|
| +
|
| +
|
| +class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
|
| + public:
|
| + LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
|
| + inputs_[0] = elements;
|
| + inputs_[1] = key;
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
|
| DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
|
|
|
| - LOperand* elements() const { return left(); }
|
| - LOperand* key() const { return right(); }
|
| - LOperand* load_result() const { return load_result_; }
|
| + LOperand* elements() { return inputs_[0]; }
|
| + LOperand* key() { return inputs_[1]; }
|
| +};
|
|
|
| - private:
|
| - LOperand* load_result_;
|
| +
|
| +class LLoadPixelArrayElement: public LTemplateInstruction<1, 2, 0> {
|
| + public:
|
| + LLoadPixelArrayElement(LOperand* external_pointer, LOperand* key) {
|
| + inputs_[0] = external_pointer;
|
| + inputs_[1] = key;
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayElement,
|
| + "load-pixel-array-element")
|
| + DECLARE_HYDROGEN_ACCESSOR(LoadPixelArrayElement)
|
| +
|
| + LOperand* external_pointer() { return inputs_[0]; }
|
| + LOperand* key() { return inputs_[1]; }
|
| };
|
|
|
|
|
| -class LLoadKeyedGeneric: public LBinaryOperation {
|
| +class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - LLoadKeyedGeneric(LOperand* obj, LOperand* key)
|
| - : LBinaryOperation(obj, key) { }
|
| + LLoadKeyedGeneric(LOperand* obj, LOperand* key) {
|
| + inputs_[0] = obj;
|
| + inputs_[1] = key;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
|
|
|
| - LOperand* object() const { return left(); }
|
| - LOperand* key() const { return right(); }
|
| + LOperand* object() { return inputs_[0]; }
|
| + LOperand* key() { return inputs_[1]; }
|
| };
|
|
|
|
|
| -class LLoadGlobal: public LInstruction {
|
| +class LLoadGlobal: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global")
|
| DECLARE_HYDROGEN_ACCESSOR(LoadGlobal)
|
| };
|
|
|
|
|
| -class LStoreGlobal: public LUnaryOperation {
|
| +class LStoreGlobal: public LTemplateInstruction<0, 1, 1> {
|
| public:
|
| - explicit LStoreGlobal(LOperand* value) : LUnaryOperation(value) {}
|
| + LStoreGlobal(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global")
|
| DECLARE_HYDROGEN_ACCESSOR(StoreGlobal)
|
| };
|
|
|
|
|
| -class LPushArgument: public LUnaryOperation {
|
| +class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LPushArgument(LOperand* argument) : LUnaryOperation(argument) {}
|
| + explicit LLoadContextSlot(LOperand* context) {
|
| + inputs_[0] = context;
|
| + }
|
|
|
| + DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
|
| + DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
|
| +
|
| + LOperand* context() { return InputAt(0); }
|
| + int slot_index() { return hydrogen()->slot_index(); }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +};
|
| +
|
| +
|
| +class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> {
|
| + public:
|
| + LStoreContextSlot(LOperand* context, LOperand* value) {
|
| + inputs_[0] = context;
|
| + inputs_[1] = value;
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
|
| + DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
|
| +
|
| + LOperand* context() { return InputAt(0); }
|
| + LOperand* value() { return InputAt(1); }
|
| + int slot_index() { return hydrogen()->slot_index(); }
|
| + int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +};
|
| +
|
| +
|
| +class LPushArgument: public LTemplateInstruction<0, 1, 0> {
|
| + public:
|
| + explicit LPushArgument(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
|
| };
|
|
|
|
|
| -class LGlobalObject: public LInstruction {
|
| +class LContext: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| + DECLARE_CONCRETE_INSTRUCTION(Context, "context")
|
| +};
|
| +
|
| +
|
| +class LOuterContext: public LTemplateInstruction<1, 1, 0> {
|
| + public:
|
| + explicit LOuterContext(LOperand* context) {
|
| + inputs_[0] = context;
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
|
| +
|
| + LOperand* context() { return InputAt(0); }
|
| +};
|
| +
|
| +
|
| +class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
|
| + public:
|
| + explicit LGlobalObject(LOperand* context) {
|
| + inputs_[0] = context;
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
|
| +
|
| + LOperand* context() { return InputAt(0); }
|
| };
|
|
|
|
|
| -class LGlobalReceiver: public LInstruction {
|
| +class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| + explicit LGlobalReceiver(LOperand* global_object) {
|
| + inputs_[0] = global_object;
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
|
| +
|
| + LOperand* global() { return InputAt(0); }
|
| };
|
|
|
|
|
| -class LCallConstantFunction: public LInstruction {
|
| +class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
|
| 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(); }
|
| + Handle<JSFunction> function() { return hydrogen()->function(); }
|
| int arity() const { return hydrogen()->argument_count() - 1; }
|
| };
|
|
|
|
|
| -class LCallKeyed: public LInstruction {
|
| +class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| + explicit LCallKeyed(LOperand* key) {
|
| + inputs_[0] = key;
|
| + }
|
| +
|
| 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, 0, 0> {
|
| 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, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
|
| DECLARE_HYDROGEN_ACCESSOR(CallFunction)
|
| @@ -1383,44 +1351,46 @@
|
| };
|
|
|
|
|
| -class LCallGlobal: public LInstruction {
|
| +class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
|
| 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, 0, 0> {
|
| 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 LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LCallNew(LOperand* constructor) : LUnaryOperation(constructor) { }
|
| + explicit LCallNew(LOperand* constructor) {
|
| + inputs_[0] = 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, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
|
| DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
|
| @@ -1430,42 +1400,45 @@
|
| };
|
|
|
|
|
| -class LInteger32ToDouble: public LUnaryOperation {
|
| +class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LInteger32ToDouble(LOperand* use) : LUnaryOperation(use) { }
|
| + explicit LInteger32ToDouble(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
|
| };
|
|
|
|
|
| -class LNumberTagI: public LUnaryOperation {
|
| +class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LNumberTagI(LOperand* use) : LUnaryOperation(use) { }
|
| + explicit LNumberTagI(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
|
| };
|
|
|
|
|
| -class LNumberTagD: public LUnaryOperation {
|
| +class LNumberTagD: public LTemplateInstruction<1, 1, 2> {
|
| public:
|
| - LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2)
|
| - : LUnaryOperation(value), temp1_(temp1), temp2_(temp2) { }
|
| + LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp1;
|
| + temps_[1] = temp2;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
|
| -
|
| - LOperand* temp1() const { return temp1_; }
|
| - LOperand* temp2() const { return temp2_; }
|
| -
|
| - private:
|
| - LOperand* temp1_;
|
| - LOperand* temp2_;
|
| };
|
|
|
|
|
| // Sometimes truncating conversion from a tagged value to an int32.
|
| -class LDoubleToI: public LUnaryOperation {
|
| +class LDoubleToI: public LTemplateInstruction<1, 1, 1> {
|
| public:
|
| - explicit LDoubleToI(LOperand* value) : LUnaryOperation(value) { }
|
| + explicit LDoubleToI(LOperand* value, LOperand* temp1) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp1;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
|
| DECLARE_HYDROGEN_ACCESSOR(Change)
|
| @@ -1475,42 +1448,46 @@
|
|
|
|
|
| // Truncating conversion from a tagged value to an int32.
|
| -class LTaggedToI: public LUnaryOperation {
|
| +class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
|
| public:
|
| - LTaggedToI(LOperand* value, LOperand* temp)
|
| - : LUnaryOperation(value), temp_(temp) { }
|
| + LTaggedToI(LOperand* value, LOperand* temp) {
|
| + inputs_[0] = value;
|
| + temps_[0] = temp;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
|
| DECLARE_HYDROGEN_ACCESSOR(Change)
|
|
|
| bool truncating() { return hydrogen()->CanTruncateToInt32(); }
|
| - LOperand* temp() const { return temp_; }
|
| -
|
| - private:
|
| - LOperand* temp_;
|
| };
|
|
|
|
|
| -class LSmiTag: public LUnaryOperation {
|
| +class LSmiTag: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LSmiTag(LOperand* use) : LUnaryOperation(use) { }
|
| + explicit LSmiTag(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
|
| };
|
|
|
|
|
| -class LNumberUntagD: public LUnaryOperation {
|
| +class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LNumberUntagD(LOperand* value) : LUnaryOperation(value) { }
|
| + explicit LNumberUntagD(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
|
| };
|
|
|
|
|
| -class LSmiUntag: public LUnaryOperation {
|
| +class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - LSmiUntag(LOperand* use, bool needs_check)
|
| - : LUnaryOperation(use), needs_check_(needs_check) { }
|
| + LSmiUntag(LOperand* value, bool needs_check)
|
| + : needs_check_(needs_check) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
|
|
|
| @@ -1521,89 +1498,64 @@
|
| };
|
|
|
|
|
| -class LStoreNamed: public LInstruction {
|
| +class LStoreNamed: public LTemplateInstruction<0, 2, 0> {
|
| public:
|
| - LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val)
|
| - : object_(obj), name_(name), value_(val) { }
|
| + LStoreNamed(LOperand* obj, LOperand* val) {
|
| + inputs_[0] = obj;
|
| + inputs_[1] = val;
|
| + }
|
|
|
| DECLARE_INSTRUCTION(StoreNamed)
|
| + DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
|
|
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| + virtual void PrintDataTo(StringStream* stream);
|
|
|
| - LOperand* object() const { return object_; }
|
| - Handle<Object> name() const { return name_; }
|
| - LOperand* value() const { return value_; }
|
| -
|
| - private:
|
| - LOperand* object_;
|
| - Handle<Object> name_;
|
| - LOperand* value_;
|
| + LOperand* object() { return inputs_[0]; }
|
| + LOperand* value() { return inputs_[1]; }
|
| + Handle<Object> name() const { return hydrogen()->name(); }
|
| };
|
|
|
|
|
| class LStoreNamedField: public LStoreNamed {
|
| public:
|
| - LStoreNamedField(LOperand* obj,
|
| - Handle<Object> name,
|
| - LOperand* val,
|
| - bool in_object,
|
| - int offset,
|
| - LOperand* temp,
|
| - bool needs_write_barrier,
|
| - Handle<Map> transition)
|
| - : LStoreNamed(obj, name, val),
|
| - is_in_object_(in_object),
|
| - offset_(offset),
|
| - temp_(temp),
|
| - needs_write_barrier_(needs_write_barrier),
|
| - transition_(transition) { }
|
| + LStoreNamedField(LOperand* obj, LOperand* val)
|
| + : LStoreNamed(obj, val) { }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
|
| + DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
|
|
|
| - bool is_in_object() { return is_in_object_; }
|
| - int offset() { return offset_; }
|
| - LOperand* temp() { return temp_; }
|
| - bool needs_write_barrier() { return needs_write_barrier_; }
|
| - Handle<Map> transition() const { return transition_; }
|
| - void set_transition(Handle<Map> map) { transition_ = map; }
|
| -
|
| - private:
|
| - bool is_in_object_;
|
| - int offset_;
|
| - LOperand* temp_;
|
| - bool needs_write_barrier_;
|
| - Handle<Map> transition_;
|
| + bool is_in_object() { return hydrogen()->is_in_object(); }
|
| + int offset() { return hydrogen()->offset(); }
|
| + bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
|
| + Handle<Map> transition() const { return hydrogen()->transition(); }
|
| };
|
|
|
|
|
| class LStoreNamedGeneric: public LStoreNamed {
|
| public:
|
| - LStoreNamedGeneric(LOperand* obj,
|
| - Handle<Object> name,
|
| - LOperand* val)
|
| - : LStoreNamed(obj, name, val) { }
|
| + LStoreNamedGeneric(LOperand* obj, LOperand* val)
|
| + : LStoreNamed(obj, val) { }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
|
| + DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
|
| };
|
|
|
|
|
| -class LStoreKeyed: public LInstruction {
|
| +class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
|
| public:
|
| - LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val)
|
| - : object_(obj), key_(key), value_(val) { }
|
| + LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
|
| + inputs_[0] = obj;
|
| + inputs_[1] = key;
|
| + inputs_[2] = 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_; }
|
| - LOperand* value() const { return value_; }
|
| -
|
| - private:
|
| - LOperand* object_;
|
| - LOperand* key_;
|
| - LOperand* value_;
|
| + LOperand* object() { return inputs_[0]; }
|
| + LOperand* key() { return inputs_[1]; }
|
| + LOperand* value() { return inputs_[2]; }
|
| };
|
|
|
|
|
| @@ -1627,69 +1579,88 @@
|
| };
|
|
|
|
|
| -class LCheckFunction: public LUnaryOperation {
|
| +class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| - explicit LCheckFunction(LOperand* use) : LUnaryOperation(use) { }
|
| + LStringCharCodeAt(LOperand* string, LOperand* index) {
|
| + inputs_[0] = string;
|
| + inputs_[1] = index;
|
| + }
|
|
|
| + DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
|
| + DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
|
| +
|
| + LOperand* string() { return inputs_[0]; }
|
| + LOperand* index() { return inputs_[1]; }
|
| +};
|
| +
|
| +
|
| +class LStringLength: public LTemplateInstruction<1, 1, 0> {
|
| + public:
|
| + explicit LStringLength(LOperand* string) {
|
| + inputs_[0] = string;
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
|
| + DECLARE_HYDROGEN_ACCESSOR(StringLength)
|
| +
|
| + LOperand* string() { return inputs_[0]; }
|
| +};
|
| +
|
| +
|
| +class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
|
| + public:
|
| + explicit LCheckFunction(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
|
| DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
|
| };
|
|
|
|
|
| -class LCheckInstanceType: public LUnaryOperation {
|
| +class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
|
| public:
|
| - LCheckInstanceType(LOperand* use, LOperand* temp)
|
| - : LUnaryOperation(use), temp_(temp) { }
|
| + explicit LCheckInstanceType(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
|
| DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
|
| -
|
| - LOperand* temp() const { return temp_; }
|
| -
|
| - private:
|
| - LOperand* temp_;
|
| };
|
|
|
|
|
| -class LCheckMap: public LUnaryOperation {
|
| +class LCheckMap: public LTemplateInstruction<0, 1, 0> {
|
| public:
|
| - explicit LCheckMap(LOperand* use) : LUnaryOperation(use) { }
|
| + explicit LCheckMap(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
|
| DECLARE_HYDROGEN_ACCESSOR(CheckMap)
|
| };
|
|
|
|
|
| -class LCheckPrototypeMaps: public LInstruction {
|
| +class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> {
|
| public:
|
| - LCheckPrototypeMaps(LOperand* temp1,
|
| - LOperand* temp2,
|
| - Handle<JSObject> holder,
|
| - Handle<Map> receiver_map)
|
| - : temp1_(temp1),
|
| - temp2_(temp2),
|
| - holder_(holder),
|
| - receiver_map_(receiver_map) { }
|
| + LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2) {
|
| + temps_[0] = temp1;
|
| + temps_[1] = temp2;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
|
| + DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
|
|
|
| - LOperand* temp1() const { return temp1_; }
|
| - LOperand* temp2() const { return temp2_; }
|
| - Handle<JSObject> holder() const { return holder_; }
|
| - Handle<Map> receiver_map() const { return receiver_map_; }
|
| -
|
| - private:
|
| - LOperand* temp1_;
|
| - LOperand* temp2_;
|
| - Handle<JSObject> holder_;
|
| - Handle<Map> receiver_map_;
|
| + Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
|
| + Handle<JSObject> holder() const { return hydrogen()->holder(); }
|
| };
|
|
|
|
|
| -class LCheckSmi: public LUnaryOperation {
|
| +class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
|
| public:
|
| - LCheckSmi(LOperand* use, Condition condition)
|
| - : LUnaryOperation(use), condition_(condition) { }
|
| + LCheckSmi(LOperand* value, Condition condition)
|
| + : condition_(condition) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| Condition condition() const { return condition_; }
|
|
|
| @@ -1703,34 +1674,28 @@
|
| };
|
|
|
|
|
| -class LMaterializedLiteral: public LInstruction {
|
| +class LArrayLiteral: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| - DECLARE_INSTRUCTION(MaterializedLiteral)
|
| -};
|
| -
|
| -
|
| -class LArrayLiteral: public LMaterializedLiteral {
|
| - public:
|
| DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
|
| DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
|
| };
|
|
|
|
|
| -class LObjectLiteral: public LMaterializedLiteral {
|
| +class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
|
| DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
|
| };
|
|
|
|
|
| -class LRegExpLiteral: public LMaterializedLiteral {
|
| +class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
|
| DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
|
| };
|
|
|
|
|
| -class LFunctionLiteral: public LInstruction {
|
| +class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
|
| DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
|
| @@ -1739,61 +1704,79 @@
|
| };
|
|
|
|
|
| -class LTypeof: public LUnaryOperation {
|
| +class LTypeof: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LTypeof(LOperand* input) : LUnaryOperation(input) { }
|
| + explicit LTypeof(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
|
| };
|
|
|
|
|
| -class LTypeofIs: public LUnaryOperation {
|
| +class LTypeofIs: public LTemplateInstruction<1, 1, 0> {
|
| public:
|
| - explicit LTypeofIs(LOperand* input) : LUnaryOperation(input) { }
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| + explicit LTypeofIs(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is")
|
| DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
|
|
|
| Handle<String> type_literal() { return hydrogen()->type_literal(); }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream);
|
| };
|
|
|
|
|
| -class LTypeofIsAndBranch: public LTypeofIs {
|
| +class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
|
| public:
|
| - LTypeofIsAndBranch(LOperand* value,
|
| - int true_block_id,
|
| - int false_block_id)
|
| - : LTypeofIs(value),
|
| - true_block_id_(true_block_id),
|
| - false_block_id_(false_block_id) { }
|
| + explicit LTypeofIsAndBranch(LOperand* value) {
|
| + inputs_[0] = value;
|
| + }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
|
| + DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
|
|
|
| - virtual void PrintDataTo(StringStream* stream) const;
|
| - virtual bool IsControl() const { return true; }
|
| + Handle<String> type_literal() { return hydrogen()->type_literal(); }
|
|
|
| - int true_block_id() const { return true_block_id_; }
|
| - int false_block_id() const { return false_block_id_; }
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +};
|
|
|
| - private:
|
| - int true_block_id_;
|
| - int false_block_id_;
|
| +
|
| +class LIsConstructCall: public LTemplateInstruction<1, 0, 0> {
|
| + public:
|
| + DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is-construct-call")
|
| + DECLARE_HYDROGEN_ACCESSOR(IsConstructCall)
|
| };
|
|
|
|
|
| -class LDeleteProperty: public LBinaryOperation {
|
| +class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
|
| public:
|
| - LDeleteProperty(LOperand* obj, LOperand* key) : LBinaryOperation(obj, key) {}
|
| + explicit LIsConstructCallAndBranch(LOperand* temp) {
|
| + temps_[0] = temp;
|
| + }
|
|
|
| + DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
|
| + "is-construct-call-and-branch")
|
| +};
|
| +
|
| +
|
| +class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
|
| + public:
|
| + LDeleteProperty(LOperand* obj, LOperand* key) {
|
| + inputs_[0] = obj;
|
| + inputs_[1] = key;
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
|
|
|
| - LOperand* object() const { return left(); }
|
| - LOperand* key() const { return right(); }
|
| + LOperand* object() { return inputs_[0]; }
|
| + LOperand* key() { return inputs_[1]; }
|
| };
|
|
|
|
|
| -class LOsrEntry: public LInstruction {
|
| +class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
|
| public:
|
| LOsrEntry();
|
|
|
| @@ -1816,120 +1799,18 @@
|
| };
|
|
|
|
|
| -class LStackCheck: public LInstruction {
|
| +class LStackCheck: public LTemplateInstruction<0, 0, 0> {
|
| public:
|
| DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
|
| };
|
|
|
|
|
| -class LPointerMap: public ZoneObject {
|
| - public:
|
| - explicit LPointerMap(int position)
|
| - : pointer_operands_(8), position_(position), lithium_position_(-1) { }
|
| -
|
| - const ZoneList<LOperand*>* operands() const { return &pointer_operands_; }
|
| - int position() const { return position_; }
|
| - int lithium_position() const { return lithium_position_; }
|
| -
|
| - void set_lithium_position(int pos) {
|
| - ASSERT(lithium_position_ == -1);
|
| - lithium_position_ = pos;
|
| - }
|
| -
|
| - void RecordPointer(LOperand* op);
|
| - void PrintTo(StringStream* stream) const;
|
| -
|
| - private:
|
| - ZoneList<LOperand*> pointer_operands_;
|
| - int position_;
|
| - int lithium_position_;
|
| -};
|
| -
|
| -
|
| -class LEnvironment: public ZoneObject {
|
| - public:
|
| - LEnvironment(Handle<JSFunction> closure,
|
| - int ast_id,
|
| - int parameter_count,
|
| - int argument_count,
|
| - int value_count,
|
| - LEnvironment* outer)
|
| - : closure_(closure),
|
| - arguments_stack_height_(argument_count),
|
| - deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
|
| - translation_index_(-1),
|
| - ast_id_(ast_id),
|
| - parameter_count_(parameter_count),
|
| - values_(value_count),
|
| - representations_(value_count),
|
| - spilled_registers_(NULL),
|
| - spilled_double_registers_(NULL),
|
| - outer_(outer) {
|
| - }
|
| -
|
| - Handle<JSFunction> closure() const { return closure_; }
|
| - int arguments_stack_height() const { return arguments_stack_height_; }
|
| - int deoptimization_index() const { return deoptimization_index_; }
|
| - int translation_index() const { return translation_index_; }
|
| - int ast_id() const { return ast_id_; }
|
| - int parameter_count() const { return parameter_count_; }
|
| - const ZoneList<LOperand*>* values() const { return &values_; }
|
| - LEnvironment* outer() const { return outer_; }
|
| -
|
| - void AddValue(LOperand* operand, Representation representation) {
|
| - values_.Add(operand);
|
| - representations_.Add(representation);
|
| - }
|
| -
|
| - bool HasTaggedValueAt(int index) const {
|
| - return representations_[index].IsTagged();
|
| - }
|
| -
|
| - void Register(int deoptimization_index, int translation_index) {
|
| - ASSERT(!HasBeenRegistered());
|
| - deoptimization_index_ = deoptimization_index;
|
| - translation_index_ = translation_index;
|
| - }
|
| - bool HasBeenRegistered() const {
|
| - return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
|
| - }
|
| -
|
| - void SetSpilledRegisters(LOperand** registers,
|
| - LOperand** double_registers) {
|
| - spilled_registers_ = registers;
|
| - spilled_double_registers_ = double_registers;
|
| - }
|
| -
|
| - // Emit frame translation commands for this environment.
|
| - void WriteTranslation(LCodeGen* cgen, Translation* translation) const;
|
| -
|
| - void PrintTo(StringStream* stream) const;
|
| -
|
| - private:
|
| - Handle<JSFunction> closure_;
|
| - int arguments_stack_height_;
|
| - int deoptimization_index_;
|
| - int translation_index_;
|
| - int ast_id_;
|
| - int parameter_count_;
|
| - ZoneList<LOperand*> values_;
|
| - ZoneList<Representation> representations_;
|
| -
|
| - // Allocation index indexed arrays of spill slot operands for registers
|
| - // that are also in spill slots at an OSR entry. NULL for environments
|
| - // that do not correspond to an OSR entry.
|
| - LOperand** spilled_registers_;
|
| - LOperand** spilled_double_registers_;
|
| -
|
| - LEnvironment* outer_;
|
| -};
|
| -
|
| class LChunkBuilder;
|
| class LChunk: public ZoneObject {
|
| public:
|
| explicit LChunk(HGraph* graph);
|
|
|
| - int AddInstruction(LInstruction* instruction, HBasicBlock* block);
|
| + void AddInstruction(LInstruction* instruction, HBasicBlock* block);
|
| LConstantOperand* DefineConstantOperand(HConstant* constant);
|
| Handle<Object> LookupLiteral(LConstantOperand* operand) const;
|
| Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
|
| @@ -1974,8 +1855,6 @@
|
| inlined_closures_.Add(closure);
|
| }
|
|
|
| - void Verify() const;
|
| -
|
| private:
|
| int spill_slot_count_;
|
| HGraph* const graph_;
|
| @@ -1997,7 +1876,7 @@
|
| argument_count_(0),
|
| allocator_(allocator),
|
| position_(RelocInfo::kNoPosition),
|
| - instructions_pending_deoptimization_environment_(NULL),
|
| + instruction_pending_deoptimization_environment_(NULL),
|
| pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
|
|
|
| // Build the sequence for the graph.
|
| @@ -2032,9 +1911,10 @@
|
| LUnallocated* ToUnallocated(DoubleRegister reg);
|
|
|
| // Methods for setting up define-use relationships.
|
| - LOperand* Use(HValue* value, LUnallocated* operand);
|
| - LOperand* UseFixed(HValue* value, Register fixed_register);
|
| - LOperand* UseFixedDouble(HValue* value, DoubleRegister fixed_register);
|
| + MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
|
| + MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
|
| + MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
|
| + DoubleRegister fixed_register);
|
|
|
| // A value that is guaranteed to be allocated to a register.
|
| // Operand created by UseRegister is guaranteed to be live until the end of
|
| @@ -2044,27 +1924,53 @@
|
| // instruction start. Register allocator is free to assign the same register
|
| // to some other operand used inside instruction (i.e. temporary or
|
| // output).
|
| - LOperand* UseRegister(HValue* value);
|
| - LOperand* UseRegisterAtStart(HValue* value);
|
| + MUST_USE_RESULT LOperand* UseRegister(HValue* value);
|
| + MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
|
|
|
| - // A value in a register that may be trashed.
|
| - LOperand* UseTempRegister(HValue* value);
|
| - LOperand* Use(HValue* value);
|
| - LOperand* UseAtStart(HValue* value);
|
| - LOperand* UseOrConstant(HValue* value);
|
| - LOperand* UseOrConstantAtStart(HValue* value);
|
| - LOperand* UseRegisterOrConstant(HValue* value);
|
| - LOperand* UseRegisterOrConstantAtStart(HValue* value);
|
| + // An input operand in a register that may be trashed.
|
| + MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
|
|
|
| + // An input operand in a register or stack slot.
|
| + MUST_USE_RESULT LOperand* Use(HValue* value);
|
| + MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
|
| +
|
| + // An input operand in a register, stack slot or a constant operand.
|
| + MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
|
| + MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
|
| +
|
| + // An input operand in a register or a constant operand.
|
| + MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
|
| + MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
|
| +
|
| + // An input operand in register, stack slot or a constant operand.
|
| + // Will not be moved to a register even if one is freely available.
|
| + MUST_USE_RESULT LOperand* UseAny(HValue* value);
|
| +
|
| + // Temporary operand that must be in a register.
|
| + MUST_USE_RESULT LUnallocated* TempRegister();
|
| + MUST_USE_RESULT LOperand* FixedTemp(Register reg);
|
| + MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
|
| +
|
| // 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, DoubleRegister reg);
|
| + template<int I, int T>
|
| + LInstruction* Define(LTemplateInstruction<1, I, T>* instr,
|
| + LUnallocated* result);
|
| + template<int I, int T>
|
| + LInstruction* Define(LTemplateInstruction<1, I, T>* instr);
|
| + template<int I, int T>
|
| + LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
|
| + template<int I, int T>
|
| + LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
|
| + int index);
|
| + template<int I, int T>
|
| + LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
|
| + template<int I, int T>
|
| + LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
|
| + Register reg);
|
| + template<int I, int T>
|
| + LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
|
| + DoubleRegister reg);
|
| LInstruction* AssignEnvironment(LInstruction* instr);
|
| LInstruction* AssignPointerMap(LInstruction* instr);
|
|
|
| @@ -2077,6 +1983,7 @@
|
| LInstruction* instr,
|
| HInstruction* hinstr,
|
| CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
|
| + LInstruction* MarkAsSaveDoubles(LInstruction* instr);
|
|
|
| LInstruction* SetInstructionPendingDeoptimizationEnvironment(
|
| LInstruction* instr, int ast_id);
|
| @@ -2084,13 +1991,6 @@
|
|
|
| LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
|
|
|
| - // Temporary operand that may be a memory location.
|
| - LOperand* Temp();
|
| - // Temporary operand that must be in a register.
|
| - LUnallocated* TempRegister();
|
| - LOperand* FixedTemp(Register reg);
|
| - LOperand* FixedTemp(DoubleRegister reg);
|
| -
|
| void VisitInstruction(HInstruction* current);
|
|
|
| void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
|
| @@ -2110,7 +2010,7 @@
|
| int argument_count_;
|
| LAllocator* allocator_;
|
| int position_;
|
| - LInstruction* instructions_pending_deoptimization_environment_;
|
| + LInstruction* instruction_pending_deoptimization_environment_;
|
| int pending_deoptimization_ast_id_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
|
|
|