From 12866185ea1eb5a0185fdbd7a7c934163bfa8757 Mon Sep 17 00:00:00 2001 From: "kasperl@chromium.org" Date: Fri, 18 Dec 2009 13:14:37 +0000 Subject: [PATCH] Revert r3495 - some weird corner case is broken. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/codegen-ia32.cc | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc index d4248c1aca..6a6562a7a7 100644 --- a/src/ia32/codegen-ia32.cc +++ b/src/ia32/codegen-ia32.cc @@ -1731,42 +1731,9 @@ void CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, case Token::SHL: if (reversed) { - Result right; - Result right_copy_in_ecx; - - // Make sure to get a copy of the right operand into ecx. This - // allows us to modify it without having to restore it in the - // deferred code. - operand->ToRegister(); - if (operand->reg().is(ecx)) { - right = allocator()->Allocate(); - __ mov(right.reg(), ecx); - frame_->Spill(ecx); - right_copy_in_ecx = *operand; - } else { - right_copy_in_ecx = allocator()->Allocate(ecx); - __ mov(ecx, operand->reg()); - right = *operand; - } - operand->Unuse(); - - Result answer = allocator()->Allocate(); - DeferredInlineSmiOperation* deferred = - new DeferredInlineSmiOperation(op, - answer.reg(), - right.reg(), - smi_value, - overwrite_mode); - __ mov(answer.reg(), Immediate(int_value)); - __ sar(ecx, kSmiTagSize); - deferred->Branch(carry); - __ shl_cl(answer.reg()); - __ cmp(answer.reg(), 0xc0000000); - deferred->Branch(sign); - __ SmiTag(answer.reg()); - - deferred->BindExit(); - frame_->Push(&answer); + Result constant_operand(value); + LikelySmiBinaryOperation(op, &constant_operand, operand, + overwrite_mode); } else { // Only the least significant 5 bits of the shift value are used. // In the slow case, this masking is done inside the runtime call.