| Index: src/ia32/lithium-codegen-ia32.h
|
| diff --git a/src/ia32/lithium-codegen-ia32.h b/src/ia32/lithium-codegen-ia32.h
|
| index 5a474b67f64723339607be28393f25ca7e768464..470998ab1482ce2565e469e1e4415cce900b57b4 100644
|
| --- a/src/ia32/lithium-codegen-ia32.h
|
| +++ b/src/ia32/lithium-codegen-ia32.h
|
| @@ -52,7 +52,7 @@ class LCodeGen V8_FINAL BASE_EMBEDDED {
|
| chunk_(static_cast<LPlatformChunk*>(chunk)),
|
| masm_(assembler),
|
| info_(info),
|
| - current_block_(-1),
|
| + current_block_(NULL),
|
| current_instruction_(-1),
|
| instructions_(chunk->instructions()),
|
| deoptimizations_(4, info->zone()),
|
| @@ -120,6 +120,7 @@ class LCodeGen V8_FINAL BASE_EMBEDDED {
|
| // virtual registers between instructions.
|
| enum X87OperandType { kX87DoubleOperand, kX87FloatOperand, kX87IntOperand };
|
|
|
| + void X87Mov(X87Register reg, X87Register src);
|
| void X87Mov(X87Register reg, Operand src,
|
| X87OperandType operand = kX87DoubleOperand);
|
| void X87Mov(Operand src, X87Register reg,
|
| @@ -414,6 +415,11 @@ class LCodeGen V8_FINAL BASE_EMBEDDED {
|
| void FlushX87StackIfNecessary(LInstruction* instr) {
|
| x87_stack_.FlushIfNecessary(instr, this);
|
| }
|
| + void RestoreX87StackIfNecessary(LInstruction* instr) {
|
| + x87_stack_.RestoreIfNecessary(instr, this);
|
| + }
|
| + void PreRecordX87StackUsage();
|
| +
|
| friend class LGapResolver;
|
|
|
| #ifdef _MSC_VER
|
| @@ -429,7 +435,7 @@ class LCodeGen V8_FINAL BASE_EMBEDDED {
|
| MacroAssembler* const masm_;
|
| CompilationInfo* const info_;
|
|
|
| - int current_block_;
|
| + HBasicBlock* current_block_;
|
| int current_instruction_;
|
| const ZoneList<LInstruction*>* instructions_;
|
| ZoneList<LEnvironment*> deoptimizations_;
|
| @@ -448,41 +454,41 @@ class LCodeGen V8_FINAL BASE_EMBEDDED {
|
|
|
| class X87Stack {
|
| public:
|
| - explicit X87Stack(MacroAssembler* masm) : stack_depth_(0), masm_(masm) { }
|
| - explicit X87Stack(const X87Stack& other)
|
| - : stack_depth_(0), masm_(other.masm_) {
|
| - stack_depth_ = other.stack_depth_;
|
| - for (int i = 0; i < stack_depth_; i++) {
|
| - stack_[i] = other.stack_[i];
|
| - }
|
| - }
|
| - bool operator==(const X87Stack& other) const {
|
| - if (stack_depth_ != other.stack_depth_) return false;
|
| - for (int i = 0; i < stack_depth_; i++) {
|
| - if (!stack_[i].is(other.stack_[i])) return false;
|
| + explicit X87Stack(MacroAssembler* masm) : stack_depth_(0), masm_(masm) {
|
| + for (int i = 0; i < X87Register::kNumAllocatableRegisters; i++) {
|
| + first_defined_[i] = NULL;
|
| }
|
| - return true;
|
| }
|
| bool Contains(X87Register reg);
|
| void Fxch(X87Register reg, int other_slot = 0);
|
| + void Fxch(X87Register reg, X87Register src);
|
| void Free(X87Register reg);
|
| void PrepareToWrite(X87Register reg);
|
| void CommitWrite(X87Register reg);
|
| void FlushIfNecessary(LInstruction* instr, LCodeGen* cgen);
|
| + void RestoreIfNecessary(LInstruction* instr, LCodeGen* cgen);
|
| + int PhysicalPos(X87Register reg);
|
| int depth() const { return stack_depth_; }
|
| void pop() { stack_depth_--; }
|
| +
|
| void push(X87Register reg) {
|
| ASSERT(stack_depth_ < X87Register::kNumAllocatableRegisters);
|
| stack_[stack_depth_] = reg;
|
| stack_depth_++;
|
| }
|
|
|
| + void leaving(HBasicBlock* block, HBasicBlock* next);
|
| + void record_usage(X87Register reg, HBasicBlock* block);
|
| + void record_definition(X87Register reg, HBasicBlock* block);
|
| +
|
| MacroAssembler* masm() const { return masm_; }
|
|
|
| private:
|
| int ArrayIndex(X87Register reg);
|
| int st2idx(int pos);
|
| X87Register stack_[X87Register::kNumAllocatableRegisters];
|
| + HBasicBlock* first_defined_[X87Register::kNumAllocatableRegisters];
|
| + HBasicBlock* dominated_[X87Register::kNumAllocatableRegisters];
|
| int stack_depth_;
|
| MacroAssembler* const masm_;
|
| };
|
|
|