[v8] r3499 committed - Recommit r3494 after fixing stupid mistake where the deferred code stu...

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 18, 2009, 8:48:32 AM12/18/09
to v8-...@googlegroups.com
Revision: 3499
Author: kas...@chromium.org
Date: Fri Dec 18 05:47:58 2009
Log: Recommit r3494 after fixing stupid mistake where the deferred code
stub didn't know it was reversed.
http://code.google.com/p/v8/source/detail?r=3499

Modified:
/branches/bleeding_edge/src/ia32/codegen-ia32.cc

=======================================
--- /branches/bleeding_edge/src/ia32/codegen-ia32.cc Fri Dec 18 05:14:37
2009
+++ /branches/bleeding_edge/src/ia32/codegen-ia32.cc Fri Dec 18 05:47:58
2009
@@ -1731,9 +1731,42 @@

case Token::SHL:
if (reversed) {
- Result constant_operand(value);
- LikelySmiBinaryOperation(op, &constant_operand, operand,
- overwrite_mode);
+ 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();
+ 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 {
// Only the least significant 5 bits of the shift value are used.
// In the slow case, this masking is done inside the runtime call.

Reply all
Reply to author
Forward
0 new messages