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

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

Issue 2562393002: [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. (Closed)
Patch Set: Rename UseSourcePosition to IsSourcePositionUsed Created 4 years 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-opcodes.h ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-opcodes.cc
diff --git a/src/wasm/wasm-opcodes.cc b/src/wasm/wasm-opcodes.cc
index 8f81b81a50bd9c4eb54c8952a354c227532a644d..658c3b8c929d803db94d3e395bac0e44667059dc 100644
--- a/src/wasm/wasm-opcodes.cc
+++ b/src/wasm/wasm-opcodes.cc
@@ -4,6 +4,7 @@
#include "src/wasm/wasm-opcodes.h"
#include "src/messages.h"
+#include "src/runtime/runtime.h"
#include "src/signature.h"
namespace v8 {
@@ -175,6 +176,19 @@ int WasmOpcodes::TrapReasonToMessageId(TrapReason reason) {
}
}
+int32_t WasmOpcodes::TrapReasonToFunctionId(TrapReason reason) {
+ switch (reason) {
+#define TRAPREASON_TO_MESSAGE(name) \
+ case k##name: \
+ return static_cast<int32_t>(Runtime::kThrowWasm##name);
+ FOREACH_WASM_TRAPREASON(TRAPREASON_TO_MESSAGE)
+#undef TRAPREASON_TO_MESSAGE
+ default:
+ UNREACHABLE();
+ return -1;
+ }
+}
+
const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) {
return MessageTemplate::TemplateString(TrapReasonToMessageId(reason));
}
« no previous file with comments | « src/wasm/wasm-opcodes.h ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698