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

Unified Diff: src/wasm/wasm-interpreter.h

Issue 2639353002: [wasm] Fix I32ReinterpretF32 and I64ReinterpretF64 on ia32. (Closed)
Patch Set: use memcpy instead of reinterpret_cast 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/function-body-decoder.h ('k') | src/wasm/wasm-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-interpreter.h
diff --git a/src/wasm/wasm-interpreter.h b/src/wasm/wasm-interpreter.h
index 217c8b37f0bf8cca7702000b8ef7f142ab07bfc6..87758bdd24f352c7a7158aa517afa140308b1c40 100644
--- a/src/wasm/wasm-interpreter.h
+++ b/src/wasm/wasm-interpreter.h
@@ -56,13 +56,22 @@ struct WasmVal {
#undef DECLARE_CONSTRUCTOR
template <typename T>
- T to() {
+ inline T to() {
+ UNREACHABLE();
+ }
+
+ template <typename T>
+ inline T to_unchecked() {
UNREACHABLE();
}
};
#define DECLARE_CAST(field, localtype, ctype) \
template <> \
+ inline ctype WasmVal::to_unchecked() { \
+ return val.field; \
+ } \
+ template <> \
inline ctype WasmVal::to() { \
CHECK_EQ(localtype, type); \
return val.field; \
@@ -70,11 +79,6 @@ struct WasmVal {
FOREACH_UNION_MEMBER(DECLARE_CAST)
#undef DECLARE_CAST
-template <>
-inline void WasmVal::to() {
- CHECK_EQ(kWasmStmt, type);
-}
-
// Representation of frames within the interpreter.
class WasmFrame {
public:
« no previous file with comments | « src/wasm/function-body-decoder.h ('k') | src/wasm/wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698