| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_CONSTANTS_DBC_H_ | 5 #ifndef VM_CONSTANTS_DBC_H_ |
| 6 #define VM_CONSTANTS_DBC_H_ | 6 #define VM_CONSTANTS_DBC_H_ |
| 7 | 7 |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 case Bytecode::kInstanceCall1Opt: | 747 case Bytecode::kInstanceCall1Opt: |
| 748 case Bytecode::kInstanceCall2Opt: | 748 case Bytecode::kInstanceCall2Opt: |
| 749 case Bytecode::kDebugBreak: | 749 case Bytecode::kDebugBreak: |
| 750 return true; | 750 return true; |
| 751 | 751 |
| 752 default: | 752 default: |
| 753 return false; | 753 return false; |
| 754 } | 754 } |
| 755 } | 755 } |
| 756 | 756 |
| 757 DART_FORCE_INLINE static bool IsFastSmiOpcode(Instr instr) { |
| 758 switch (DecodeOpcode(instr)) { |
| 759 case Bytecode::kAddTOS: |
| 760 case Bytecode::kSubTOS: |
| 761 case Bytecode::kMulTOS: |
| 762 case Bytecode::kBitOrTOS: |
| 763 case Bytecode::kBitAndTOS: |
| 764 case Bytecode::kEqualTOS: |
| 765 case Bytecode::kLessThanTOS: |
| 766 case Bytecode::kGreaterThanTOS: |
| 767 return true; |
| 768 |
| 769 default: |
| 770 return false; |
| 771 } |
| 772 } |
| 773 |
| 757 DART_FORCE_INLINE static uint8_t DecodeArgc(Instr call) { | 774 DART_FORCE_INLINE static uint8_t DecodeArgc(Instr call) { |
| 758 ASSERT(IsCallOpcode(call)); | 775 ASSERT(IsCallOpcode(call)); |
| 759 return (call >> 8) & 0xFF; | 776 return (call >> 8) & 0xFF; |
| 760 } | 777 } |
| 761 | 778 |
| 762 static Instr At(uword pc) { return *reinterpret_cast<Instr*>(pc); } | 779 static Instr At(uword pc) { return *reinterpret_cast<Instr*>(pc); } |
| 763 | 780 |
| 764 private: | 781 private: |
| 765 DISALLOW_ALLOCATION(); | 782 DISALLOW_ALLOCATION(); |
| 766 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecode); | 783 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecode); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 793 | 810 |
| 794 // After a comparison, the condition NEXT_IS_TRUE means the following | 811 // After a comparison, the condition NEXT_IS_TRUE means the following |
| 795 // instruction is executed if the comparision is true and skipped over overwise. | 812 // instruction is executed if the comparision is true and skipped over overwise. |
| 796 // Conidition NEXT_IS_FALSE means the following instruction is executed if the | 813 // Conidition NEXT_IS_FALSE means the following instruction is executed if the |
| 797 // comparison is false and skipped over otherwise. | 814 // comparison is false and skipped over otherwise. |
| 798 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; | 815 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; |
| 799 | 816 |
| 800 } // namespace dart | 817 } // namespace dart |
| 801 | 818 |
| 802 #endif // VM_CONSTANTS_DBC_H_ | 819 #endif // VM_CONSTANTS_DBC_H_ |
| OLD | NEW |