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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_WASM_INTERPRETER_H_ 5 #ifndef V8_WASM_INTERPRETER_H_
6 #define V8_WASM_INTERPRETER_H_ 6 #define V8_WASM_INTERPRETER_H_
7 7
8 #include "src/wasm/wasm-opcodes.h" 8 #include "src/wasm/wasm-opcodes.h"
9 #include "src/zone/zone-containers.h" 9 #include "src/zone/zone-containers.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } val; 49 } val;
50 50
51 WasmVal() : type(kWasmStmt) {} 51 WasmVal() : type(kWasmStmt) {}
52 52
53 #define DECLARE_CONSTRUCTOR(field, localtype, ctype) \ 53 #define DECLARE_CONSTRUCTOR(field, localtype, ctype) \
54 explicit WasmVal(ctype v) : type(localtype) { val.field = v; } 54 explicit WasmVal(ctype v) : type(localtype) { val.field = v; }
55 FOREACH_UNION_MEMBER(DECLARE_CONSTRUCTOR) 55 FOREACH_UNION_MEMBER(DECLARE_CONSTRUCTOR)
56 #undef DECLARE_CONSTRUCTOR 56 #undef DECLARE_CONSTRUCTOR
57 57
58 template <typename T> 58 template <typename T>
59 T to() { 59 inline T to() {
60 UNREACHABLE();
61 }
62
63 template <typename T>
64 inline T to_unchecked() {
60 UNREACHABLE(); 65 UNREACHABLE();
61 } 66 }
62 }; 67 };
63 68
64 #define DECLARE_CAST(field, localtype, ctype) \ 69 #define DECLARE_CAST(field, localtype, ctype) \
65 template <> \ 70 template <> \
71 inline ctype WasmVal::to_unchecked() { \
72 return val.field; \
73 } \
74 template <> \
66 inline ctype WasmVal::to() { \ 75 inline ctype WasmVal::to() { \
67 CHECK_EQ(localtype, type); \ 76 CHECK_EQ(localtype, type); \
68 return val.field; \ 77 return val.field; \
69 } 78 }
70 FOREACH_UNION_MEMBER(DECLARE_CAST) 79 FOREACH_UNION_MEMBER(DECLARE_CAST)
71 #undef DECLARE_CAST 80 #undef DECLARE_CAST
72 81
73 template <>
74 inline void WasmVal::to() {
75 CHECK_EQ(kWasmStmt, type);
76 }
77
78 // Representation of frames within the interpreter. 82 // Representation of frames within the interpreter.
79 class WasmFrame { 83 class WasmFrame {
80 public: 84 public:
81 const WasmFunction* function() const { return function_; } 85 const WasmFunction* function() const { return function_; }
82 int pc() const { 86 int pc() const {
83 // TODO(wasm): Remove USE once we actually use them. 87 // TODO(wasm): Remove USE once we actually use them.
84 USE(fp_); 88 USE(fp_);
85 USE(sp_); 89 USE(sp_);
86 return pc_; 90 return pc_;
87 } 91 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 private: 207 private:
204 Zone zone_; 208 Zone zone_;
205 WasmInterpreterInternals* internals_; 209 WasmInterpreterInternals* internals_;
206 }; 210 };
207 211
208 } // namespace wasm 212 } // namespace wasm
209 } // namespace internal 213 } // namespace internal
210 } // namespace v8 214 } // namespace v8
211 215
212 #endif // V8_WASM_INTERPRETER_H_ 216 #endif // V8_WASM_INTERPRETER_H_
OLDNEW
« 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