LCOV - code coverage report
Current view: top level - test/cctest/wasm - test-run-wasm-js.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 284 300 94.7 %
Date: 2017-10-20 Functions: 110 126 87.3 %

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

Generated by: LCOV version 1.10