Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: src/ia32/lithium-codegen-ia32.h

Issue 23490022: Reland "Fix missing x87 tracking for deferred code." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..37a7ea9477a5b77055d2de768af56a63d9a7c900 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), is_mutable_(true), masm_(masm) { }
explicit X87Stack(const X87Stack& other)
- : stack_depth_(0), masm_(other.masm_) {
- stack_depth_ = other.stack_depth_;
+ : stack_depth_(other.stack_depth_), is_mutable_(false), 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);
void FlushIfNecessary(LInstruction* instr, LCodeGen* cgen);
int depth() const { return stack_depth_; }
- void pop() { stack_depth_--; }
+ void pop() {
+ ASSERT(is_mutable_);
+ stack_depth_--;
+ }
void push(X87Register reg) {
+ ASSERT(is_mutable_);
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 is_mutable_;
+ 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
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698