OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ | 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ |
6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ | 6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ |
7 | 7 |
8 #include "assembler.h" | 8 #include "assembler.h" |
9 #include "frames.h" | 9 #include "frames.h" |
10 #include "v8globals.h" | 10 #include "v8globals.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 Condition CheckUInteger32ValidSmiValue(Register src); | 462 Condition CheckUInteger32ValidSmiValue(Register src); |
463 | 463 |
464 // Check whether src is a Smi, and set dst to zero if it is a smi, | 464 // Check whether src is a Smi, and set dst to zero if it is a smi, |
465 // and to one if it isn't. | 465 // and to one if it isn't. |
466 void CheckSmiToIndicator(Register dst, Register src); | 466 void CheckSmiToIndicator(Register dst, Register src); |
467 void CheckSmiToIndicator(Register dst, const Operand& src); | 467 void CheckSmiToIndicator(Register dst, const Operand& src); |
468 | 468 |
469 // Test-and-jump functions. Typically combines a check function | 469 // Test-and-jump functions. Typically combines a check function |
470 // above with a conditional jump. | 470 // above with a conditional jump. |
471 | 471 |
| 472 // Jump if the value can be represented by a smi. |
| 473 void JumpIfValidSmiValue(Register src, Label* on_valid, |
| 474 Label::Distance near_jump = Label::kFar); |
| 475 |
472 // Jump if the value cannot be represented by a smi. | 476 // Jump if the value cannot be represented by a smi. |
473 void JumpIfNotValidSmiValue(Register src, Label* on_invalid, | 477 void JumpIfNotValidSmiValue(Register src, Label* on_invalid, |
474 Label::Distance near_jump = Label::kFar); | 478 Label::Distance near_jump = Label::kFar); |
475 | 479 |
| 480 // Jump if the unsigned integer value can be represented by a smi. |
| 481 void JumpIfUIntValidSmiValue(Register src, Label* on_valid, |
| 482 Label::Distance near_jump = Label::kFar); |
| 483 |
476 // Jump if the unsigned integer value cannot be represented by a smi. | 484 // Jump if the unsigned integer value cannot be represented by a smi. |
477 void JumpIfUIntNotValidSmiValue(Register src, Label* on_invalid, | 485 void JumpIfUIntNotValidSmiValue(Register src, Label* on_invalid, |
478 Label::Distance near_jump = Label::kFar); | 486 Label::Distance near_jump = Label::kFar); |
479 | 487 |
480 // Jump to label if the value is a tagged smi. | 488 // Jump to label if the value is a tagged smi. |
481 void JumpIfSmi(Register src, | 489 void JumpIfSmi(Register src, |
482 Label* on_smi, | 490 Label* on_smi, |
483 Label::Distance near_jump = Label::kFar); | 491 Label::Distance near_jump = Label::kFar); |
484 | 492 |
485 // Jump to label if the value is not a tagged smi. | 493 // Jump to label if the value is not a tagged smi. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 void SmiNot(Register dst, Register src); | 631 void SmiNot(Register dst, Register src); |
624 void SmiAnd(Register dst, Register src1, Register src2); | 632 void SmiAnd(Register dst, Register src1, Register src2); |
625 void SmiOr(Register dst, Register src1, Register src2); | 633 void SmiOr(Register dst, Register src1, Register src2); |
626 void SmiXor(Register dst, Register src1, Register src2); | 634 void SmiXor(Register dst, Register src1, Register src2); |
627 void SmiAndConstant(Register dst, Register src1, Smi* constant); | 635 void SmiAndConstant(Register dst, Register src1, Smi* constant); |
628 void SmiOrConstant(Register dst, Register src1, Smi* constant); | 636 void SmiOrConstant(Register dst, Register src1, Smi* constant); |
629 void SmiXorConstant(Register dst, Register src1, Smi* constant); | 637 void SmiXorConstant(Register dst, Register src1, Smi* constant); |
630 | 638 |
631 void SmiShiftLeftConstant(Register dst, | 639 void SmiShiftLeftConstant(Register dst, |
632 Register src, | 640 Register src, |
633 int shift_value); | 641 int shift_value, |
| 642 Label* on_not_smi_result = NULL, |
| 643 Label::Distance near_jump = Label::kFar); |
634 void SmiShiftLogicalRightConstant(Register dst, | 644 void SmiShiftLogicalRightConstant(Register dst, |
635 Register src, | 645 Register src, |
636 int shift_value, | 646 int shift_value, |
637 Label* on_not_smi_result, | 647 Label* on_not_smi_result, |
638 Label::Distance near_jump = Label::kFar); | 648 Label::Distance near_jump = Label::kFar); |
639 void SmiShiftArithmeticRightConstant(Register dst, | 649 void SmiShiftArithmeticRightConstant(Register dst, |
640 Register src, | 650 Register src, |
641 int shift_value); | 651 int shift_value); |
642 | 652 |
643 // Shifts a smi value to the left, and returns the result if that is a smi. | 653 // Shifts a smi value to the left, and returns the result if that is a smi. |
644 // Uses and clobbers rcx, so dst may not be rcx. | 654 // Uses and clobbers rcx, so dst may not be rcx. |
645 void SmiShiftLeft(Register dst, | 655 void SmiShiftLeft(Register dst, |
646 Register src1, | 656 Register src1, |
647 Register src2); | 657 Register src2, |
| 658 Label* on_not_smi_result = NULL, |
| 659 Label::Distance near_jump = Label::kFar); |
648 // Shifts a smi value to the right, shifting in zero bits at the top, and | 660 // Shifts a smi value to the right, shifting in zero bits at the top, and |
649 // returns the unsigned intepretation of the result if that is a smi. | 661 // returns the unsigned intepretation of the result if that is a smi. |
650 // Uses and clobbers rcx, so dst may not be rcx. | 662 // Uses and clobbers rcx, so dst may not be rcx. |
651 void SmiShiftLogicalRight(Register dst, | 663 void SmiShiftLogicalRight(Register dst, |
652 Register src1, | 664 Register src1, |
653 Register src2, | 665 Register src2, |
654 Label* on_not_smi_result, | 666 Label* on_not_smi_result, |
655 Label::Distance near_jump = Label::kFar); | 667 Label::Distance near_jump = Label::kFar); |
656 // Shifts a smi value to the right, sign extending the top, and | 668 // Shifts a smi value to the right, sign extending the top, and |
657 // returns the signed intepretation of the result. That will always | 669 // returns the signed intepretation of the result. That will always |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 masm->popfq(); \ | 1611 masm->popfq(); \ |
1600 } \ | 1612 } \ |
1601 masm-> | 1613 masm-> |
1602 #else | 1614 #else |
1603 #define ACCESS_MASM(masm) masm-> | 1615 #define ACCESS_MASM(masm) masm-> |
1604 #endif | 1616 #endif |
1605 | 1617 |
1606 } } // namespace v8::internal | 1618 } } // namespace v8::internal |
1607 | 1619 |
1608 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1620 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |