Index: src/arm/lithium-arm.h |
=================================================================== |
--- src/arm/lithium-arm.h (revision 6471) |
+++ src/arm/lithium-arm.h (working copy) |
@@ -290,7 +290,10 @@ |
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; |
@@ -307,23 +310,41 @@ |
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(); } |
- virtual bool HasResult() const = 0; |
- |
void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
HValue* hydrogen_value() const { return hydrogen_value_; } |
+ 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; } |
+ |
private: |
- SetOncePointer<LEnvironment> environment_; |
+ LEnvironment* environment_; |
SetOncePointer<LPointerMap> pointer_map_; |
HValue* hydrogen_value_; |
+ bool is_call_; |
+ bool is_save_doubles_; |
}; |
@@ -350,6 +371,11 @@ |
public: |
int length() { return 0; } |
void PrintOperandsTo(StringStream* stream) { } |
+ ElementType& operator[](int i) { |
+ UNREACHABLE(); |
+ static ElementType t = 0; |
+ return t; |
+ } |
}; |
@@ -1777,7 +1803,7 @@ |
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; |