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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 Condition IsObjectStringType(Register obj, | 538 Condition IsObjectStringType(Register obj, |
539 Register type) { | 539 Register type) { |
540 ldr(type, FieldMemOperand(obj, HeapObject::kMapOffset)); | 540 ldr(type, FieldMemOperand(obj, HeapObject::kMapOffset)); |
541 ldrb(type, FieldMemOperand(type, Map::kInstanceTypeOffset)); | 541 ldrb(type, FieldMemOperand(type, Map::kInstanceTypeOffset)); |
542 tst(type, Operand(kIsNotStringMask)); | 542 tst(type, Operand(kIsNotStringMask)); |
543 ASSERT_EQ(0, kStringTag); | 543 ASSERT_EQ(0, kStringTag); |
544 return eq; | 544 return eq; |
545 } | 545 } |
546 | 546 |
547 | 547 |
548 inline void BranchOnSmi(Register value, Label* smi_label) { | |
549 tst(value, Operand(kSmiTagMask)); | |
550 b(eq, smi_label); | |
551 } | |
552 | |
553 inline void BranchOnNotSmi(Register value, Label* not_smi_label) { | |
554 tst(value, Operand(kSmiTagMask)); | |
555 b(ne, not_smi_label); | |
556 } | |
557 | |
558 // Generates code for reporting that an illegal operation has | 548 // Generates code for reporting that an illegal operation has |
559 // occurred. | 549 // occurred. |
560 void IllegalOperation(int num_arguments); | 550 void IllegalOperation(int num_arguments); |
561 | 551 |
562 // Picks out an array index from the hash field. | 552 // Picks out an array index from the hash field. |
563 // Register use: | 553 // Register use: |
564 // hash - holds the index's hash. Clobbered. | 554 // hash - holds the index's hash. Clobbered. |
565 // index - holds the overwritten index on exit. | 555 // index - holds the overwritten index on exit. |
566 void IndexFromHash(Register hash, Register index); | 556 void IndexFromHash(Register hash, Register index); |
567 | 557 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 mov(reg, scratch); | 723 mov(reg, scratch); |
734 } | 724 } |
735 | 725 |
736 void SmiUntag(Register reg) { | 726 void SmiUntag(Register reg) { |
737 mov(reg, Operand(reg, ASR, kSmiTagSize)); | 727 mov(reg, Operand(reg, ASR, kSmiTagSize)); |
738 } | 728 } |
739 void SmiUntag(Register dst, Register src) { | 729 void SmiUntag(Register dst, Register src) { |
740 mov(dst, Operand(src, ASR, kSmiTagSize)); | 730 mov(dst, Operand(src, ASR, kSmiTagSize)); |
741 } | 731 } |
742 | 732 |
| 733 // Jump the register contains a smi. |
| 734 inline void JumpIfSmi(Register value, Label* smi_label) { |
| 735 tst(value, Operand(kSmiTagMask)); |
| 736 b(eq, smi_label); |
| 737 } |
| 738 // Jump if either of the registers contain a non-smi. |
| 739 inline void JumpIfNotSmi(Register value, Label* not_smi_label) { |
| 740 tst(value, Operand(kSmiTagMask)); |
| 741 b(ne, not_smi_label); |
| 742 } |
743 // Jump if either of the registers contain a non-smi. | 743 // Jump if either of the registers contain a non-smi. |
744 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); | 744 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); |
745 // Jump if either of the registers contain a smi. | 745 // Jump if either of the registers contain a smi. |
746 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); | 746 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); |
747 | 747 |
748 // Abort execution if argument is a smi. Used in debug code. | 748 // Abort execution if argument is a smi. Used in debug code. |
749 void AbortIfSmi(Register object); | 749 void AbortIfSmi(Register object); |
750 void AbortIfNotSmi(Register object); | 750 void AbortIfNotSmi(Register object); |
751 | 751 |
752 // --------------------------------------------------------------------------- | 752 // --------------------------------------------------------------------------- |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 890 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
891 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 891 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
892 #else | 892 #else |
893 #define ACCESS_MASM(masm) masm-> | 893 #define ACCESS_MASM(masm) masm-> |
894 #endif | 894 #endif |
895 | 895 |
896 | 896 |
897 } } // namespace v8::internal | 897 } } // namespace v8::internal |
898 | 898 |
899 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 899 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |