Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1121)

Unified Diff: src/wasm/wasm-module.cc

Issue 2148743004: WIP: wasm oob trap handling experiments (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Undoing spurious changes Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 7a276dfc94e0597c0b6922d2291d7ac00520c0a2..178e832a6a0f204990fabd93bebc0eb3ff91cb6b 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <iostream>
#include <memory>
#include "src/base/atomic-utils.h"
@@ -435,6 +436,21 @@ void LinkModuleFunctions(Isolate* isolate,
for (size_t i = 0; i < functions.size(); ++i) {
Handle<Code> code = functions[i];
LinkFunction(code, functions, Code::WASM_FUNCTION);
+
+ // Add this object to the signal handler table.
+ {
+ auto* handler_data = new wasm::TrapHandlerData;
+
+ handler_data->code = *code;
+
+ std::cerr << "*** STORING HANDLER DATA "
+ << reinterpret_cast<void*>(code->instruction_start()) << " ***"
+ << std::endl;
+
+ handler_data->next = wasm::gTrapHandlers;
+ wasm::gTrapHandlers = handler_data;
+ // TODO(eholk): make sure to clean all this up someday.
+ }
}
}
@@ -1153,6 +1169,7 @@ MaybeHandle<FixedArray> WasmModule::CompileFunctions(
for (size_t i = FLAG_skip_compiling_wasm_funcs;
i < temp_instance_for_compilation.function_code.size(); ++i) {
Code* code = *temp_instance_for_compilation.function_code[i];
+
compiled_functions->set(static_cast<int>(i), code);
}
« no previous file with comments | « src/wasm/wasm-module.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698