| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // instruction (which implements a slow path fallback). | 190 // instruction (which implements a slow path fallback). |
| 191 // | 191 // |
| 192 // - Add, Sub, Mul, Div, Mod, Shl, Shr rA, rB, rC | 192 // - Add, Sub, Mul, Div, Mod, Shl, Shr rA, rB, rC |
| 193 // | 193 // |
| 194 // Arithmetic operations on Smis. FP[rA] <- FP[rB] op FP[rC]. | 194 // Arithmetic operations on Smis. FP[rA] <- FP[rB] op FP[rC]. |
| 195 // If these instructions can trigger a deoptimization, the following | 195 // If these instructions can trigger a deoptimization, the following |
| 196 // instruction should be Deopt. If no deoptimization should be triggered, | 196 // instruction should be Deopt. If no deoptimization should be triggered, |
| 197 // the immediately following instruction is skipped. These instructions | 197 // the immediately following instruction is skipped. These instructions |
| 198 // expect their operands to be Smis, but don't check that they are. | 198 // expect their operands to be Smis, but don't check that they are. |
| 199 // | 199 // |
| 200 // - ShrImm rA, rB, rC | 200 // - ShlImm rA, rB, rC |
| 201 // | 201 // |
| 202 // FP[rA] <- FP[rB] >> rC. Shifts the Smi in FP[rB] right by rC. rC is | 202 // FP[rA] <- FP[rB] << rC. Shifts the Smi in FP[rB] left by rC. rC is |
| 203 // assumed to be a legal positive number by which righ-shifting is possible. | 203 // assumed to be a legal positive number by which left-shifting is possible. |
| 204 // | 204 // |
| 205 // - Min, Max rA, rB, rC | 205 // - Min, Max rA, rB, rC |
| 206 // | 206 // |
| 207 // FP[rA] <- {min, max}(FP[rB], FP[rC]). Assumes that FP[rB], and FP[rC] are | 207 // FP[rA] <- {min, max}(FP[rB], FP[rC]). Assumes that FP[rB], and FP[rC] are |
| 208 // Smis. | 208 // Smis. |
| 209 // | 209 // |
| 210 // - Neg rA , rD | 210 // - Neg rA , rD |
| 211 // | 211 // |
| 212 // FP[rA] <- -FP[rD]. Assumes FP[rD] is a Smi. If there is no overflow the | 212 // FP[rA] <- -FP[rD]. Assumes FP[rD] is a Smi. If there is no overflow the |
| 213 // immediately following instruction is skipped. | 213 // immediately following instruction is skipped. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 236 // - UnboxDouble rA, rD | 236 // - UnboxDouble rA, rD |
| 237 // | 237 // |
| 238 // Unbox the double in FP[rD] into FP[rA]. Assumes FP[rD] is a double. | 238 // Unbox the double in FP[rD] into FP[rA]. Assumes FP[rD] is a double. |
| 239 // | 239 // |
| 240 // - CheckedUnboxDouble rA, rD | 240 // - CheckedUnboxDouble rA, rD |
| 241 // | 241 // |
| 242 // Unboxes FP[rD] into FP[rA] and skips the following instruction unless | 242 // Unboxes FP[rD] into FP[rA] and skips the following instruction unless |
| 243 // FP[rD] is not a double or a Smi. When FP[rD] is a Smi, converts it to a | 243 // FP[rD] is not a double or a Smi. When FP[rD] is a Smi, converts it to a |
| 244 // double. | 244 // double. |
| 245 // | 245 // |
| 246 // - UnboxInt32 rA, rB, C |
| 247 // |
| 248 // Unboxes the integer in FP[rB] into FP[rA]. If C == 1, the value may be |
| 249 // truncated. If FP[rA] is successfully unboxed the following instruction is |
| 250 // skipped. |
| 251 // |
| 252 // - BoxInt32 rA, rD |
| 253 // |
| 254 // Boxes the unboxed signed 32-bit integer in FP[rD] into FP[rA]. |
| 255 // |
| 256 // - BoxUint32 rA, rD |
| 257 // |
| 258 // Boxes the unboxed unsigned 32-bit integer in FP[rD] into FP[rA]. |
| 259 // |
| 246 // - SmiToDouble rA, rD | 260 // - SmiToDouble rA, rD |
| 247 // | 261 // |
| 248 // Convert the Smi in FP[rD] to an unboxed double in FP[rA]. | 262 // Convert the Smi in FP[rD] to an unboxed double in FP[rA]. |
| 249 // | 263 // |
| 250 // - DoubleToSmi rA, rD | 264 // - DoubleToSmi rA, rD |
| 251 // | 265 // |
| 252 // If the unboxed double in FP[rD] can be converted to a Smi in FP[rA], then | 266 // If the unboxed double in FP[rD] can be converted to a Smi in FP[rA], then |
| 253 // this instruction does so, and skips the following instruction. Otherwise, | 267 // this instruction does so, and skips the following instruction. Otherwise, |
| 254 // the following instruction is not skipped. | 268 // the following instruction is not skipped. |
| 255 // | 269 // |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 V(EqualTOS, 0, ___, ___, ___) \ | 614 V(EqualTOS, 0, ___, ___, ___) \ |
| 601 V(LessThanTOS, 0, ___, ___, ___) \ | 615 V(LessThanTOS, 0, ___, ___, ___) \ |
| 602 V(GreaterThanTOS, 0, ___, ___, ___) \ | 616 V(GreaterThanTOS, 0, ___, ___, ___) \ |
| 603 V(Add, A_B_C, reg, reg, reg) \ | 617 V(Add, A_B_C, reg, reg, reg) \ |
| 604 V(Sub, A_B_C, reg, reg, reg) \ | 618 V(Sub, A_B_C, reg, reg, reg) \ |
| 605 V(Mul, A_B_C, reg, reg, reg) \ | 619 V(Mul, A_B_C, reg, reg, reg) \ |
| 606 V(Div, A_B_C, reg, reg, reg) \ | 620 V(Div, A_B_C, reg, reg, reg) \ |
| 607 V(Mod, A_B_C, reg, reg, reg) \ | 621 V(Mod, A_B_C, reg, reg, reg) \ |
| 608 V(Shl, A_B_C, reg, reg, reg) \ | 622 V(Shl, A_B_C, reg, reg, reg) \ |
| 609 V(Shr, A_B_C, reg, reg, reg) \ | 623 V(Shr, A_B_C, reg, reg, reg) \ |
| 610 V(ShrImm, A_B_C, reg, reg, num) \ | 624 V(ShlImm, A_B_C, reg, reg, num) \ |
| 611 V(Neg, A_D, reg, reg, ___) \ | 625 V(Neg, A_D, reg, reg, ___) \ |
| 612 V(BitOr, A_B_C, reg, reg, reg) \ | 626 V(BitOr, A_B_C, reg, reg, reg) \ |
| 613 V(BitAnd, A_B_C, reg, reg, reg) \ | 627 V(BitAnd, A_B_C, reg, reg, reg) \ |
| 614 V(BitXor, A_B_C, reg, reg, reg) \ | 628 V(BitXor, A_B_C, reg, reg, reg) \ |
| 615 V(BitNot, A_D, reg, reg, ___) \ | 629 V(BitNot, A_D, reg, reg, ___) \ |
| 616 V(Min, A_B_C, reg, reg, reg) \ | 630 V(Min, A_B_C, reg, reg, reg) \ |
| 617 V(Max, A_B_C, reg, reg, reg) \ | 631 V(Max, A_B_C, reg, reg, reg) \ |
| 618 V(WriteIntoDouble, A_D, reg, reg, ___) \ | 632 V(WriteIntoDouble, A_D, reg, reg, ___) \ |
| 619 V(UnboxDouble, A_D, reg, reg, ___) \ | 633 V(UnboxDouble, A_D, reg, reg, ___) \ |
| 620 V(CheckedUnboxDouble, A_D, reg, reg, ___) \ | 634 V(CheckedUnboxDouble, A_D, reg, reg, ___) \ |
| 635 V(UnboxInt32, A_B_C, reg, reg, num) \ |
| 636 V(BoxInt32, A_D, reg, reg, ___) \ |
| 637 V(BoxUint32, A_D, reg, reg, ___) \ |
| 621 V(SmiToDouble, A_D, reg, reg, ___) \ | 638 V(SmiToDouble, A_D, reg, reg, ___) \ |
| 622 V(DoubleToSmi, A_D, reg, reg, ___) \ | 639 V(DoubleToSmi, A_D, reg, reg, ___) \ |
| 623 V(DAdd, A_B_C, reg, reg, reg) \ | 640 V(DAdd, A_B_C, reg, reg, reg) \ |
| 624 V(DSub, A_B_C, reg, reg, reg) \ | 641 V(DSub, A_B_C, reg, reg, reg) \ |
| 625 V(DMul, A_B_C, reg, reg, reg) \ | 642 V(DMul, A_B_C, reg, reg, reg) \ |
| 626 V(DDiv, A_B_C, reg, reg, reg) \ | 643 V(DDiv, A_B_C, reg, reg, reg) \ |
| 627 V(DNeg, A_D, reg, reg, ___) \ | 644 V(DNeg, A_D, reg, reg, ___) \ |
| 628 V(DSqrt, A_D, reg, reg, ___) \ | 645 V(DSqrt, A_D, reg, reg, ___) \ |
| 629 V(DMin, A_B_C, reg, reg, reg) \ | 646 V(DMin, A_B_C, reg, reg, reg) \ |
| 630 V(DMax, A_B_C, reg, reg, reg) \ | 647 V(DMax, A_B_C, reg, reg, reg) \ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 659 V(IfEqStrictNum, A_D, reg, reg, ___) \ | 676 V(IfEqStrictNum, A_D, reg, reg, ___) \ |
| 660 V(IfEqNull, A, reg, ___, ___) \ | 677 V(IfEqNull, A, reg, ___, ___) \ |
| 661 V(IfNeNull, A, reg, ___, ___) \ | 678 V(IfNeNull, A, reg, ___, ___) \ |
| 662 V(CreateArrayTOS, 0, ___, ___, ___) \ | 679 V(CreateArrayTOS, 0, ___, ___, ___) \ |
| 663 V(Allocate, D, lit, ___, ___) \ | 680 V(Allocate, D, lit, ___, ___) \ |
| 664 V(AllocateT, 0, ___, ___, ___) \ | 681 V(AllocateT, 0, ___, ___, ___) \ |
| 665 V(StoreIndexedTOS, 0, ___, ___, ___) \ | 682 V(StoreIndexedTOS, 0, ___, ___, ___) \ |
| 666 V(StoreIndexed, A_B_C, reg, reg, reg) \ | 683 V(StoreIndexed, A_B_C, reg, reg, reg) \ |
| 667 V(StoreIndexedUint8, A_B_C, reg, reg, reg) \ | 684 V(StoreIndexedUint8, A_B_C, reg, reg, reg) \ |
| 668 V(StoreIndexedExternalUint8, A_B_C, reg, reg, reg) \ | 685 V(StoreIndexedExternalUint8, A_B_C, reg, reg, reg) \ |
| 686 V(StoreIndexedUint32, A_B_C, reg, reg, reg) \ |
| 669 V(StoreIndexedFloat64, A_B_C, reg, reg, reg) \ | 687 V(StoreIndexedFloat64, A_B_C, reg, reg, reg) \ |
| 670 V(LoadIndexed, A_B_C, reg, reg, reg) \ | 688 V(LoadIndexed, A_B_C, reg, reg, reg) \ |
| 671 V(LoadIndexedUint8, A_B_C, reg, reg, reg) \ | 689 V(LoadIndexedUint8, A_B_C, reg, reg, reg) \ |
| 672 V(LoadIndexedInt8, A_B_C, reg, reg, reg) \ | 690 V(LoadIndexedInt8, A_B_C, reg, reg, reg) \ |
| 691 V(LoadIndexedInt32, A_B_C, reg, reg, reg) \ |
| 692 V(LoadIndexedUint32, A_B_C, reg, reg, reg) \ |
| 673 V(LoadIndexedExternalUint8, A_B_C, reg, reg, reg) \ | 693 V(LoadIndexedExternalUint8, A_B_C, reg, reg, reg) \ |
| 674 V(LoadIndexedExternalInt8, A_B_C, reg, reg, reg) \ | 694 V(LoadIndexedExternalInt8, A_B_C, reg, reg, reg) \ |
| 675 V(LoadIndexedFloat64, A_B_C, reg, reg, reg) \ | 695 V(LoadIndexedFloat64, A_B_C, reg, reg, reg) \ |
| 676 V(LoadIndexedOneByteString, A_B_C, reg, reg, reg) \ | 696 V(LoadIndexedOneByteString, A_B_C, reg, reg, reg) \ |
| 677 V(LoadIndexedTwoByteString, A_B_C, reg, reg, reg) \ | 697 V(LoadIndexedTwoByteString, A_B_C, reg, reg, reg) \ |
| 678 V(StoreField, A_B_C, reg, num, reg) \ | 698 V(StoreField, A_B_C, reg, num, reg) \ |
| 679 V(StoreFieldTOS, D, num, ___, ___) \ | 699 V(StoreFieldTOS, D, num, ___, ___) \ |
| 680 V(LoadField, A_B_C, reg, reg, num) \ | 700 V(LoadField, A_B_C, reg, reg, num) \ |
| 681 V(LoadUntagged, A_B_C, reg, reg, num) \ | 701 V(LoadUntagged, A_B_C, reg, reg, num) \ |
| 682 V(LoadFieldTOS, D, num, ___, ___) \ | 702 V(LoadFieldTOS, D, num, ___, ___) \ |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 | 864 |
| 845 // After a comparison, the condition NEXT_IS_TRUE means the following | 865 // After a comparison, the condition NEXT_IS_TRUE means the following |
| 846 // instruction is executed if the comparision is true and skipped over overwise. | 866 // instruction is executed if the comparision is true and skipped over overwise. |
| 847 // Conidition NEXT_IS_FALSE means the following instruction is executed if the | 867 // Conidition NEXT_IS_FALSE means the following instruction is executed if the |
| 848 // comparison is false and skipped over otherwise. | 868 // comparison is false and skipped over otherwise. |
| 849 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; | 869 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; |
| 850 | 870 |
| 851 } // namespace dart | 871 } // namespace dart |
| 852 | 872 |
| 853 #endif // VM_CONSTANTS_DBC_H_ | 873 #endif // VM_CONSTANTS_DBC_H_ |
| OLD | NEW |