Commit 64e44376 authored by kasperl@chromium.org's avatar kasperl@chromium.org

Recommit r3494 after fixing stupid mistake where the deferred code stub didn't...

Recommit r3494 after fixing stupid mistake where the deferred code stub didn't know it was reversed.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9b0a967c
...@@ -1731,9 +1731,42 @@ void CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -1731,9 +1731,42 @@ void CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
case Token::SHL: case Token::SHL:
if (reversed) { if (reversed) {
Result constant_operand(value); Result right;
LikelySmiBinaryOperation(op, &constant_operand, operand, Result right_copy_in_ecx;
overwrite_mode);
// 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();
DeferredInlineSmiOperationReversed* deferred =
new DeferredInlineSmiOperationReversed(op,
answer.reg(),
smi_value,
right.reg(),
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);
} else { } else {
// Only the least significant 5 bits of the shift value are used. // Only the least significant 5 bits of the shift value are used.
// In the slow case, this masking is done inside the runtime call. // In the slow case, this masking is done inside the runtime call.
......
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