Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Unified Diff: src/x64/full-codegen-x64.cc

Issue 21014003: Optionally use 31-bits SMI value for 64-bit system (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index bac4e793b279bf4a86353db7024aa92352219e79..aaf9d6421c05ce7fd6bb0877810c7642b2de70ca 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -2286,7 +2286,11 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ SmiShiftArithmeticRight(rax, rdx, rcx);
break;
case Token::SHL:
+#if !V8_USE_31_BITS_SMI_VALUE
__ SmiShiftLeft(rax, rdx, rcx);
+#else
+ __ SmiShiftLeft(rax, rdx, rcx, &stub_call);
+#endif
break;
case Token::SHR:
__ SmiShiftLogicalRight(rax, rdx, rcx, &stub_call);
@@ -4454,10 +4458,20 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
if (ShouldInlineSmiCase(expr->op())) {
if (expr->op() == Token::INC) {
__ SmiAddConstant(rax, rax, Smi::FromInt(1));
+#if V8_USE_31_BITS_SMI_VALUE
+ __ testl(rax, Immediate(0x80000000));
+ __ j(not_zero, &stub_call, Label::kNear);
+#endif
} else {
__ SmiSubConstant(rax, rax, Smi::FromInt(1));
+#if V8_USE_31_BITS_SMI_VALUE
+ __ testl(rax, Immediate(0x80000000));
+ __ j(zero, &stub_call, Label::kNear);
+#endif
}
+#if !V8_USE_31_BITS_SMI_VALUE
__ j(overflow, &stub_call, Label::kNear);
+#endif
// We could eliminate this smi check if we split the code at
// the first smi check before calling ToNumber.
patch_site.EmitJumpIfSmi(rax, &done, Label::kNear);

Powered by Google App Engine
This is Rietveld 408576698