| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "test/unittests/test-utils.h" | 5 #include "test/unittests/test-utils.h" |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "test/cctest/wasm/test-signatures.h" | 9 #include "test/cctest/wasm/test-signatures.h" |
| 10 | 10 |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 mod.globals.push_back({0, 0, mem_type, 0, false}); | 1162 mod.globals.push_back({0, 0, mem_type, 0, false}); |
| 1163 CHECK(mod.globals.size() <= 127); | 1163 CHECK(mod.globals.size() <= 127); |
| 1164 return static_cast<byte>(mod.globals.size() - 1); | 1164 return static_cast<byte>(mod.globals.size() - 1); |
| 1165 } | 1165 } |
| 1166 byte AddSignature(FunctionSig* sig) { | 1166 byte AddSignature(FunctionSig* sig) { |
| 1167 mod.signatures.push_back(sig); | 1167 mod.signatures.push_back(sig); |
| 1168 CHECK(mod.signatures.size() <= 127); | 1168 CHECK(mod.signatures.size() <= 127); |
| 1169 return static_cast<byte>(mod.signatures.size() - 1); | 1169 return static_cast<byte>(mod.signatures.size() - 1); |
| 1170 } | 1170 } |
| 1171 byte AddFunction(FunctionSig* sig) { | 1171 byte AddFunction(FunctionSig* sig) { |
| 1172 mod.functions.push_back({sig, // sig | 1172 mod.functions.push_back({sig, // sig |
| 1173 0, // func_index | 1173 0, // func_index |
| 1174 0, // sig_index | 1174 0, // sig_index |
| 1175 0, // name_offset | 1175 0, // name_offset |
| 1176 0, // name_length | 1176 0, // name_length |
| 1177 0, // code_start_offset | 1177 0, // code_start_offset |
| 1178 0, // code_end_offset | 1178 0}); // code_end_offset |
| 1179 false}); // exported | |
| 1180 CHECK(mod.functions.size() <= 127); | 1179 CHECK(mod.functions.size() <= 127); |
| 1181 return static_cast<byte>(mod.functions.size() - 1); | 1180 return static_cast<byte>(mod.functions.size() - 1); |
| 1182 } | 1181 } |
| 1183 byte AddImport(FunctionSig* sig) { | 1182 byte AddImport(FunctionSig* sig) { |
| 1184 mod.import_table.push_back({sig, // sig | 1183 mod.import_table.push_back({sig, // sig |
| 1185 0, // sig_index | 1184 0, // sig_index |
| 1186 0, // module_name_offset | 1185 0, // module_name_offset |
| 1187 0, // module_name_length | 1186 0, // module_name_length |
| 1188 0, // function_name_offset | 1187 0, // function_name_offset |
| 1189 0}); // function_name_length | 1188 0}); // function_name_length |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2435 LocalTypeMap map = Expand(decls); | 2434 LocalTypeMap map = Expand(decls); |
| 2436 size_t pos = 0; | 2435 size_t pos = 0; |
| 2437 pos = ExpectRun(map, pos, kAstF32, 5); | 2436 pos = ExpectRun(map, pos, kAstF32, 5); |
| 2438 pos = ExpectRun(map, pos, kAstI32, 1337); | 2437 pos = ExpectRun(map, pos, kAstI32, 1337); |
| 2439 pos = ExpectRun(map, pos, kAstI64, 212); | 2438 pos = ExpectRun(map, pos, kAstI64, 212); |
| 2440 } | 2439 } |
| 2441 | 2440 |
| 2442 } // namespace wasm | 2441 } // namespace wasm |
| 2443 } // namespace internal | 2442 } // namespace internal |
| 2444 } // namespace v8 | 2443 } // namespace v8 |
| OLD | NEW |