| Index: src/compiler/wasm-compiler.cc
|
| diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
|
| index 2edd72dee57fbc8630f522cdef1b82280df6ad4d..b6fe8fd0bed02cd0567eda3cf359fdb0e4a818b6 100644
|
| --- a/src/compiler/wasm-compiler.cc
|
| +++ b/src/compiler/wasm-compiler.cc
|
| @@ -244,8 +244,9 @@ class WasmTrapHelper : public ZoneObject {
|
| }
|
| };
|
|
|
| -WasmGraphBuilder::WasmGraphBuilder(Zone* zone, JSGraph* jsgraph,
|
| - wasm::FunctionSig* function_signature)
|
| +WasmGraphBuilder::WasmGraphBuilder(
|
| + Zone* zone, JSGraph* jsgraph, wasm::FunctionSig* function_signature,
|
| + compiler::SourcePositionTable* source_position_table)
|
| : zone_(zone),
|
| jsgraph_(jsgraph),
|
| module_(nullptr),
|
| @@ -257,7 +258,8 @@ WasmGraphBuilder::WasmGraphBuilder(Zone* zone, JSGraph* jsgraph,
|
| cur_buffer_(def_buffer_),
|
| cur_bufsize_(kDefaultBufferSize),
|
| trap_(new (zone) WasmTrapHelper(this)),
|
| - function_signature_(function_signature) {
|
| + function_signature_(function_signature),
|
| + source_position_table_(source_position_table) {
|
| DCHECK_NOT_NULL(jsgraph_);
|
| }
|
|
|
| @@ -2663,6 +2665,12 @@ void WasmGraphBuilder::Int64LoweringForTesting() {
|
| }
|
| }
|
|
|
| +void WasmGraphBuilder::SetSourcePosition(Node* node, int position) {
|
| + compiler::SourcePosition pos(position);
|
| + if (source_position_table_)
|
| + source_position_table_->SetSourcePosition(node, pos);
|
| +}
|
| +
|
| static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
|
| CompilationInfo* info,
|
| const char* message, uint32_t index,
|
| @@ -2755,7 +2763,7 @@ Handle<JSFunction> CompileJSToWasmWrapper(
|
|
|
| CompilationInfo info(func_name, isolate, &zone, flags);
|
| Handle<Code> code =
|
| - Pipeline::GenerateCodeForTesting(&info, incoming, &graph, nullptr);
|
| + Pipeline::GenerateCodeForTesting(&info, incoming, &graph);
|
| #ifdef ENABLE_DISASSEMBLER
|
| if (FLAG_print_opt_code && !code.is_null()) {
|
| OFStream os(stdout);
|
| @@ -2874,7 +2882,9 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
|
| &zone, MachineType::PointerRepresentation(),
|
| InstructionSelector::SupportedMachineOperatorFlags());
|
| JSGraph jsgraph(isolate, &graph, &common, nullptr, nullptr, &machine);
|
| - WasmGraphBuilder builder(&zone, &jsgraph, function.sig);
|
| + SourcePositionTable source_position_table(&graph);
|
| + WasmGraphBuilder builder(&zone, &jsgraph, function.sig,
|
| + &source_position_table);
|
| wasm::FunctionBody body = {
|
| module_env, function.sig, module_env->module->module_start,
|
| module_env->module->module_start + function.code_start_offset,
|
| @@ -2941,8 +2951,8 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
|
| }
|
| CompilationInfo info(func_name, isolate, &zone, flags);
|
|
|
| - Handle<Code> code =
|
| - Pipeline::GenerateCodeForTesting(&info, descriptor, &graph);
|
| + Handle<Code> code = Pipeline::GenerateWASMCode(&info, descriptor, &graph,
|
| + &source_position_table);
|
| if (debugging) {
|
| buffer.Dispose();
|
| }
|
|
|