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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // | 141 // |
142 // - StoreLocal rX; PopLocal rX | 142 // - StoreLocal rX; PopLocal rX |
143 // | 143 // |
144 // Store top of the stack into FP[rX] and pop it if needed. | 144 // Store top of the stack into FP[rX] and pop it if needed. |
145 // | 145 // |
146 // - StaticCall ArgC, D | 146 // - StaticCall ArgC, D |
147 // | 147 // |
148 // Invoke function in SP[0] with arguments SP[-(1+ArgC)], ..., SP[-1] and | 148 // Invoke function in SP[0] with arguments SP[-(1+ArgC)], ..., SP[-1] and |
149 // argument descriptor PP[D]. | 149 // argument descriptor PP[D]. |
150 // | 150 // |
| 151 // - IndirectStaticCall ArgC, D |
| 152 // |
| 153 // Invoke the function given by the ICData in SP[0] with arguments |
| 154 // SP[-(1+ArgC)], ..., SP[-1] and argument descriptor PP[D]. |
| 155 // |
151 // - InstanceCall<N> ArgC, D; InstanceCall<N>Opt ArgC, D | 156 // - InstanceCall<N> ArgC, D; InstanceCall<N>Opt ArgC, D |
152 // | 157 // |
153 // 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] |
154 // with arguments SP[-(1+ArgC)], ..., SP[-1]. | 159 // with arguments SP[-(1+ArgC)], ..., SP[-1]. |
155 // | 160 // |
156 // - NativeCall, NativeBootstrapCall | 161 // - NativeCall, NativeBootstrapCall |
157 // | 162 // |
158 // Invoke native function SP[-1] with argc_tag SP[0]. | 163 // Invoke native function SP[-1] with argc_tag SP[0]. |
159 // | 164 // |
160 // - OneByteStringFromCharCode rA, rX | 165 // - OneByteStringFromCharCode rA, rX |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 V(ReturnTOS, 0, ___, ___, ___) \ | 526 V(ReturnTOS, 0, ___, ___, ___) \ |
522 V(Move, A_X, reg, xeg, ___) \ | 527 V(Move, A_X, reg, xeg, ___) \ |
523 V(Swap, A_X, reg, xeg, ___) \ | 528 V(Swap, A_X, reg, xeg, ___) \ |
524 V(Push, X, xeg, ___, ___) \ | 529 V(Push, X, xeg, ___, ___) \ |
525 V(LoadConstant, A_D, reg, lit, ___) \ | 530 V(LoadConstant, A_D, reg, lit, ___) \ |
526 V(LoadClassId, A_D, reg, reg, ___) \ | 531 V(LoadClassId, A_D, reg, reg, ___) \ |
527 V(LoadClassIdTOS, 0, ___, ___, ___) \ | 532 V(LoadClassIdTOS, 0, ___, ___, ___) \ |
528 V(PushConstant, D, lit, ___, ___) \ | 533 V(PushConstant, D, lit, ___, ___) \ |
529 V(StoreLocal, X, xeg, ___, ___) \ | 534 V(StoreLocal, X, xeg, ___, ___) \ |
530 V(PopLocal, X, xeg, ___, ___) \ | 535 V(PopLocal, X, xeg, ___, ___) \ |
| 536 V(IndirectStaticCall, A_D, num, num, ___) \ |
531 V(StaticCall, A_D, num, num, ___) \ | 537 V(StaticCall, A_D, num, num, ___) \ |
532 V(InstanceCall1, A_D, num, num, ___) \ | 538 V(InstanceCall1, A_D, num, num, ___) \ |
533 V(InstanceCall2, A_D, num, num, ___) \ | 539 V(InstanceCall2, A_D, num, num, ___) \ |
534 V(InstanceCall1Opt, A_D, num, num, ___) \ | 540 V(InstanceCall1Opt, A_D, num, num, ___) \ |
535 V(InstanceCall2Opt, A_D, num, num, ___) \ | 541 V(InstanceCall2Opt, A_D, num, num, ___) \ |
536 V(NativeCall, 0, ___, ___, ___) \ | 542 V(NativeCall, 0, ___, ___, ___) \ |
537 V(NativeBootstrapCall, 0, ___, ___, ___) \ | 543 V(NativeBootstrapCall, 0, ___, ___, ___) \ |
538 V(OneByteStringFromCharCode, A_X, reg, xeg, ___) \ | 544 V(OneByteStringFromCharCode, A_X, reg, xeg, ___) \ |
539 V(StringToCharCode, A_X, reg, xeg, ___) \ | 545 V(StringToCharCode, A_X, reg, xeg, ___) \ |
540 V(AddTOS, 0, ___, ___, ___) \ | 546 V(AddTOS, 0, ___, ___, ___) \ |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 return (bc >> kDShift) & kDMask; | 693 return (bc >> kDShift) & kDMask; |
688 } | 694 } |
689 | 695 |
690 DART_FORCE_INLINE static Opcode DecodeOpcode(Instr bc) { | 696 DART_FORCE_INLINE static Opcode DecodeOpcode(Instr bc) { |
691 return static_cast<Opcode>(bc & 0xFF); | 697 return static_cast<Opcode>(bc & 0xFF); |
692 } | 698 } |
693 | 699 |
694 DART_FORCE_INLINE static bool IsCallOpcode(Instr instr) { | 700 DART_FORCE_INLINE static bool IsCallOpcode(Instr instr) { |
695 switch (DecodeOpcode(instr)) { | 701 switch (DecodeOpcode(instr)) { |
696 case Bytecode::kStaticCall: | 702 case Bytecode::kStaticCall: |
| 703 case Bytecode::kIndirectStaticCall: |
697 case Bytecode::kInstanceCall1: | 704 case Bytecode::kInstanceCall1: |
698 case Bytecode::kInstanceCall2: | 705 case Bytecode::kInstanceCall2: |
699 case Bytecode::kInstanceCall1Opt: | 706 case Bytecode::kInstanceCall1Opt: |
700 case Bytecode::kInstanceCall2Opt: | 707 case Bytecode::kInstanceCall2Opt: |
701 case Bytecode::kDebugBreak: | 708 case Bytecode::kDebugBreak: |
702 return true; | 709 return true; |
703 | 710 |
704 default: | 711 default: |
705 return false; | 712 return false; |
706 } | 713 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 752 |
746 // After a comparison, the condition NEXT_IS_TRUE means the following | 753 // After a comparison, the condition NEXT_IS_TRUE means the following |
747 // instruction is executed if the comparision is true and skipped over overwise. | 754 // instruction is executed if the comparision is true and skipped over overwise. |
748 // Conidition NEXT_IS_FALSE means the following instruction is executed if the | 755 // Conidition NEXT_IS_FALSE means the following instruction is executed if the |
749 // comparison is false and skipped over otherwise. | 756 // comparison is false and skipped over otherwise. |
750 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; | 757 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; |
751 | 758 |
752 } // namespace dart | 759 } // namespace dart |
753 | 760 |
754 #endif // VM_CONSTANTS_DBC_H_ | 761 #endif // VM_CONSTANTS_DBC_H_ |
OLD | NEW |