OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef WASM_RUN_UTILS_H | 5 #ifndef WASM_RUN_UTILS_H |
6 #define WASM_RUN_UTILS_H | 6 #define WASM_RUN_UTILS_H |
7 | 7 |
8 #include <setjmp.h> | 8 #include <setjmp.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 #include <string.h> | 11 #include <string.h> |
12 #include <array> | 12 #include <array> |
13 #include <memory> | 13 #include <memory> |
14 | 14 |
15 #include "src/base/utils/random-number-generator.h" | 15 #include "src/base/utils/random-number-generator.h" |
16 #include "src/zone/accounting-allocator.h" | 16 #include "src/code-stubs.h" |
17 | |
18 #include "src/compiler/compiler-source-position-table.h" | 17 #include "src/compiler/compiler-source-position-table.h" |
19 #include "src/compiler/graph-visualizer.h" | 18 #include "src/compiler/graph-visualizer.h" |
20 #include "src/compiler/int64-lowering.h" | 19 #include "src/compiler/int64-lowering.h" |
21 #include "src/compiler/js-graph.h" | 20 #include "src/compiler/js-graph.h" |
22 #include "src/compiler/node.h" | 21 #include "src/compiler/node.h" |
23 #include "src/compiler/pipeline.h" | 22 #include "src/compiler/pipeline.h" |
24 #include "src/compiler/wasm-compiler.h" | 23 #include "src/compiler/wasm-compiler.h" |
25 #include "src/compiler/zone-stats.h" | 24 #include "src/compiler/zone-stats.h" |
26 #include "src/trap-handler/trap-handler.h" | 25 #include "src/trap-handler/trap-handler.h" |
27 #include "src/wasm/function-body-decoder.h" | 26 #include "src/wasm/function-body-decoder.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 compiled_module->set_weak_exported_functions(weak_exported); | 349 compiled_module->set_weak_exported_functions(weak_exported); |
351 DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module)); | 350 DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module)); |
352 return WasmInstanceObject::New(isolate_, compiled_module); | 351 return WasmInstanceObject::New(isolate_, compiled_module); |
353 } | 352 } |
354 }; | 353 }; |
355 | 354 |
356 inline void TestBuildingGraph(Zone* zone, JSGraph* jsgraph, ModuleEnv* module, | 355 inline void TestBuildingGraph(Zone* zone, JSGraph* jsgraph, ModuleEnv* module, |
357 FunctionSig* sig, | 356 FunctionSig* sig, |
358 SourcePositionTable* source_position_table, | 357 SourcePositionTable* source_position_table, |
359 const byte* start, const byte* end) { | 358 const byte* start, const byte* end) { |
360 compiler::WasmGraphBuilder builder(module, zone, jsgraph, sig, | 359 compiler::WasmGraphBuilder builder( |
361 source_position_table); | 360 module, zone, jsgraph, CEntryStub(jsgraph->isolate(), 1).GetCode(), sig, |
| 361 source_position_table); |
362 DecodeResult result = | 362 DecodeResult result = |
363 BuildTFGraph(zone->allocator(), &builder, sig, start, end); | 363 BuildTFGraph(zone->allocator(), &builder, sig, start, end); |
364 if (result.failed()) { | 364 if (result.failed()) { |
365 if (!FLAG_trace_wasm_decoder) { | 365 if (!FLAG_trace_wasm_decoder) { |
366 // Retry the compilation with the tracing flag on, to help in debugging. | 366 // Retry the compilation with the tracing flag on, to help in debugging. |
367 FLAG_trace_wasm_decoder = true; | 367 FLAG_trace_wasm_decoder = true; |
368 result = BuildTFGraph(zone->allocator(), &builder, sig, start, end); | 368 result = BuildTFGraph(zone->allocator(), &builder, sig, start, end); |
369 } | 369 } |
370 | 370 |
371 uint32_t pc = result.error_offset(); | 371 uint32_t pc = result.error_offset(); |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 void RunWasm_##name(WasmExecutionMode execution_mode) | 840 void RunWasm_##name(WasmExecutionMode execution_mode) |
841 | 841 |
842 #define WASM_EXEC_COMPILED_TEST(name) \ | 842 #define WASM_EXEC_COMPILED_TEST(name) \ |
843 void RunWasm_##name(WasmExecutionMode execution_mode); \ | 843 void RunWasm_##name(WasmExecutionMode execution_mode); \ |
844 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ | 844 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ |
845 void RunWasm_##name(WasmExecutionMode execution_mode) | 845 void RunWasm_##name(WasmExecutionMode execution_mode) |
846 | 846 |
847 } // namespace | 847 } // namespace |
848 | 848 |
849 #endif | 849 #endif |
OLD | NEW |