| Index: test/cctest/wasm/wasm-run-utils.h
|
| diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
|
| index adca30e545c3107ac9119d69390db880afd49b3c..e985dd356d077277c8732f50763b92b3b1b3a73c 100644
|
| --- a/test/cctest/wasm/wasm-run-utils.h
|
| +++ b/test/cctest/wasm/wasm-run-utils.h
|
| @@ -242,11 +242,14 @@ class TestingModule : public ModuleEnv {
|
| };
|
|
|
| inline void TestBuildingGraph(Zone* zone, JSGraph* jsgraph, ModuleEnv* module,
|
| - FunctionSig* sig, const byte* start,
|
| - const byte* end) {
|
| - compiler::WasmGraphBuilder builder(zone, jsgraph, sig);
|
| + FunctionSig* sig,
|
| + SourcePositionTable* source_position_table,
|
| + const byte* start, const byte* end) {
|
| + compiler::WasmGraphBuilder builder(zone, jsgraph, sig, source_position_table);
|
| + builder.EnterSourcePositionScope();
|
| TreeResult result =
|
| BuildTFGraph(zone->allocator(), &builder, module, sig, start, end);
|
| + builder.LeaveSourcePositionScope();
|
| if (result.failed()) {
|
| ptrdiff_t pc = result.error_pc - result.start;
|
| ptrdiff_t pt = result.error_pt - result.start;
|
| @@ -416,7 +419,8 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
|
| nullptr, this->machine()),
|
| sig(sig),
|
| descriptor_(nullptr),
|
| - testing_module_(module) {
|
| + testing_module_(module),
|
| + source_position_table_(this->graph()) {
|
| if (module) {
|
| // Get a new function from the testing module.
|
| function_ = nullptr;
|
| @@ -441,6 +445,7 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
|
| WasmFunction* function_;
|
| int function_index_;
|
| LocalDeclEncoder local_decls;
|
| + SourcePositionTable source_position_table_;
|
|
|
| Isolate* isolate() { return main_isolate(); }
|
| Graph* graph() const { return main_graph_; }
|
| @@ -457,7 +462,8 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
|
| void Build(const byte* start, const byte* end) {
|
| // Build the TurboFan graph.
|
| local_decls.Prepend(&start, &end);
|
| - TestBuildingGraph(main_zone(), &jsgraph, testing_module_, sig, start, end);
|
| + TestBuildingGraph(main_zone(), &jsgraph, testing_module_, sig,
|
| + &source_position_table_, start, end);
|
| delete[] start;
|
| }
|
|
|
| @@ -476,6 +482,8 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
|
| }
|
| CompilationInfo info("wasm compile", this->isolate(), this->zone(),
|
| Code::ComputeFlags(Code::WASM_FUNCTION));
|
| + info.MarkAsSourcePositionsEnabled();
|
| + info.SetSourcePositionTable(&source_position_table_);
|
| Handle<Code> result =
|
| Pipeline::GenerateCodeForTesting(&info, desc, this->graph());
|
| #ifdef ENABLE_DISASSEMBLER
|
|
|