OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 bool generating_stub() { return generating_stub_; } | 712 bool generating_stub() { return generating_stub_; } |
713 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } | 713 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } |
714 bool allow_stub_calls() { return allow_stub_calls_; } | 714 bool allow_stub_calls() { return allow_stub_calls_; } |
715 | 715 |
716 // --------------------------------------------------------------------------- | 716 // --------------------------------------------------------------------------- |
717 // Smi utilities | 717 // Smi utilities |
718 | 718 |
719 void SmiTag(Register reg, SBit s = LeaveCC) { | 719 void SmiTag(Register reg, SBit s = LeaveCC) { |
720 add(reg, reg, Operand(reg), s); | 720 add(reg, reg, Operand(reg), s); |
721 } | 721 } |
| 722 void SmiTag(Register dst, Register src, SBit s = LeaveCC) { |
| 723 add(dst, src, Operand(src), s); |
| 724 } |
722 | 725 |
723 // Try to convert int32 to smi. If the value is to large, preserve | 726 // Try to convert int32 to smi. If the value is to large, preserve |
724 // the original value and jump to not_a_smi. Destroys scratch and | 727 // the original value and jump to not_a_smi. Destroys scratch and |
725 // sets flags. | 728 // sets flags. |
726 void TrySmiTag(Register reg, Label* not_a_smi, Register scratch) { | 729 void TrySmiTag(Register reg, Label* not_a_smi, Register scratch) { |
727 mov(scratch, reg); | 730 mov(scratch, reg); |
728 SmiTag(scratch, SetCC); | 731 SmiTag(scratch, SetCC); |
729 b(vs, not_a_smi); | 732 b(vs, not_a_smi); |
730 mov(reg, scratch); | 733 mov(reg, scratch); |
731 } | 734 } |
732 | 735 |
733 void SmiUntag(Register reg) { | 736 void SmiUntag(Register reg) { |
734 mov(reg, Operand(reg, ASR, kSmiTagSize)); | 737 mov(reg, Operand(reg, ASR, kSmiTagSize)); |
735 } | 738 } |
| 739 void SmiUntag(Register dst, Register src) { |
| 740 mov(dst, Operand(src, ASR, kSmiTagSize)); |
| 741 } |
736 | 742 |
737 // Jump if either of the registers contain a non-smi. | 743 // Jump if either of the registers contain a non-smi. |
738 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); | 744 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); |
739 // Jump if either of the registers contain a smi. | 745 // Jump if either of the registers contain a smi. |
740 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); | 746 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); |
741 | 747 |
742 // Abort execution if argument is a smi. Used in debug code. | 748 // Abort execution if argument is a smi. Used in debug code. |
743 void AbortIfSmi(Register object); | 749 void AbortIfSmi(Register object); |
744 void AbortIfNotSmi(Register object); | 750 void AbortIfNotSmi(Register object); |
745 | 751 |
746 // --------------------------------------------------------------------------- | 752 // --------------------------------------------------------------------------- |
| 753 // HeapNumber utilities |
| 754 |
| 755 void JumpIfNotHeapNumber(Register object, |
| 756 Register heap_number_map, |
| 757 Register scratch, |
| 758 Label* on_not_heap_number); |
| 759 |
| 760 // --------------------------------------------------------------------------- |
747 // String utilities | 761 // String utilities |
748 | 762 |
749 // Checks if both objects are sequential ASCII strings and jumps to label | 763 // Checks if both objects are sequential ASCII strings and jumps to label |
750 // if either is not. Assumes that neither object is a smi. | 764 // if either is not. Assumes that neither object is a smi. |
751 void JumpIfNonSmisNotBothSequentialAsciiStrings(Register object1, | 765 void JumpIfNonSmisNotBothSequentialAsciiStrings(Register object1, |
752 Register object2, | 766 Register object2, |
753 Register scratch1, | 767 Register scratch1, |
754 Register scratch2, | 768 Register scratch2, |
755 Label* failure); | 769 Label* failure); |
756 | 770 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 890 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
877 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 891 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
878 #else | 892 #else |
879 #define ACCESS_MASM(masm) masm-> | 893 #define ACCESS_MASM(masm) masm-> |
880 #endif | 894 #endif |
881 | 895 |
882 | 896 |
883 } } // namespace v8::internal | 897 } } // namespace v8::internal |
884 | 898 |
885 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 899 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |