// 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);
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; }
// 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);
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; }