Chromium Code Reviews| 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..c96871782d4390379104bc95b82bff8419eab23a 100644 |
| --- a/src/ia32/lithium-codegen-ia32.h |
| +++ b/src/ia32/lithium-codegen-ia32.h |
| @@ -448,10 +448,10 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { |
| class X87Stack { |
| public: |
| - explicit X87Stack(MacroAssembler* masm) : stack_depth_(0), masm_(masm) { } |
| + explicit X87Stack(MacroAssembler* masm) |
| + : stack_depth_(0), copy_(false), masm_(masm) { } |
| explicit X87Stack(const X87Stack& other) |
| - : stack_depth_(0), masm_(other.masm_) { |
| - stack_depth_ = other.stack_depth_; |
| + : stack_depth_(other.stack_depth_), copy_(true), masm_(masm()) { |
| for (int i = 0; i < stack_depth_; i++) { |
| stack_[i] = other.stack_[i]; |
| } |
| @@ -470,8 +470,12 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { |
| void CommitWrite(X87Register reg); |
|
Michael Starzinger
2013/08/29 08:55:56
I think both, "PrepareToWrite" and "CommitWrite" s
oliv
2013/08/29 09:23:25
Done.
|
| void FlushIfNecessary(LInstruction* instr, LCodeGen* cgen); |
| int depth() const { return stack_depth_; } |
| - void pop() { stack_depth_--; } |
| + void pop() { |
| + ASSERT(!copy_); |
| + stack_depth_--; |
| + } |
| void push(X87Register reg) { |
| + ASSERT(!copy_); |
| ASSERT(stack_depth_ < X87Register::kNumAllocatableRegisters); |
| stack_[stack_depth_] = reg; |
| stack_depth_++; |
| @@ -482,9 +486,11 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { |
| private: |
| int ArrayIndex(X87Register reg); |
| int st2idx(int pos); |
| + |
| X87Register stack_[X87Register::kNumAllocatableRegisters]; |
| int stack_depth_; |
| - MacroAssembler* const masm_; |
| + bool copy_; |
|
Michael Starzinger
2013/08/29 08:55:56
Let's call this "is_mutable_" instead and reverse
oliv
2013/08/29 09:23:25
Done.
|
| + MacroAssembler* masm_; |
| }; |
| X87Stack x87_stack_; |
| @@ -528,10 +534,11 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { |
| class LDeferredCode : public ZoneObject { |
| public: |
| - explicit LDeferredCode(LCodeGen* codegen) |
| + explicit LDeferredCode(LCodeGen* codegen, const LCodeGen::X87Stack& x87_stack) |
| : codegen_(codegen), |
| external_exit_(NULL), |
| - instruction_index_(codegen->current_instruction_) { |
| + instruction_index_(codegen->current_instruction_), |
| + x87_stack_(x87_stack) { |
| codegen->AddDeferredCode(this); |
| } |
| @@ -543,6 +550,7 @@ class LDeferredCode : public ZoneObject { |
| Label* entry() { return &entry_; } |
| Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; } |
| int instruction_index() const { return instruction_index_; } |
| + const LCodeGen::X87Stack& x87_stack() const { return x87_stack_; } |
| protected: |
| LCodeGen* codegen() const { return codegen_; } |
| @@ -554,6 +562,7 @@ class LDeferredCode : public ZoneObject { |
| Label exit_; |
| Label* external_exit_; |
| int instruction_index_; |
| + LCodeGen::X87Stack x87_stack_; |
| }; |
| } } // namespace v8::internal |