Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: runtime/vm/constants_dbc.h

Issue 2737303003: Allow dispatch to use a range of Class-ids in tests (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 RUNTIME_VM_CONSTANTS_DBC_H_ 5 #ifndef RUNTIME_VM_CONSTANTS_DBC_H_
6 #define RUNTIME_VM_CONSTANTS_DBC_H_ 6 #define RUNTIME_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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // 163 //
164 // Invoke native function SP[-1] with argc_tag SP[0]. 164 // Invoke native function SP[-1] with argc_tag SP[0].
165 // 165 //
166 // - PushPolymorphicInstanceCall ArgC, D 166 // - PushPolymorphicInstanceCall ArgC, D
167 // 167 //
168 // Skips 2*D + 1 instructions and pushes a function object onto the stack 168 // Skips 2*D + 1 instructions and pushes a function object onto the stack
169 // if one can be found as follows. Otherwise skips only 2*D instructions. 169 // if one can be found as follows. Otherwise skips only 2*D instructions.
170 // The function is looked up in the IC data encoded in the following 2*D 170 // The function is looked up in the IC data encoded in the following 2*D
171 // Nop instructions. The Nop instructions should be arranged in pairs with 171 // Nop instructions. The Nop instructions should be arranged in pairs with
172 // the first being the cid, and the second being the function to push if 172 // the first being the cid, and the second being the function to push if
173 // the cid is the cid of the receiver found at SP[-(1 + ArgC)]. 173 // the cid matches the cid in the pair.
174 //
175 // - PushPolymorphic3InstanceCall ArgC, D
Vyacheslav Egorov (Google) 2017/03/10 10:31:30 Better call it PushPolymorphicInstanceCallByRang
erikcorry 2017/03/10 13:30:01 Done.
176 //
177 // Skips 3*D + 1 instructions and pushes a function object onto the stack
178 // if one can be found as follows. Otherwise skips only 3*D instructions.
179 // The function is looked up in the IC data encoded in the following 3*D
180 // Nop instructions. The Nop instructions should be arranged in triples with
181 // the first being the start cid, the second being the number of cids, and
182 // the third being the function to push if the cid is in the range given
183 // by the first two Nop instructions.
174 // 184 //
175 // - OneByteStringFromCharCode rA, rX 185 // - OneByteStringFromCharCode rA, rX
176 // 186 //
177 // Load the one-character symbol with the char code given by the Smi 187 // Load the one-character symbol with the char code given by the Smi
178 // in FP[rX] into FP[rA]. 188 // in FP[rX] into FP[rA].
179 // 189 //
180 // - StringToCharCode rA, rX 190 // - StringToCharCode rA, rX
181 // 191 //
182 // Load and smi-encode the single char code of the string in FP[rX] into 192 // Load and smi-encode the single char code of the string in FP[rX] into
183 // FP[rA]. If the string's length is not 1, load smi -1 instead. 193 // FP[rA]. If the string's length is not 1, load smi -1 instead.
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // a dense switch with low cid encoded in the following Nop instruction, and 593 // a dense switch with low cid encoded in the following Nop instruction, and
584 // the cid mask encoded in the Nop instruction after that, or if D == 1 and 594 // the cid mask encoded in the Nop instruction after that, or if D == 1 and
585 // FP[rA] is a Smi. Skips 2 instructions otherwise. 595 // FP[rA] is a Smi. Skips 2 instructions otherwise.
586 // 596 //
587 // - CheckCids rA, rB, rC 597 // - CheckCids rA, rB, rC
588 // 598 //
589 // Skips rC + 1 instructions if the object at FP[rA] is a Smi and 599 // Skips rC + 1 instructions if the object at FP[rA] is a Smi and
590 // rB == 1, or if FP[rA]'s cid is found in the array of cids encoded by the 600 // rB == 1, or if FP[rA]'s cid is found in the array of cids encoded by the
591 // following rC Nop instructions. Otherwise skips only rC instructions. 601 // following rC Nop instructions. Otherwise skips only rC instructions.
592 // 602 //
603 // - CheckCids2 rA, rB, rC
Vyacheslav Egorov (Google) 2017/03/10 10:31:30 Better call it CheckCidRanges
erikcorry 2017/03/10 13:30:01 Done.
604 //
605 // Skips rC + 1 instructions if the object at FP[rA] is a Smi and rB ==
606 // 1, or if FP[rA]'s cid is found in the array of cid ranges encoded by the
607 // following rC Nop instructions. The cid ranges from a inclusive to b
608 // exclusive are coded in pairs of (a, b - a). Otherwise skips only 2
609 // instructions.
610 //
593 // - CheckStack 611 // - CheckStack
594 // 612 //
595 // Compare SP against isolate stack limit and call StackOverflow handler if 613 // Compare SP against isolate stack limit and call StackOverflow handler if
596 // necessary. 614 // necessary.
597 // 615 //
598 // - DebugStep, DebugBreak A 616 // - DebugStep, DebugBreak A
599 // 617 //
600 // Debugger support. DebugBreak is bytecode that can be patched into the 618 // Debugger support. DebugBreak is bytecode that can be patched into the
601 // instruction stream to trigger in place breakpoint. 619 // instruction stream to trigger in place breakpoint.
602 // 620 //
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 V(PushConstant, D, lit, ___, ___) \ 689 V(PushConstant, D, lit, ___, ___) \
672 V(StoreLocal, X, xeg, ___, ___) \ 690 V(StoreLocal, X, xeg, ___, ___) \
673 V(PopLocal, X, xeg, ___, ___) \ 691 V(PopLocal, X, xeg, ___, ___) \
674 V(IndirectStaticCall, A_D, num, num, ___) \ 692 V(IndirectStaticCall, A_D, num, num, ___) \
675 V(StaticCall, A_D, num, num, ___) \ 693 V(StaticCall, A_D, num, num, ___) \
676 V(InstanceCall1, A_D, num, num, ___) \ 694 V(InstanceCall1, A_D, num, num, ___) \
677 V(InstanceCall2, A_D, num, num, ___) \ 695 V(InstanceCall2, A_D, num, num, ___) \
678 V(InstanceCall1Opt, A_D, num, num, ___) \ 696 V(InstanceCall1Opt, A_D, num, num, ___) \
679 V(InstanceCall2Opt, A_D, num, num, ___) \ 697 V(InstanceCall2Opt, A_D, num, num, ___) \
680 V(PushPolymorphicInstanceCall, A_D, num, num, ___) \ 698 V(PushPolymorphicInstanceCall, A_D, num, num, ___) \
699 V(PushPolymorphic3InstanceCall, A_D, num, num, ___) \
681 V(NativeCall, 0, ___, ___, ___) \ 700 V(NativeCall, 0, ___, ___, ___) \
682 V(NativeBootstrapCall, 0, ___, ___, ___) \ 701 V(NativeBootstrapCall, 0, ___, ___, ___) \
683 V(OneByteStringFromCharCode, A_X, reg, xeg, ___) \ 702 V(OneByteStringFromCharCode, A_X, reg, xeg, ___) \
684 V(StringToCharCode, A_X, reg, xeg, ___) \ 703 V(StringToCharCode, A_X, reg, xeg, ___) \
685 V(AddTOS, 0, ___, ___, ___) \ 704 V(AddTOS, 0, ___, ___, ___) \
686 V(SubTOS, 0, ___, ___, ___) \ 705 V(SubTOS, 0, ___, ___, ___) \
687 V(MulTOS, 0, ___, ___, ___) \ 706 V(MulTOS, 0, ___, ___, ___) \
688 V(BitOrTOS, 0, ___, ___, ___) \ 707 V(BitOrTOS, 0, ___, ___, ___) \
689 V(BitAndTOS, 0, ___, ___, ___) \ 708 V(BitAndTOS, 0, ___, ___, ___) \
690 V(EqualTOS, 0, ___, ___, ___) \ 709 V(EqualTOS, 0, ___, ___, ___) \
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 V(BadTypeError, 0, ___, ___, ___) \ 832 V(BadTypeError, 0, ___, ___, ___) \
814 V(AssertAssignable, A_D, num, lit, ___) \ 833 V(AssertAssignable, A_D, num, lit, ___) \
815 V(AssertBoolean, A, num, ___, ___) \ 834 V(AssertBoolean, A, num, ___, ___) \
816 V(TestSmi, A_D, reg, reg, ___) \ 835 V(TestSmi, A_D, reg, reg, ___) \
817 V(TestCids, A_D, reg, num, ___) \ 836 V(TestCids, A_D, reg, num, ___) \
818 V(CheckSmi, A, reg, ___, ___) \ 837 V(CheckSmi, A, reg, ___, ___) \
819 V(CheckEitherNonSmi, A_D, reg, reg, ___) \ 838 V(CheckEitherNonSmi, A_D, reg, reg, ___) \
820 V(CheckClassId, A_D, reg, num, ___) \ 839 V(CheckClassId, A_D, reg, num, ___) \
821 V(CheckDenseSwitch, A_D, reg, num, ___) \ 840 V(CheckDenseSwitch, A_D, reg, num, ___) \
822 V(CheckCids, A_B_C, reg, num, num) \ 841 V(CheckCids, A_B_C, reg, num, num) \
842 V(CheckCids2, A_B_C, reg, num, num) \
823 V(CheckStack, 0, ___, ___, ___) \ 843 V(CheckStack, 0, ___, ___, ___) \
824 V(CheckStackAlwaysExit, 0, ___, ___, ___) \ 844 V(CheckStackAlwaysExit, 0, ___, ___, ___) \
825 V(DebugStep, 0, ___, ___, ___) \ 845 V(DebugStep, 0, ___, ___, ___) \
826 V(DebugBreak, A, num, ___, ___) \ 846 V(DebugBreak, A, num, ___, ___) \
827 V(Deopt, A_D, num, num, ___) \ 847 V(Deopt, A_D, num, num, ___) \
828 V(DeoptRewind, 0, ___, ___, ___) 848 V(DeoptRewind, 0, ___, ___, ___)
829 849
830 // clang-format on 850 // clang-format on
831 851
832 typedef uint32_t Instr; 852 typedef uint32_t Instr;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 983
964 // After a comparison, the condition NEXT_IS_TRUE means the following 984 // After a comparison, the condition NEXT_IS_TRUE means the following
965 // instruction is executed if the comparision is true and skipped over overwise. 985 // instruction is executed if the comparision is true and skipped over overwise.
966 // Conidition NEXT_IS_FALSE means the following instruction is executed if the 986 // Conidition NEXT_IS_FALSE means the following instruction is executed if the
967 // comparison is false and skipped over otherwise. 987 // comparison is false and skipped over otherwise.
968 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE }; 988 enum Condition { NEXT_IS_TRUE, NEXT_IS_FALSE };
969 989
970 } // namespace dart 990 } // namespace dart
971 991
972 #endif // RUNTIME_VM_CONSTANTS_DBC_H_ 992 #endif // RUNTIME_VM_CONSTANTS_DBC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698