Reporting -1 as the size of an ILLEGAL reference which actually has

size 0 was too cute.
Review URL: http://codereview.chromium.org/9689

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@709 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bdb896cc
......@@ -569,9 +569,7 @@ void CodeGenerator::UnloadReference(Reference* ref) {
// Pop a reference from the stack while preserving TOS.
Comment cmnt(masm_, "[ UnloadReference");
int size = ref->size();
if (size <= 0) {
// Do nothing. No popping is necessary.
} else {
if (size > 0) {
frame_->Pop(r0);
frame_->Drop(size);
frame_->Push(r0);
......
......@@ -117,8 +117,8 @@ class Reference BASE_EMBEDDED {
type_ = value;
}
// The size of the reference or -1 if the reference is illegal.
int size() const { return type_; }
// The size the reference takes up on the stack.
int size() const { return (type_ == ILLEGAL) ? 0 : type_; }
bool is_illegal() const { return type_ == ILLEGAL; }
bool is_slot() const { return type_ == SLOT; }
......
......@@ -607,12 +607,10 @@ void CodeGenerator::UnloadReference(Reference* ref) {
// Pop a reference from the stack while preserving TOS.
Comment cmnt(masm_, "[ UnloadReference");
int size = ref->size();
if (size <= 0) {
// Do nothing. No popping is necessary.
} else if (size == 1) {
if (size == 1) {
frame_->Pop(eax);
__ mov(frame_->Top(), eax);
} else {
} else if (size > 1) {
frame_->Pop(eax);
frame_->Drop(size);
frame_->Push(eax);
......
......@@ -121,8 +121,8 @@ class Reference BASE_EMBEDDED {
type_ = value;
}
// The size of the reference or -1 if the reference is illegal.
int size() const { return type_; }
// The size the reference takes up on the stack.
int size() const { return (type_ == ILLEGAL) ? 0 : type_; }
bool is_illegal() const { return type_ == ILLEGAL; }
bool is_slot() const { return type_ == SLOT; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment