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

Side by Side Diff: src/wasm/wasm-interpreter.h

Issue 2645693003: Revert of [wasm] Fix I32ReinterpretF32 and I64ReinterpretF64 on ia32. (Closed)
Patch Set: 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 inline T to() { 59 T to() {
60 UNREACHABLE();
61 }
62
63 template <typename T>
64 inline T to_unchecked() {
65 UNREACHABLE(); 60 UNREACHABLE();
66 } 61 }
67 }; 62 };
68 63
69 #define DECLARE_CAST(field, localtype, ctype) \ 64 #define DECLARE_CAST(field, localtype, ctype) \
70 template <> \ 65 template <> \
71 inline ctype WasmVal::to_unchecked() { \
72 return val.field; \
73 } \
74 template <> \
75 inline ctype WasmVal::to() { \ 66 inline ctype WasmVal::to() { \
76 CHECK_EQ(localtype, type); \ 67 CHECK_EQ(localtype, type); \
77 return val.field; \ 68 return val.field; \
78 } 69 }
79 FOREACH_UNION_MEMBER(DECLARE_CAST) 70 FOREACH_UNION_MEMBER(DECLARE_CAST)
80 #undef DECLARE_CAST 71 #undef DECLARE_CAST
81 72
73 template <>
74 inline void WasmVal::to() {
75 CHECK_EQ(kWasmStmt, type);
76 }
77
82 // Representation of frames within the interpreter. 78 // Representation of frames within the interpreter.
83 class WasmFrame { 79 class WasmFrame {
84 public: 80 public:
85 const WasmFunction* function() const { return function_; } 81 const WasmFunction* function() const { return function_; }
86 int pc() const { 82 int pc() const {
87 // TODO(wasm): Remove USE once we actually use them. 83 // TODO(wasm): Remove USE once we actually use them.
88 USE(fp_); 84 USE(fp_);
89 USE(sp_); 85 USE(sp_);
90 return pc_; 86 return pc_;
91 } 87 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 private: 203 private:
208 Zone zone_; 204 Zone zone_;
209 WasmInterpreterInternals* internals_; 205 WasmInterpreterInternals* internals_;
210 }; 206 };
211 207
212 } // namespace wasm 208 } // namespace wasm
213 } // namespace internal 209 } // namespace internal
214 } // namespace v8 210 } // namespace v8
215 211
216 #endif // V8_WASM_INTERPRETER_H_ 212 #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