| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 __ incq(rax); | 512 __ incq(rax); |
| 513 __ xor_(rcx, Immediate(kSmiTagMask)); | 513 __ xor_(rcx, Immediate(kSmiTagMask)); |
| 514 cond = masm->CheckSmi(rcx); | 514 cond = masm->CheckSmi(rcx); |
| 515 __ j(cond, &exit); | 515 __ j(cond, &exit); |
| 516 | 516 |
| 517 // CheckPositiveSmi | 517 // CheckPositiveSmi |
| 518 | 518 |
| 519 __ incq(rax); | 519 __ incq(rax); |
| 520 __ movl(rcx, Immediate(0)); | 520 __ movl(rcx, Immediate(0)); |
| 521 __ Integer32ToSmi(rcx, rcx); | 521 __ Integer32ToSmi(rcx, rcx); |
| 522 cond = masm->CheckPositiveSmi(rcx); // Zero counts as positive. | 522 cond = masm->CheckNonNegativeSmi(rcx); |
| 523 __ j(NegateCondition(cond), &exit); | 523 __ j(NegateCondition(cond), &exit); |
| 524 | 524 |
| 525 __ incq(rax); | 525 __ incq(rax); |
| 526 __ xor_(rcx, Immediate(kSmiTagMask)); | 526 __ xor_(rcx, Immediate(kSmiTagMask)); |
| 527 cond = masm->CheckPositiveSmi(rcx); // "zero" non-smi. | 527 cond = masm->CheckNonNegativeSmi(rcx); // "zero" non-smi. |
| 528 __ j(cond, &exit); | 528 __ j(cond, &exit); |
| 529 | 529 |
| 530 __ incq(rax); | 530 __ incq(rax); |
| 531 __ movq(rcx, Immediate(-1)); | 531 __ movq(rcx, Immediate(-1)); |
| 532 __ Integer32ToSmi(rcx, rcx); | 532 __ Integer32ToSmi(rcx, rcx); |
| 533 cond = masm->CheckPositiveSmi(rcx); // Negative smis are not positive. | 533 cond = masm->CheckNonNegativeSmi(rcx); // Negative smis are not positive. |
| 534 __ j(cond, &exit); | 534 __ j(cond, &exit); |
| 535 | 535 |
| 536 __ incq(rax); | 536 __ incq(rax); |
| 537 __ movq(rcx, Immediate(Smi::kMinValue)); | 537 __ movq(rcx, Immediate(Smi::kMinValue)); |
| 538 __ Integer32ToSmi(rcx, rcx); | 538 __ Integer32ToSmi(rcx, rcx); |
| 539 cond = masm->CheckPositiveSmi(rcx); // Most negative smi is not positive. | 539 cond = masm->CheckNonNegativeSmi(rcx); // Most negative smi is not positive. |
| 540 __ j(cond, &exit); | 540 __ j(cond, &exit); |
| 541 | 541 |
| 542 __ incq(rax); | 542 __ incq(rax); |
| 543 __ xor_(rcx, Immediate(kSmiTagMask)); | 543 __ xor_(rcx, Immediate(kSmiTagMask)); |
| 544 cond = masm->CheckPositiveSmi(rcx); // "Negative" non-smi. | 544 cond = masm->CheckNonNegativeSmi(rcx); // "Negative" non-smi. |
| 545 __ j(cond, &exit); | 545 __ j(cond, &exit); |
| 546 | 546 |
| 547 __ incq(rax); | 547 __ incq(rax); |
| 548 __ movq(rcx, Immediate(Smi::kMaxValue)); | 548 __ movq(rcx, Immediate(Smi::kMaxValue)); |
| 549 __ Integer32ToSmi(rcx, rcx); | 549 __ Integer32ToSmi(rcx, rcx); |
| 550 cond = masm->CheckPositiveSmi(rcx); // Most positive smi is positive. | 550 cond = masm->CheckNonNegativeSmi(rcx); // Most positive smi is positive. |
| 551 __ j(NegateCondition(cond), &exit); | 551 __ j(NegateCondition(cond), &exit); |
| 552 | 552 |
| 553 __ incq(rax); | 553 __ incq(rax); |
| 554 __ xor_(rcx, Immediate(kSmiTagMask)); | 554 __ xor_(rcx, Immediate(kSmiTagMask)); |
| 555 cond = masm->CheckPositiveSmi(rcx); // "Positive" non-smi. | 555 cond = masm->CheckNonNegativeSmi(rcx); // "Positive" non-smi. |
| 556 __ j(cond, &exit); | 556 __ j(cond, &exit); |
| 557 | 557 |
| 558 // CheckIsMinSmi | 558 // CheckIsMinSmi |
| 559 | 559 |
| 560 __ incq(rax); | 560 __ incq(rax); |
| 561 __ movq(rcx, Immediate(Smi::kMaxValue)); | 561 __ movq(rcx, Immediate(Smi::kMaxValue)); |
| 562 __ Integer32ToSmi(rcx, rcx); | 562 __ Integer32ToSmi(rcx, rcx); |
| 563 cond = masm->CheckIsMinSmi(rcx); | 563 cond = masm->CheckIsMinSmi(rcx); |
| 564 __ j(cond, &exit); | 564 __ j(cond, &exit); |
| 565 | 565 |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2465 CodeDesc desc; | 2465 CodeDesc desc; |
| 2466 masm->GetCode(&desc); | 2466 masm->GetCode(&desc); |
| 2467 // Call the function from C++. | 2467 // Call the function from C++. |
| 2468 int result = FUNCTION_CAST<F0>(buffer)(); | 2468 int result = FUNCTION_CAST<F0>(buffer)(); |
| 2469 CHECK_EQ(0, result); | 2469 CHECK_EQ(0, result); |
| 2470 } | 2470 } |
| 2471 | 2471 |
| 2472 | 2472 |
| 2473 | 2473 |
| 2474 #undef __ | 2474 #undef __ |
| OLD | NEW |