Line data Source code
1 : #ifndef V8_TORQUE_TEST_FROM_DSL_BASE_H__
2 : #define V8_TORQUE_TEST_FROM_DSL_BASE_H__
3 :
4 : #include "src/compiler/code-assembler.h"
5 : #include "src/code-stub-assembler.h"
6 :
7 : namespace v8 {
8 : namespace internal {
9 :
10 830 : class TestBuiltinsFromDSLAssembler {
11 : public:
12 830 : explicit TestBuiltinsFromDSLAssembler(compiler::CodeAssemblerState* state) : state_(state), ca_(state) { USE(state_, ca_); }
13 : compiler::TNode<BoolT> ElementsKindTestHelper1(ElementsKind p_kind);
14 : compiler::TNode<BoolT> ElementsKindTestHelper2(ElementsKind p_kind);
15 : bool ElementsKindTestHelper3(ElementsKind p_kind);
16 : void LabelTestHelper1(compiler::CodeAssemblerLabel* label_Label1);
17 : void LabelTestHelper2(compiler::CodeAssemblerLabel* label_Label2, compiler::TypedCodeAssemblerVariable<Smi>* label_Label2_parameter_0);
18 : void LabelTestHelper3(compiler::CodeAssemblerLabel* label_Label3, compiler::TypedCodeAssemblerVariable<String>* label_Label3_parameter_0, compiler::TypedCodeAssemblerVariable<Smi>* label_Label3_parameter_1);
19 : void TestConstexpr1();
20 : void TestConstexprIf();
21 : void TestConstexprReturn();
22 : compiler::TNode<Oddball> TestGotoLabel();
23 : compiler::TNode<Oddball> TestGotoLabelWithOneParameter();
24 : compiler::TNode<Oddball> TestGotoLabelWithTwoParameters();
25 : void TestBuiltinSpecialization(compiler::TNode<Context> p_c);
26 : void LabelTestHelper4(bool p_flag, compiler::CodeAssemblerLabel* label_Label4, compiler::CodeAssemblerLabel* label_Label5);
27 : compiler::TNode<BoolT> CallLabelTestHelper4(bool p_flag);
28 : compiler::TNode<Oddball> TestPartiallyUnusedLabel();
29 : compiler::TNode<Object> GenericMacroTest20UT5ATSmi10HeapObject(compiler::TNode<Object> p_param2);
30 : compiler::TNode<Object> GenericMacroTestWithLabels20UT5ATSmi10HeapObject(compiler::TNode<Object> p_param2, compiler::CodeAssemblerLabel* label_Y);
31 : void TestMacroSpecialization();
32 : compiler::TNode<Oddball> TestFunctionPointers(compiler::TNode<Context> p_context);
33 : compiler::TNode<Oddball> TestVariableRedeclaration(compiler::TNode<Context> p_context);
34 : compiler::TNode<Smi> TestTernaryOperator(compiler::TNode<Smi> p_x);
35 : void TestFunctionPointerToGeneric(compiler::TNode<Context> p_c);
36 : compiler::TNode<BuiltinPtr> TestTypeAlias(compiler::TNode<BuiltinPtr> p_x);
37 : compiler::TNode<Oddball> TestUnsafeCast(compiler::TNode<Context> p_context, compiler::TNode<Number> p_n);
38 : void TestHexLiteral();
39 : void TestLargeIntegerLiterals(compiler::TNode<Context> p_c);
40 : void TestMultilineAssert();
41 : void TestNewlineInString();
42 : int31_t kConstexprConst();
43 : compiler::TNode<IntPtrT> kIntptrConst();
44 : compiler::TNode<Smi> kSmiConst();
45 : void TestModuleConstBindings();
46 : void TestLocalConstBindings();
47 : struct TestStructA {
48 : compiler::TNode<FixedArray> indexes;
49 : compiler::TNode<Smi> i;
50 : compiler::TNode<Number> k;
51 :
52 : std::tuple<compiler::TNode<FixedArray>, compiler::TNode<Smi>, compiler::TNode<Number>> Flatten() const {
53 : return std::tuple_cat(std::make_tuple(indexes), std::make_tuple(i), std::make_tuple(k));
54 : }
55 : };
56 : struct TestStructB {
57 : TestBuiltinsFromDSLAssembler::TestStructA x;
58 : compiler::TNode<Smi> y;
59 :
60 : std::tuple<compiler::TNode<FixedArray>, compiler::TNode<Smi>, compiler::TNode<Number>, compiler::TNode<Smi>> Flatten() const {
61 : return std::tuple_cat(x.Flatten(), std::make_tuple(y));
62 : }
63 : };
64 : compiler::TNode<Smi> TestStruct1(TestBuiltinsFromDSLAssembler::TestStructA p_i);
65 : TestBuiltinsFromDSLAssembler::TestStructA TestStruct2(compiler::TNode<Context> p_context);
66 : TestBuiltinsFromDSLAssembler::TestStructA TestStruct3(compiler::TNode<Context> p_context);
67 : struct TestStructC {
68 : TestBuiltinsFromDSLAssembler::TestStructA x;
69 : TestBuiltinsFromDSLAssembler::TestStructA y;
70 :
71 : std::tuple<compiler::TNode<FixedArray>, compiler::TNode<Smi>, compiler::TNode<Number>, compiler::TNode<FixedArray>, compiler::TNode<Smi>, compiler::TNode<Number>> Flatten() const {
72 : return std::tuple_cat(x.Flatten(), y.Flatten());
73 : }
74 : };
75 : TestBuiltinsFromDSLAssembler::TestStructC TestStruct4(compiler::TNode<Context> p_context);
76 : void CallTestStructInLabel(compiler::TNode<Context> p_context);
77 : void TestForLoop();
78 : void TestSubtyping(compiler::TNode<Smi> p_x);
79 : compiler::TNode<Int32T> TypeswitchExample(compiler::TNode<Context> p_context, compiler::TNode<Object> p_x);
80 : void TestTypeswitch(compiler::TNode<Context> p_context);
81 : void TestTypeswitchAsanLsanFailure(compiler::TNode<Context> p_context, compiler::TNode<Object> p_obj);
82 : void TestGenericOverload(compiler::TNode<Context> p_context);
83 : void BoolToBranch(compiler::TNode<BoolT> p_x, compiler::CodeAssemblerLabel* label_Taken, compiler::CodeAssemblerLabel* label_NotTaken);
84 : compiler::TNode<BoolT> TestOrAnd1(compiler::TNode<BoolT> p_x, compiler::TNode<BoolT> p_y, compiler::TNode<BoolT> p_z);
85 : compiler::TNode<BoolT> TestOrAnd2(compiler::TNode<BoolT> p_x, compiler::TNode<BoolT> p_y, compiler::TNode<BoolT> p_z);
86 : compiler::TNode<BoolT> TestOrAnd3(compiler::TNode<BoolT> p_x, compiler::TNode<BoolT> p_y, compiler::TNode<BoolT> p_z);
87 : compiler::TNode<BoolT> TestAndOr1(compiler::TNode<BoolT> p_x, compiler::TNode<BoolT> p_y, compiler::TNode<BoolT> p_z);
88 : compiler::TNode<BoolT> TestAndOr2(compiler::TNode<BoolT> p_x, compiler::TNode<BoolT> p_y, compiler::TNode<BoolT> p_z);
89 : compiler::TNode<BoolT> TestAndOr3(compiler::TNode<BoolT> p_x, compiler::TNode<BoolT> p_y, compiler::TNode<BoolT> p_z);
90 : void TestLogicalOperators();
91 : compiler::TNode<Smi> TestCall(compiler::TNode<Smi> p_i, compiler::CodeAssemblerLabel* label_A);
92 : void TestOtherwiseWithCode1();
93 : void TestOtherwiseWithCode2();
94 : void TestOtherwiseWithCode3();
95 : void TestForwardLabel();
96 : void TestQualifiedAccess(compiler::TNode<Context> p_context);
97 : compiler::TNode<Smi> TestCatch1(compiler::TNode<Context> p_context);
98 : void TestCatch2Wrapper(compiler::TNode<Context> p_context);
99 : compiler::TNode<Smi> TestCatch2(compiler::TNode<Context> p_context);
100 : void TestCatch3WrapperWithLabel(compiler::TNode<Context> p_context, compiler::CodeAssemblerLabel* label_Abort);
101 : compiler::TNode<Smi> TestCatch3(compiler::TNode<Context> p_context);
102 : void TestIterator(compiler::TNode<Context> p_context, compiler::TNode<Object> p_o, compiler::TNode<Map> p_map);
103 : void TestFrame1(compiler::TNode<Context> p_context);
104 : void TestNew(compiler::TNode<Context> p_context);
105 : struct TestInner {
106 : compiler::TNode<Int32T> x;
107 : compiler::TNode<Int32T> y;
108 :
109 : std::tuple<compiler::TNode<Int32T>, compiler::TNode<Int32T>> Flatten() const {
110 : return std::tuple_cat(std::make_tuple(x), std::make_tuple(y));
111 : }
112 : };
113 : struct TestOuter {
114 : compiler::TNode<Int32T> a;
115 : TestBuiltinsFromDSLAssembler::TestInner b;
116 : compiler::TNode<Int32T> c;
117 :
118 : std::tuple<compiler::TNode<Int32T>, compiler::TNode<Int32T>, compiler::TNode<Int32T>, compiler::TNode<Int32T>> Flatten() const {
119 : return std::tuple_cat(std::make_tuple(a), b.Flatten(), std::make_tuple(c));
120 : }
121 : };
122 : void TestStructConstructor(compiler::TNode<Context> p_context);
123 : compiler::TNode<Object> GenericMacroTest5ATSmi(compiler::TNode<Smi> p_param);
124 : compiler::TNode<Object> GenericMacroTestWithLabels5ATSmi(compiler::TNode<Smi> p_param, compiler::CodeAssemblerLabel* label_X);
125 : compiler::TNode<Object> IncrementIfSmi36UT12ATFixedArray12ATHeapNumber5ATSmi(compiler::TNode<Object> p_x);
126 : compiler::TNode<Smi> ExampleGenericOverload5ATSmi(compiler::TNode<Smi> p_o);
127 : compiler::TNode<Object> ExampleGenericOverload20UT5ATSmi10HeapObject(compiler::TNode<Object> p_o);
128 : private:
129 : compiler::CodeAssemblerState* const state_;
130 : compiler::CodeAssembler ca_;};
131 :
132 : } // namespace internal
133 : } // namespace v8
134 :
135 : #endif // V8_TORQUE_TEST_FROM_DSL_BASE_H__
|