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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2279 expr->BinaryOperationFeedbackId()); 2279 expr->BinaryOperationFeedbackId());
2280 patch_site.EmitPatchInfo(); 2280 patch_site.EmitPatchInfo();
2281 __ jmp(&done, Label::kNear); 2281 __ jmp(&done, Label::kNear);
2282 2282
2283 __ bind(&smi_case); 2283 __ bind(&smi_case);
2284 switch (op) { 2284 switch (op) {
2285 case Token::SAR: 2285 case Token::SAR:
2286 __ SmiShiftArithmeticRight(rax, rdx, rcx); 2286 __ SmiShiftArithmeticRight(rax, rdx, rcx);
2287 break; 2287 break;
2288 case Token::SHL: 2288 case Token::SHL:
2289 #if !V8_USE_31_BITS_SMI_VALUE
2289 __ SmiShiftLeft(rax, rdx, rcx); 2290 __ SmiShiftLeft(rax, rdx, rcx);
2291 #else
2292 __ SmiShiftLeft(rax, rdx, rcx, &stub_call);
2293 #endif
2290 break; 2294 break;
2291 case Token::SHR: 2295 case Token::SHR:
2292 __ SmiShiftLogicalRight(rax, rdx, rcx, &stub_call); 2296 __ SmiShiftLogicalRight(rax, rdx, rcx, &stub_call);
2293 break; 2297 break;
2294 case Token::ADD: 2298 case Token::ADD:
2295 __ SmiAdd(rax, rdx, rcx, &stub_call); 2299 __ SmiAdd(rax, rdx, rcx, &stub_call);
2296 break; 2300 break;
2297 case Token::SUB: 2301 case Token::SUB:
2298 __ SmiSub(rax, rdx, rcx, &stub_call); 2302 __ SmiSub(rax, rdx, rcx, &stub_call);
2299 break; 2303 break;
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
4447 } 4451 }
4448 } 4452 }
4449 4453
4450 // Inline smi case if we are in a loop. 4454 // Inline smi case if we are in a loop.
4451 Label done, stub_call; 4455 Label done, stub_call;
4452 JumpPatchSite patch_site(masm_); 4456 JumpPatchSite patch_site(masm_);
4453 4457
4454 if (ShouldInlineSmiCase(expr->op())) { 4458 if (ShouldInlineSmiCase(expr->op())) {
4455 if (expr->op() == Token::INC) { 4459 if (expr->op() == Token::INC) {
4456 __ SmiAddConstant(rax, rax, Smi::FromInt(1)); 4460 __ SmiAddConstant(rax, rax, Smi::FromInt(1));
4461 #if V8_USE_31_BITS_SMI_VALUE
4462 __ testl(rax, Immediate(0x80000000));
4463 __ j(not_zero, &stub_call, Label::kNear);
4464 #endif
4457 } else { 4465 } else {
4458 __ SmiSubConstant(rax, rax, Smi::FromInt(1)); 4466 __ SmiSubConstant(rax, rax, Smi::FromInt(1));
4467 #if V8_USE_31_BITS_SMI_VALUE
4468 __ testl(rax, Immediate(0x80000000));
4469 __ j(zero, &stub_call, Label::kNear);
4470 #endif
4459 } 4471 }
4472 #if !V8_USE_31_BITS_SMI_VALUE
4460 __ j(overflow, &stub_call, Label::kNear); 4473 __ j(overflow, &stub_call, Label::kNear);
4474 #endif
4461 // We could eliminate this smi check if we split the code at 4475 // We could eliminate this smi check if we split the code at
4462 // the first smi check before calling ToNumber. 4476 // the first smi check before calling ToNumber.
4463 patch_site.EmitJumpIfSmi(rax, &done, Label::kNear); 4477 patch_site.EmitJumpIfSmi(rax, &done, Label::kNear);
4464 4478
4465 __ bind(&stub_call); 4479 __ bind(&stub_call);
4466 // Call stub. Undo operation first. 4480 // Call stub. Undo operation first.
4467 if (expr->op() == Token::INC) { 4481 if (expr->op() == Token::INC) {
4468 __ SmiSubConstant(rax, rax, Smi::FromInt(1)); 4482 __ SmiSubConstant(rax, rax, Smi::FromInt(1));
4469 } else { 4483 } else {
4470 __ SmiAddConstant(rax, rax, Smi::FromInt(1)); 4484 __ SmiAddConstant(rax, rax, Smi::FromInt(1));
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
4905 *context_length = 0; 4919 *context_length = 0;
4906 return previous_; 4920 return previous_;
4907 } 4921 }
4908 4922
4909 4923
4910 #undef __ 4924 #undef __
4911 4925
4912 } } // namespace v8::internal 4926 } } // namespace v8::internal
4913 4927
4914 #endif // V8_TARGET_ARCH_X64 4928 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698