Line data Source code
1 : // Copyright 2015 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include <stdint.h>
6 : #include <stdio.h>
7 : #include <stdlib.h>
8 : #include <string.h>
9 :
10 : #include "src/api-inl.h"
11 : #include "src/assembler-inl.h"
12 : #include "src/objects/heap-number-inl.h"
13 : #include "test/cctest/cctest.h"
14 : #include "test/cctest/compiler/value-helper.h"
15 : #include "test/cctest/wasm/wasm-run-utils.h"
16 : #include "test/common/wasm/test-signatures.h"
17 : #include "test/common/wasm/wasm-macro-gen.h"
18 :
19 : namespace v8 {
20 : namespace internal {
21 : namespace wasm {
22 :
23 : #define ADD_CODE(vec, ...) \
24 : do { \
25 : byte __buf[] = {__VA_ARGS__}; \
26 : for (size_t i = 0; i < sizeof(__buf); i++) vec.push_back(__buf[i]); \
27 : } while (false)
28 :
29 : namespace {
30 : // A helper for generating predictable but unique argument values that
31 : // are easy to debug (e.g. with misaligned stacks).
32 : class PredictableInputValues {
33 : public:
34 : int base_;
35 : explicit PredictableInputValues(int base) : base_(base) {}
36 6705 : double arg_d(int which) { return base_ * which + ((which & 1) * 0.5); }
37 : float arg_f(int which) { return base_ * which + ((which & 1) * 0.25); }
38 : int32_t arg_i(int which) { return base_ * which + ((which & 1) * kMinInt); }
39 : int64_t arg_l(int which) {
40 : return base_ * which + ((which & 1) * (0x04030201LL << 32));
41 : }
42 : };
43 :
44 2430 : ManuallyImportedJSFunction CreateJSSelector(FunctionSig* sig, int which) {
45 : const int kMaxParams = 11;
46 : static const char* formals[kMaxParams] = {"",
47 : "a",
48 : "a,b",
49 : "a,b,c",
50 : "a,b,c,d",
51 : "a,b,c,d,e",
52 : "a,b,c,d,e,f",
53 : "a,b,c,d,e,f,g",
54 : "a,b,c,d,e,f,g,h",
55 : "a,b,c,d,e,f,g,h,i",
56 : "a,b,c,d,e,f,g,h,i,j"};
57 2430 : CHECK_LT(which, static_cast<int>(sig->parameter_count()));
58 2430 : CHECK_LT(static_cast<int>(sig->parameter_count()), kMaxParams);
59 :
60 : i::EmbeddedVector<char, 256> source;
61 2430 : char param = 'a' + which;
62 : SNPrintF(source, "(function(%s) { return %c; })",
63 2430 : formals[sig->parameter_count()], param);
64 :
65 : Handle<JSFunction> js_function =
66 : Handle<JSFunction>::cast(v8::Utils::OpenHandle(
67 4860 : *v8::Local<v8::Function>::Cast(CompileRun(source.start()))));
68 2430 : ManuallyImportedJSFunction import = {sig, js_function};
69 :
70 2430 : return import;
71 : }
72 :
73 5085 : void EXPECT_CALL(double expected, Handle<JSFunction> jsfunc,
74 : Handle<Object>* buffer, int count) {
75 : Isolate* isolate = jsfunc->GetIsolate();
76 10170 : Handle<Object> global(isolate->context()->global_object(), isolate);
77 : MaybeHandle<Object> retval =
78 5085 : Execution::Call(isolate, jsfunc, global, count, buffer);
79 :
80 5085 : CHECK(!retval.is_null());
81 : Handle<Object> result = retval.ToHandleChecked();
82 10170 : if (result->IsSmi()) {
83 5430 : CHECK_EQ(expected, Smi::ToInt(*result));
84 : } else {
85 4740 : CHECK(result->IsHeapNumber());
86 7110 : CHECK_FLOAT_EQ(expected, HeapNumber::cast(*result)->value());
87 : }
88 5085 : }
89 :
90 600 : void EXPECT_CALL(double expected, Handle<JSFunction> jsfunc, double a,
91 : double b) {
92 : Isolate* isolate = jsfunc->GetIsolate();
93 : Handle<Object> buffer[] = {isolate->factory()->NewNumber(a),
94 600 : isolate->factory()->NewNumber(b)};
95 600 : EXPECT_CALL(expected, jsfunc, buffer, 2);
96 600 : }
97 : } // namespace
98 :
99 28367 : WASM_EXEC_TEST(Run_Int32Sub_jswrapped) {
100 15 : WasmRunner<int, int, int> r(execution_tier);
101 15 : BUILD(r, WASM_I32_SUB(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
102 15 : Handle<JSFunction> jsfunc = r.builder().WrapCode(r.function()->func_index);
103 :
104 15 : EXPECT_CALL(33, jsfunc, 44, 11);
105 15 : EXPECT_CALL(-8723487, jsfunc, -8000000, 723487);
106 15 : }
107 :
108 28367 : WASM_EXEC_TEST(Run_Float32Div_jswrapped) {
109 15 : WasmRunner<float, float, float> r(execution_tier);
110 15 : BUILD(r, WASM_F32_DIV(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
111 15 : Handle<JSFunction> jsfunc = r.builder().WrapCode(r.function()->func_index);
112 :
113 15 : EXPECT_CALL(92, jsfunc, 46, 0.5);
114 15 : EXPECT_CALL(64, jsfunc, -16, -0.25);
115 15 : }
116 :
117 28367 : WASM_EXEC_TEST(Run_Float64Add_jswrapped) {
118 15 : WasmRunner<double, double, double> r(execution_tier);
119 15 : BUILD(r, WASM_F64_ADD(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
120 15 : Handle<JSFunction> jsfunc = r.builder().WrapCode(r.function()->func_index);
121 :
122 15 : EXPECT_CALL(3, jsfunc, 2, 1);
123 15 : EXPECT_CALL(-5.5, jsfunc, -5.25, -0.25);
124 15 : }
125 :
126 28367 : WASM_EXEC_TEST(Run_I32Popcount_jswrapped) {
127 15 : WasmRunner<int, int> r(execution_tier);
128 15 : BUILD(r, WASM_I32_POPCNT(WASM_GET_LOCAL(0)));
129 15 : Handle<JSFunction> jsfunc = r.builder().WrapCode(r.function()->func_index);
130 :
131 15 : EXPECT_CALL(2, jsfunc, 9, 0);
132 15 : EXPECT_CALL(3, jsfunc, 11, 0);
133 15 : EXPECT_CALL(6, jsfunc, 0x3F, 0);
134 15 : }
135 :
136 28367 : WASM_EXEC_TEST(Run_CallJS_Add_jswrapped) {
137 15 : TestSignatures sigs;
138 15 : HandleScope scope(CcTest::InitIsolateOnce());
139 : const char* source = "(function(a) { return a + 99; })";
140 : Handle<JSFunction> js_function =
141 : Handle<JSFunction>::cast(v8::Utils::OpenHandle(
142 15 : *v8::Local<v8::Function>::Cast(CompileRun(source))));
143 15 : ManuallyImportedJSFunction import = {sigs.i_i(), js_function};
144 15 : WasmRunner<int, int> r(execution_tier, &import);
145 : uint32_t js_index = 0;
146 :
147 30 : WasmFunctionCompiler& t = r.NewFunction(sigs.i_i());
148 15 : BUILD(t, WASM_CALL_FUNCTION(js_index, WASM_GET_LOCAL(0)));
149 :
150 15 : Handle<JSFunction> jsfunc = r.builder().WrapCode(t.function_index());
151 :
152 15 : EXPECT_CALL(101, jsfunc, 2, -8);
153 15 : EXPECT_CALL(199, jsfunc, 100, -1);
154 15 : EXPECT_CALL(-666666801, jsfunc, -666666900, -1);
155 15 : }
156 :
157 120 : void RunJSSelectTest(ExecutionTier tier, int which) {
158 : const int kMaxParams = 8;
159 : PredictableInputValues inputs(0x100);
160 : ValueType type = kWasmF64;
161 : ValueType types[kMaxParams + 1] = {type, type, type, type, type,
162 120 : type, type, type, type};
163 540 : for (int num_params = which + 1; num_params < kMaxParams; num_params++) {
164 420 : HandleScope scope(CcTest::InitIsolateOnce());
165 420 : FunctionSig sig(1, num_params, types);
166 :
167 420 : ManuallyImportedJSFunction import = CreateJSSelector(&sig, which);
168 420 : WasmRunner<void> r(tier, &import);
169 : uint32_t js_index = 0;
170 :
171 840 : WasmFunctionCompiler& t = r.NewFunction(&sig);
172 :
173 : {
174 : std::vector<byte> code;
175 :
176 2520 : for (int i = 0; i < num_params; i++) {
177 4200 : ADD_CODE(code, WASM_F64(inputs.arg_d(i)));
178 : }
179 :
180 420 : ADD_CODE(code, kExprCallFunction, static_cast<byte>(js_index));
181 :
182 420 : size_t end = code.size();
183 840 : code.push_back(0);
184 840 : t.Build(&code[0], &code[end]);
185 : }
186 :
187 420 : Handle<JSFunction> jsfunc = r.builder().WrapCode(t.function_index());
188 : double expected = inputs.arg_d(which);
189 420 : EXPECT_CALL(expected, jsfunc, 0.0, 0.0);
190 : }
191 120 : }
192 :
193 28367 : WASM_EXEC_TEST(Run_JSSelect_0) {
194 15 : CcTest::InitializeVM();
195 15 : RunJSSelectTest(execution_tier, 0);
196 0 : }
197 :
198 28367 : WASM_EXEC_TEST(Run_JSSelect_1) {
199 15 : CcTest::InitializeVM();
200 15 : RunJSSelectTest(execution_tier, 1);
201 0 : }
202 :
203 28367 : WASM_EXEC_TEST(Run_JSSelect_2) {
204 15 : CcTest::InitializeVM();
205 15 : RunJSSelectTest(execution_tier, 2);
206 0 : }
207 :
208 28367 : WASM_EXEC_TEST(Run_JSSelect_3) {
209 15 : CcTest::InitializeVM();
210 15 : RunJSSelectTest(execution_tier, 3);
211 0 : }
212 :
213 28367 : WASM_EXEC_TEST(Run_JSSelect_4) {
214 15 : CcTest::InitializeVM();
215 15 : RunJSSelectTest(execution_tier, 4);
216 0 : }
217 :
218 28367 : WASM_EXEC_TEST(Run_JSSelect_5) {
219 15 : CcTest::InitializeVM();
220 15 : RunJSSelectTest(execution_tier, 5);
221 0 : }
222 :
223 28367 : WASM_EXEC_TEST(Run_JSSelect_6) {
224 15 : CcTest::InitializeVM();
225 15 : RunJSSelectTest(execution_tier, 6);
226 0 : }
227 :
228 28367 : WASM_EXEC_TEST(Run_JSSelect_7) {
229 15 : CcTest::InitializeVM();
230 15 : RunJSSelectTest(execution_tier, 7);
231 0 : }
232 :
233 120 : void RunWASMSelectTest(ExecutionTier tier, int which) {
234 : PredictableInputValues inputs(0x200);
235 120 : Isolate* isolate = CcTest::InitIsolateOnce();
236 : const int kMaxParams = 8;
237 540 : for (int num_params = which + 1; num_params < kMaxParams; num_params++) {
238 : ValueType type = kWasmF64;
239 : ValueType types[kMaxParams + 1] = {type, type, type, type, type,
240 420 : type, type, type, type};
241 420 : FunctionSig sig(1, num_params, types);
242 :
243 420 : WasmRunner<void> r(tier);
244 840 : WasmFunctionCompiler& t = r.NewFunction(&sig);
245 420 : BUILD(t, WASM_GET_LOCAL(which));
246 420 : Handle<JSFunction> jsfunc = r.builder().WrapCode(t.function_index());
247 :
248 : Handle<Object> args[] = {
249 : isolate->factory()->NewNumber(inputs.arg_d(0)),
250 : isolate->factory()->NewNumber(inputs.arg_d(1)),
251 : isolate->factory()->NewNumber(inputs.arg_d(2)),
252 : isolate->factory()->NewNumber(inputs.arg_d(3)),
253 : isolate->factory()->NewNumber(inputs.arg_d(4)),
254 : isolate->factory()->NewNumber(inputs.arg_d(5)),
255 : isolate->factory()->NewNumber(inputs.arg_d(6)),
256 : isolate->factory()->NewNumber(inputs.arg_d(7)),
257 420 : };
258 :
259 : double expected = inputs.arg_d(which);
260 420 : EXPECT_CALL(expected, jsfunc, args, kMaxParams);
261 : }
262 120 : }
263 :
264 28367 : WASM_EXEC_TEST(Run_WASMSelect_0) {
265 15 : CcTest::InitializeVM();
266 15 : RunWASMSelectTest(execution_tier, 0);
267 0 : }
268 :
269 28367 : WASM_EXEC_TEST(Run_WASMSelect_1) {
270 15 : CcTest::InitializeVM();
271 15 : RunWASMSelectTest(execution_tier, 1);
272 0 : }
273 :
274 28367 : WASM_EXEC_TEST(Run_WASMSelect_2) {
275 15 : CcTest::InitializeVM();
276 15 : RunWASMSelectTest(execution_tier, 2);
277 0 : }
278 :
279 28367 : WASM_EXEC_TEST(Run_WASMSelect_3) {
280 15 : CcTest::InitializeVM();
281 15 : RunWASMSelectTest(execution_tier, 3);
282 0 : }
283 :
284 28367 : WASM_EXEC_TEST(Run_WASMSelect_4) {
285 15 : CcTest::InitializeVM();
286 15 : RunWASMSelectTest(execution_tier, 4);
287 0 : }
288 :
289 28367 : WASM_EXEC_TEST(Run_WASMSelect_5) {
290 15 : CcTest::InitializeVM();
291 15 : RunWASMSelectTest(execution_tier, 5);
292 0 : }
293 :
294 28367 : WASM_EXEC_TEST(Run_WASMSelect_6) {
295 15 : CcTest::InitializeVM();
296 15 : RunWASMSelectTest(execution_tier, 6);
297 0 : }
298 :
299 28367 : WASM_EXEC_TEST(Run_WASMSelect_7) {
300 15 : CcTest::InitializeVM();
301 15 : RunWASMSelectTest(execution_tier, 7);
302 0 : }
303 :
304 375 : void RunWASMSelectAlignTest(ExecutionTier tier, int num_args, int num_params) {
305 : PredictableInputValues inputs(0x300);
306 375 : Isolate* isolate = CcTest::InitIsolateOnce();
307 : const int kMaxParams = 10;
308 : DCHECK_LE(num_args, kMaxParams);
309 : ValueType type = kWasmF64;
310 : ValueType types[kMaxParams + 1] = {type, type, type, type, type, type,
311 375 : type, type, type, type, type};
312 375 : FunctionSig sig(1, num_params, types);
313 :
314 2430 : for (int which = 0; which < num_params; which++) {
315 2055 : WasmRunner<void> r(tier);
316 4110 : WasmFunctionCompiler& t = r.NewFunction(&sig);
317 2055 : BUILD(t, WASM_GET_LOCAL(which));
318 2055 : Handle<JSFunction> jsfunc = r.builder().WrapCode(t.function_index());
319 :
320 : Handle<Object> args[] = {isolate->factory()->NewNumber(inputs.arg_d(0)),
321 : isolate->factory()->NewNumber(inputs.arg_d(1)),
322 : isolate->factory()->NewNumber(inputs.arg_d(2)),
323 : isolate->factory()->NewNumber(inputs.arg_d(3)),
324 : isolate->factory()->NewNumber(inputs.arg_d(4)),
325 : isolate->factory()->NewNumber(inputs.arg_d(5)),
326 : isolate->factory()->NewNumber(inputs.arg_d(6)),
327 : isolate->factory()->NewNumber(inputs.arg_d(7)),
328 : isolate->factory()->NewNumber(inputs.arg_d(8)),
329 2055 : isolate->factory()->NewNumber(inputs.arg_d(9))};
330 :
331 : double nan = std::numeric_limits<double>::quiet_NaN();
332 2055 : double expected = which < num_args ? inputs.arg_d(which) : nan;
333 2055 : EXPECT_CALL(expected, jsfunc, args, num_args);
334 : }
335 375 : }
336 :
337 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_0) {
338 15 : CcTest::InitializeVM();
339 15 : RunWASMSelectAlignTest(execution_tier, 0, 1);
340 15 : RunWASMSelectAlignTest(execution_tier, 0, 2);
341 15 : }
342 :
343 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_1) {
344 15 : CcTest::InitializeVM();
345 15 : RunWASMSelectAlignTest(execution_tier, 1, 2);
346 15 : RunWASMSelectAlignTest(execution_tier, 1, 3);
347 15 : }
348 :
349 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_2) {
350 15 : CcTest::InitializeVM();
351 15 : RunWASMSelectAlignTest(execution_tier, 2, 3);
352 15 : RunWASMSelectAlignTest(execution_tier, 2, 4);
353 15 : }
354 :
355 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_3) {
356 15 : CcTest::InitializeVM();
357 15 : RunWASMSelectAlignTest(execution_tier, 3, 3);
358 15 : RunWASMSelectAlignTest(execution_tier, 3, 4);
359 15 : }
360 :
361 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_4) {
362 15 : CcTest::InitializeVM();
363 15 : RunWASMSelectAlignTest(execution_tier, 4, 3);
364 15 : RunWASMSelectAlignTest(execution_tier, 4, 4);
365 15 : }
366 :
367 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_7) {
368 15 : CcTest::InitializeVM();
369 15 : RunWASMSelectAlignTest(execution_tier, 7, 5);
370 15 : RunWASMSelectAlignTest(execution_tier, 7, 6);
371 15 : RunWASMSelectAlignTest(execution_tier, 7, 7);
372 15 : }
373 :
374 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_8) {
375 15 : CcTest::InitializeVM();
376 15 : RunWASMSelectAlignTest(execution_tier, 8, 5);
377 15 : RunWASMSelectAlignTest(execution_tier, 8, 6);
378 15 : RunWASMSelectAlignTest(execution_tier, 8, 7);
379 15 : RunWASMSelectAlignTest(execution_tier, 8, 8);
380 15 : }
381 :
382 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_9) {
383 15 : CcTest::InitializeVM();
384 15 : RunWASMSelectAlignTest(execution_tier, 9, 6);
385 15 : RunWASMSelectAlignTest(execution_tier, 9, 7);
386 15 : RunWASMSelectAlignTest(execution_tier, 9, 8);
387 15 : RunWASMSelectAlignTest(execution_tier, 9, 9);
388 15 : }
389 :
390 28367 : WASM_EXEC_TEST(Run_WASMSelectAlign_10) {
391 15 : CcTest::InitializeVM();
392 15 : RunWASMSelectAlignTest(execution_tier, 10, 7);
393 15 : RunWASMSelectAlignTest(execution_tier, 10, 8);
394 15 : RunWASMSelectAlignTest(execution_tier, 10, 9);
395 15 : RunWASMSelectAlignTest(execution_tier, 10, 10);
396 15 : }
397 :
398 390 : void RunJSSelectAlignTest(ExecutionTier tier, int num_args, int num_params) {
399 : PredictableInputValues inputs(0x400);
400 390 : Isolate* isolate = CcTest::InitIsolateOnce();
401 : Factory* factory = isolate->factory();
402 : const int kMaxParams = 10;
403 390 : CHECK_LE(num_args, kMaxParams);
404 390 : CHECK_LE(num_params, kMaxParams);
405 : ValueType type = kWasmF64;
406 : ValueType types[kMaxParams + 1] = {type, type, type, type, type, type,
407 390 : type, type, type, type, type};
408 390 : FunctionSig sig(1, num_params, types);
409 390 : i::AccountingAllocator allocator;
410 780 : Zone zone(&allocator, ZONE_NAME);
411 :
412 : // Build the calling code.
413 : std::vector<byte> code;
414 :
415 2400 : for (int i = 0; i < num_params; i++) {
416 2010 : ADD_CODE(code, WASM_GET_LOCAL(i));
417 : }
418 :
419 : uint8_t imported_js_index = 0;
420 390 : ADD_CODE(code, kExprCallFunction, imported_js_index);
421 :
422 390 : size_t end = code.size();
423 780 : code.push_back(0);
424 :
425 : // Call different select JS functions.
426 2400 : for (int which = 0; which < num_params; which++) {
427 : HandleScope scope(isolate);
428 2010 : ManuallyImportedJSFunction import = CreateJSSelector(&sig, which);
429 2010 : WasmRunner<void> r(tier, &import);
430 4020 : WasmFunctionCompiler& t = r.NewFunction(&sig);
431 4020 : t.Build(&code[0], &code[end]);
432 :
433 2010 : Handle<JSFunction> jsfunc = r.builder().WrapCode(t.function_index());
434 :
435 : Handle<Object> args[] = {
436 : factory->NewNumber(inputs.arg_d(0)),
437 : factory->NewNumber(inputs.arg_d(1)),
438 : factory->NewNumber(inputs.arg_d(2)),
439 : factory->NewNumber(inputs.arg_d(3)),
440 : factory->NewNumber(inputs.arg_d(4)),
441 : factory->NewNumber(inputs.arg_d(5)),
442 : factory->NewNumber(inputs.arg_d(6)),
443 : factory->NewNumber(inputs.arg_d(7)),
444 : factory->NewNumber(inputs.arg_d(8)),
445 : factory->NewNumber(inputs.arg_d(9)),
446 2010 : };
447 :
448 : double nan = std::numeric_limits<double>::quiet_NaN();
449 2010 : double expected = which < num_args ? inputs.arg_d(which) : nan;
450 2010 : EXPECT_CALL(expected, jsfunc, args, num_args);
451 390 : }
452 390 : }
453 :
454 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_0) {
455 15 : CcTest::InitializeVM();
456 15 : RunJSSelectAlignTest(execution_tier, 0, 1);
457 15 : RunJSSelectAlignTest(execution_tier, 0, 2);
458 15 : }
459 :
460 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_1) {
461 15 : CcTest::InitializeVM();
462 15 : RunJSSelectAlignTest(execution_tier, 1, 2);
463 15 : RunJSSelectAlignTest(execution_tier, 1, 3);
464 15 : }
465 :
466 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_2) {
467 15 : CcTest::InitializeVM();
468 15 : RunJSSelectAlignTest(execution_tier, 2, 3);
469 15 : RunJSSelectAlignTest(execution_tier, 2, 4);
470 15 : }
471 :
472 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_3) {
473 15 : CcTest::InitializeVM();
474 15 : RunJSSelectAlignTest(execution_tier, 3, 3);
475 15 : RunJSSelectAlignTest(execution_tier, 3, 4);
476 15 : }
477 :
478 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_4) {
479 15 : CcTest::InitializeVM();
480 15 : RunJSSelectAlignTest(execution_tier, 4, 3);
481 15 : RunJSSelectAlignTest(execution_tier, 4, 4);
482 15 : }
483 :
484 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_7) {
485 15 : CcTest::InitializeVM();
486 15 : RunJSSelectAlignTest(execution_tier, 7, 3);
487 15 : RunJSSelectAlignTest(execution_tier, 7, 4);
488 15 : RunJSSelectAlignTest(execution_tier, 7, 4);
489 15 : RunJSSelectAlignTest(execution_tier, 7, 4);
490 15 : }
491 :
492 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_8) {
493 15 : CcTest::InitializeVM();
494 15 : RunJSSelectAlignTest(execution_tier, 8, 5);
495 15 : RunJSSelectAlignTest(execution_tier, 8, 6);
496 15 : RunJSSelectAlignTest(execution_tier, 8, 7);
497 15 : RunJSSelectAlignTest(execution_tier, 8, 8);
498 15 : }
499 :
500 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_9) {
501 15 : CcTest::InitializeVM();
502 15 : RunJSSelectAlignTest(execution_tier, 9, 6);
503 15 : RunJSSelectAlignTest(execution_tier, 9, 7);
504 15 : RunJSSelectAlignTest(execution_tier, 9, 8);
505 15 : RunJSSelectAlignTest(execution_tier, 9, 9);
506 15 : }
507 :
508 28367 : WASM_EXEC_TEST(Run_JSSelectAlign_10) {
509 15 : CcTest::InitializeVM();
510 15 : RunJSSelectAlignTest(execution_tier, 10, 7);
511 15 : RunJSSelectAlignTest(execution_tier, 10, 8);
512 15 : RunJSSelectAlignTest(execution_tier, 10, 9);
513 15 : RunJSSelectAlignTest(execution_tier, 10, 10);
514 15 : }
515 :
516 : #undef ADD_CODE
517 :
518 : } // namespace wasm
519 : } // namespace internal
520 85011 : } // namespace v8
|