| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // | 155 // |
| 156 // - InstanceCall<N> ArgC, D; InstanceCall<N>Opt ArgC, D | 156 // - InstanceCall<N> ArgC, D; InstanceCall<N>Opt ArgC, D |
| 157 // | 157 // |
| 158 // Lookup and invoke method with N checked arguments using ICData in PP[D] | 158 // Lookup and invoke method with N checked arguments using ICData in PP[D] |
| 159 // with arguments SP[-(1+ArgC)], ..., SP[-1]. | 159 // with arguments SP[-(1+ArgC)], ..., SP[-1]. |
| 160 // | 160 // |
| 161 // - NativeCall, NativeBootstrapCall | 161 // - NativeCall, NativeBootstrapCall |
| 162 // | 162 // |
| 163 // Invoke native function SP[-1] with argc_tag SP[0]. | 163 // Invoke native function SP[-1] with argc_tag SP[0]. |
| 164 // | 164 // |
| 165 // - PushPolymorphicInstanceCall ArgC, D |
| 166 // |
| 167 // Skips 2*D + 1 instructions and pushes a function object onto the stack |
| 168 // if one can be found as follows. Otherwise skips only 2*D instructions. |
| 169 // The function is looked up in the IC data encoded in the following 2*D |
| 170 // Nop instructions. The Nop instructions should be arranged in pairs with |
| 171 // the first being the cid, and the second being the function to push if |
| 172 // the cid is the cid of the receiver found at SP[-(1 + ArgC)]. |
| 173 // |
| 165 // - OneByteStringFromCharCode rA, rX | 174 // - OneByteStringFromCharCode rA, rX |
| 166 // | 175 // |
| 167 // Load the one-character symbol with the char code given by the Smi | 176 // Load the one-character symbol with the char code given by the Smi |
| 168 // in FP[rX] into FP[rA]. | 177 // in FP[rX] into FP[rA]. |
| 169 // | 178 // |
| 170 // - StringToCharCode rA, rX | 179 // - StringToCharCode rA, rX |
| 171 // | 180 // |
| 172 // Load and smi-encode the single char code of the string in FP[rX] into | 181 // Load and smi-encode the single char code of the string in FP[rX] into |
| 173 // FP[rA]. If the string's length is not 1, load smi -1 instead. | 182 // FP[rA]. If the string's length is not 1, load smi -1 instead. |
| 174 // | 183 // |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 V(LoadClassIdTOS, 0, ___, ___, ___) \ | 567 V(LoadClassIdTOS, 0, ___, ___, ___) \ |
| 559 V(PushConstant, D, lit, ___, ___) \ | 568 V(PushConstant, D, lit, ___, ___) \ |
| 560 V(StoreLocal, X, xeg, ___, ___) \ | 569 V(StoreLocal, X, xeg, ___, ___) \ |
| 561 V(PopLocal, X, xeg, ___, ___) \ | 570 V(PopLocal, X, xeg, ___, ___) \ |
| 562 V(IndirectStaticCall, A_D, num, num, ___) \ | 571 V(IndirectStaticCall, A_D, num, num, ___) \ |
| 563 V(StaticCall, A_D, num, num, ___) \ | 572 V(StaticCall, A_D, num, num, ___) \ |
| 564 V(InstanceCall1, A_D, num, num, ___) \ | 573 V(InstanceCall1, A_D, num, num, ___) \ |
| 565 V(InstanceCall2, A_D, num, num, ___) \ | 574 V(InstanceCall2, A_D, num, num, ___) \ |
| 566 V(InstanceCall1Opt, A_D, num, num, ___) \ | 575 V(InstanceCall1Opt, A_D, num, num, ___) \ |
| 567 V(InstanceCall2Opt, A_D, num, num, ___) \ | 576 V(InstanceCall2Opt, A_D, num, num, ___) \ |
| 577 V(PushPolymorphicInstanceCall, A_D, num, num, ___) \ |
| 568 V(NativeCall, 0, ___, ___, ___) \ | 578 V(NativeCall, 0, ___, ___, ___) \ |
| 569 V(NativeBootstrapCall, 0, ___, ___, ___) \ | 579 V(NativeBootstrapCall, 0, ___, ___, ___) \ |
| 570 V(OneByteStringFromCharCode, A_X, reg, xeg, ___) \ | 580 V(OneByteStringFromCharCode, A_X, reg, xeg, ___) \ |
| 571 V(StringToCharCode, A_X, reg, xeg, ___) \ | 581 V(StringToCharCode, A_X, reg, xeg, ___) \ |
| 572 V(AddTOS, 0, ___, ___, ___) \ | 582 V(AddTOS, 0, ___, ___, ___) \ |
| 573 V(SubTOS, 0, ___, ___, ___) \ | 583 V(SubTOS, 0, ___, ___, ___) \ |
| 574 V(MulTOS, 0, ___, ___, ___) \ | 584 V(MulTOS, 0, ___, ___, ___) \ |
| 575 V(BitOrTOS, 0, ___, ___, ___) \ | 585 V(BitOrTOS, 0, ___, ___, ___) \ |
| 576 V(BitAndTOS, 0, ___, ___, ___) \ | 586 V(BitAndTOS, 0, ___, ___, ___) \ |
| 577 V(EqualTOS, 0, ___, ___, ___) \ | 587 V(EqualTOS, 0, ___, ___, ___) \ |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecode); | 793 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecode); |
| 784 }; | 794 }; |
| 785 | 795 |
| 786 // Various dummy declarations to make shared code compile. | 796 // Various dummy declarations to make shared code compile. |
| 787 // TODO(vegorov) we need to prune away as much dead code as possible instead | 797 // TODO(vegorov) we need to prune away as much dead code as possible instead |
| 788 // of just making it compile. | 798 // of just making it compile. |
| 789 typedef int16_t Register; | 799 typedef int16_t Register; |
| 790 | 800 |
| 791 const int16_t FPREG = 0; | 801 const int16_t FPREG = 0; |
| 792 const int16_t SPREG = 1; | 802 const int16_t SPREG = 1; |
| 803 #if defined(ARCH_IS_64_BIT) |
| 804 const intptr_t kNumberOfCpuRegisters = 64; |
| 805 #else |
| 793 const intptr_t kNumberOfCpuRegisters = 32; | 806 const intptr_t kNumberOfCpuRegisters = 32; |
| 807 #endif |
| 794 const intptr_t kDartAvailableCpuRegs = -1; | 808 const intptr_t kDartAvailableCpuRegs = -1; |
| 795 const intptr_t kNoRegister = -1; | 809 const intptr_t kNoRegister = -1; |
| 796 const intptr_t kReservedCpuRegisters = 0; | 810 const intptr_t kReservedCpuRegisters = 0; |
| 797 const intptr_t ARGS_DESC_REG = 0; | 811 const intptr_t ARGS_DESC_REG = 0; |
| 798 const intptr_t CODE_REG = 0; | 812 const intptr_t CODE_REG = 0; |
| 799 const intptr_t kExceptionObjectReg = 0; | 813 const intptr_t kExceptionObjectReg = 0; |
| 800 const intptr_t kStackTraceObjectReg = 0; | 814 const intptr_t kStackTraceObjectReg = 0; |
| 801 const intptr_t CTX = 0; | 815 const intptr_t CTX = 0; |
| 802 | 816 |
| 803 enum FpuRegister { | 817 enum FpuRegister { |
| 804 kNoFpuRegister = -1, | 818 kNoFpuRegister = -1, |
| 805 kFakeFpuRegister, | 819 kFakeFpuRegister, |
| 806 kNumberOfDummyFpuRegisters, | 820 kNumberOfDummyFpuRegisters, |
| 807 }; | 821 }; |
| 808 const FpuRegister FpuTMP = kFakeFpuRegister; | 822 const FpuRegister FpuTMP = kFakeFpuRegister; |
| 809 const intptr_t kNumberOfFpuRegisters = 1; | 823 const intptr_t kNumberOfFpuRegisters = 1; |
| 810 | 824 |
| 811 // After a comparison, the condition NEXT_IS_TRUE means the following | 825 // After a comparison, the condition NEXT_IS_TRUE means the following |
| 812 // instruction is executed if the comparision is true and skipped over overwise. | 826 // instruction is executed if the comparision is true and skipped over overwise. |
| 813 // Conidition NEXT_IS_FALSE means the following instruction is executed if the | 827 // Conidition NEXT_IS_FALSE means the following instruction is executed if the |
| 814 // comparison is false and skipped over otherwise. | 828 // comparison is false and skipped over otherwise. |
| 815 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; | 829 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; |
| 816 | 830 |
| 817 } // namespace dart | 831 } // namespace dart |
| 818 | 832 |
| 819 #endif // VM_CONSTANTS_DBC_H_ | 833 #endif // VM_CONSTANTS_DBC_H_ |
| OLD | NEW |