Revert change 1656 which was unsafe until it can be properly fixed.

TBR=whesse@chromium.org
Review URL: http://codereview.chromium.org/60010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1666 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2009-04-01 10:35:20 +00:00
parent 015164f0f2
commit deb0d4cc37

View File

@ -4799,25 +4799,17 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
target.size() * kPointerSize);
Result value = frame_->Pop();
value.ToRegister();
ASSERT(value.is_valid());
// Postfix: Store the old value as the result.
if (is_postfix) {
if (value.is_register()) {
Result old_value = allocator_->Allocate();
ASSERT(old_value.is_valid());
__ mov(old_value.reg(), value.reg());
frame_->SetElementAt(target.size(), &old_value);
} else {
ASSERT(value.is_constant());
Result old_value = value;
frame_->SetElementAt(target.size(), &old_value);
}
Result old_value = value;
frame_->SetElementAt(target.size(), &old_value);
}
// Perform optimistic increment/decrement. Ensure the value is
// writable.
value.ToRegister();
ASSERT(value.is_valid());
frame_->Spill(value.reg());
ASSERT(allocator_->count(value.reg()) == 1);