blob: 764c5030f5f735554273c8f52780c6dfb805990a [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// Copyright 2015 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_WASM_OPCODES_H_
6#define V8_WASM_OPCODES_H_
7
8#include "src/machine-type.h"
9#include "src/signature.h"
10
11namespace v8 {
12namespace internal {
13namespace wasm {
14
15// Binary encoding of local types.
16enum LocalTypeCode {
17 kLocalVoid = 0,
18 kLocalI32 = 1,
19 kLocalI64 = 2,
20 kLocalF32 = 3,
21 kLocalF64 = 4
22};
23
24// Binary encoding of memory types.
25enum MemTypeCode {
26 kMemI8 = 0,
27 kMemU8 = 1,
28 kMemI16 = 2,
29 kMemU16 = 3,
30 kMemI32 = 4,
31 kMemU32 = 5,
32 kMemI64 = 6,
33 kMemU64 = 7,
34 kMemF32 = 8,
35 kMemF64 = 9
36};
37
38// We reuse the internal machine type to represent WebAssembly AST types.
39// A typedef improves readability without adding a whole new type system.
40typedef MachineRepresentation LocalType;
41const LocalType kAstStmt = MachineRepresentation::kNone;
42const LocalType kAstI32 = MachineRepresentation::kWord32;
43const LocalType kAstI64 = MachineRepresentation::kWord64;
44const LocalType kAstF32 = MachineRepresentation::kFloat32;
45const LocalType kAstF64 = MachineRepresentation::kFloat64;
46// We use kTagged here because kNone is already used by kAstStmt.
47const LocalType kAstEnd = MachineRepresentation::kTagged;
48
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000049typedef Signature<LocalType> FunctionSig;
Ben Murdoch097c5b22016-05-18 11:27:45 +010050std::ostream& operator<<(std::ostream& os, const FunctionSig& function);
51
Ben Murdochc5610432016-08-08 18:44:38 +010052typedef Vector<const char> WasmName;
Ben Murdochda12d292016-06-02 14:46:10 +010053
Ben Murdochc5610432016-08-08 18:44:38 +010054typedef int WasmCodePosition;
55const WasmCodePosition kNoCodePosition = -1;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000056
57// Control expressions and blocks.
58#define FOREACH_CONTROL_OPCODE(V) \
59 V(Nop, 0x00, _) \
60 V(Block, 0x01, _) \
61 V(Loop, 0x02, _) \
62 V(If, 0x03, _) \
Ben Murdochc5610432016-08-08 18:44:38 +010063 V(Else, 0x04, _) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000064 V(Select, 0x05, _) \
65 V(Br, 0x06, _) \
66 V(BrIf, 0x07, _) \
Ben Murdochda12d292016-06-02 14:46:10 +010067 V(BrTable, 0x08, _) \
Ben Murdochc5610432016-08-08 18:44:38 +010068 V(Return, 0x09, _) \
69 V(Unreachable, 0x0a, _) \
70 V(End, 0x0F, _)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000071
72// Constants, locals, globals, and calls.
73#define FOREACH_MISC_OPCODE(V) \
Ben Murdochc5610432016-08-08 18:44:38 +010074 V(I32Const, 0x10, _) \
75 V(I64Const, 0x11, _) \
76 V(F64Const, 0x12, _) \
77 V(F32Const, 0x13, _) \
78 V(GetLocal, 0x14, _) \
79 V(SetLocal, 0x15, _) \
80 V(CallFunction, 0x16, _) \
81 V(CallIndirect, 0x17, _) \
82 V(CallImport, 0x18, _) \
83 V(I8Const, 0xcb, _) \
84 V(LoadGlobal, 0xcc, _) \
85 V(StoreGlobal, 0xcd, _)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000086
87// Load memory expressions.
88#define FOREACH_LOAD_MEM_OPCODE(V) \
89 V(I32LoadMem8S, 0x20, i_i) \
90 V(I32LoadMem8U, 0x21, i_i) \
91 V(I32LoadMem16S, 0x22, i_i) \
92 V(I32LoadMem16U, 0x23, i_i) \
93 V(I64LoadMem8S, 0x24, l_i) \
94 V(I64LoadMem8U, 0x25, l_i) \
95 V(I64LoadMem16S, 0x26, l_i) \
96 V(I64LoadMem16U, 0x27, l_i) \
97 V(I64LoadMem32S, 0x28, l_i) \
98 V(I64LoadMem32U, 0x29, l_i) \
99 V(I32LoadMem, 0x2a, i_i) \
100 V(I64LoadMem, 0x2b, l_i) \
101 V(F32LoadMem, 0x2c, f_i) \
102 V(F64LoadMem, 0x2d, d_i)
103
104// Store memory expressions.
105#define FOREACH_STORE_MEM_OPCODE(V) \
106 V(I32StoreMem8, 0x2e, i_ii) \
107 V(I32StoreMem16, 0x2f, i_ii) \
108 V(I64StoreMem8, 0x30, l_il) \
109 V(I64StoreMem16, 0x31, l_il) \
110 V(I64StoreMem32, 0x32, l_il) \
111 V(I32StoreMem, 0x33, i_ii) \
112 V(I64StoreMem, 0x34, l_il) \
113 V(F32StoreMem, 0x35, f_if) \
114 V(F64StoreMem, 0x36, d_id)
115
116// Load memory expressions.
117#define FOREACH_MISC_MEM_OPCODE(V) \
118 V(MemorySize, 0x3b, i_v) \
119 V(GrowMemory, 0x39, i_i)
120
121// Expressions with signatures.
122#define FOREACH_SIMPLE_OPCODE(V) \
123 V(I32Add, 0x40, i_ii) \
124 V(I32Sub, 0x41, i_ii) \
125 V(I32Mul, 0x42, i_ii) \
126 V(I32DivS, 0x43, i_ii) \
127 V(I32DivU, 0x44, i_ii) \
128 V(I32RemS, 0x45, i_ii) \
129 V(I32RemU, 0x46, i_ii) \
130 V(I32And, 0x47, i_ii) \
131 V(I32Ior, 0x48, i_ii) \
132 V(I32Xor, 0x49, i_ii) \
133 V(I32Shl, 0x4a, i_ii) \
134 V(I32ShrU, 0x4b, i_ii) \
135 V(I32ShrS, 0x4c, i_ii) \
136 V(I32Eq, 0x4d, i_ii) \
137 V(I32Ne, 0x4e, i_ii) \
138 V(I32LtS, 0x4f, i_ii) \
139 V(I32LeS, 0x50, i_ii) \
140 V(I32LtU, 0x51, i_ii) \
141 V(I32LeU, 0x52, i_ii) \
142 V(I32GtS, 0x53, i_ii) \
143 V(I32GeS, 0x54, i_ii) \
144 V(I32GtU, 0x55, i_ii) \
145 V(I32GeU, 0x56, i_ii) \
146 V(I32Clz, 0x57, i_i) \
147 V(I32Ctz, 0x58, i_i) \
148 V(I32Popcnt, 0x59, i_i) \
Ben Murdochda12d292016-06-02 14:46:10 +0100149 V(I32Eqz, 0x5a, i_i) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000150 V(I64Add, 0x5b, l_ll) \
151 V(I64Sub, 0x5c, l_ll) \
152 V(I64Mul, 0x5d, l_ll) \
153 V(I64DivS, 0x5e, l_ll) \
154 V(I64DivU, 0x5f, l_ll) \
155 V(I64RemS, 0x60, l_ll) \
156 V(I64RemU, 0x61, l_ll) \
157 V(I64And, 0x62, l_ll) \
158 V(I64Ior, 0x63, l_ll) \
159 V(I64Xor, 0x64, l_ll) \
160 V(I64Shl, 0x65, l_ll) \
161 V(I64ShrU, 0x66, l_ll) \
162 V(I64ShrS, 0x67, l_ll) \
163 V(I64Eq, 0x68, i_ll) \
164 V(I64Ne, 0x69, i_ll) \
165 V(I64LtS, 0x6a, i_ll) \
166 V(I64LeS, 0x6b, i_ll) \
167 V(I64LtU, 0x6c, i_ll) \
168 V(I64LeU, 0x6d, i_ll) \
169 V(I64GtS, 0x6e, i_ll) \
170 V(I64GeS, 0x6f, i_ll) \
171 V(I64GtU, 0x70, i_ll) \
172 V(I64GeU, 0x71, i_ll) \
173 V(I64Clz, 0x72, l_l) \
174 V(I64Ctz, 0x73, l_l) \
175 V(I64Popcnt, 0x74, l_l) \
Ben Murdochda12d292016-06-02 14:46:10 +0100176 V(I64Eqz, 0xba, i_l) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000177 V(F32Add, 0x75, f_ff) \
178 V(F32Sub, 0x76, f_ff) \
179 V(F32Mul, 0x77, f_ff) \
180 V(F32Div, 0x78, f_ff) \
181 V(F32Min, 0x79, f_ff) \
182 V(F32Max, 0x7a, f_ff) \
183 V(F32Abs, 0x7b, f_f) \
184 V(F32Neg, 0x7c, f_f) \
185 V(F32CopySign, 0x7d, f_ff) \
186 V(F32Ceil, 0x7e, f_f) \
187 V(F32Floor, 0x7f, f_f) \
188 V(F32Trunc, 0x80, f_f) \
189 V(F32NearestInt, 0x81, f_f) \
190 V(F32Sqrt, 0x82, f_f) \
191 V(F32Eq, 0x83, i_ff) \
192 V(F32Ne, 0x84, i_ff) \
193 V(F32Lt, 0x85, i_ff) \
194 V(F32Le, 0x86, i_ff) \
195 V(F32Gt, 0x87, i_ff) \
196 V(F32Ge, 0x88, i_ff) \
197 V(F64Add, 0x89, d_dd) \
198 V(F64Sub, 0x8a, d_dd) \
199 V(F64Mul, 0x8b, d_dd) \
200 V(F64Div, 0x8c, d_dd) \
201 V(F64Min, 0x8d, d_dd) \
202 V(F64Max, 0x8e, d_dd) \
203 V(F64Abs, 0x8f, d_d) \
204 V(F64Neg, 0x90, d_d) \
205 V(F64CopySign, 0x91, d_dd) \
206 V(F64Ceil, 0x92, d_d) \
207 V(F64Floor, 0x93, d_d) \
208 V(F64Trunc, 0x94, d_d) \
209 V(F64NearestInt, 0x95, d_d) \
210 V(F64Sqrt, 0x96, d_d) \
211 V(F64Eq, 0x97, i_dd) \
212 V(F64Ne, 0x98, i_dd) \
213 V(F64Lt, 0x99, i_dd) \
214 V(F64Le, 0x9a, i_dd) \
215 V(F64Gt, 0x9b, i_dd) \
216 V(F64Ge, 0x9c, i_dd) \
217 V(I32SConvertF32, 0x9d, i_f) \
218 V(I32SConvertF64, 0x9e, i_d) \
219 V(I32UConvertF32, 0x9f, i_f) \
220 V(I32UConvertF64, 0xa0, i_d) \
221 V(I32ConvertI64, 0xa1, i_l) \
222 V(I64SConvertF32, 0xa2, l_f) \
223 V(I64SConvertF64, 0xa3, l_d) \
224 V(I64UConvertF32, 0xa4, l_f) \
225 V(I64UConvertF64, 0xa5, l_d) \
226 V(I64SConvertI32, 0xa6, l_i) \
227 V(I64UConvertI32, 0xa7, l_i) \
228 V(F32SConvertI32, 0xa8, f_i) \
229 V(F32UConvertI32, 0xa9, f_i) \
230 V(F32SConvertI64, 0xaa, f_l) \
231 V(F32UConvertI64, 0xab, f_l) \
232 V(F32ConvertF64, 0xac, f_d) \
233 V(F32ReinterpretI32, 0xad, f_i) \
234 V(F64SConvertI32, 0xae, d_i) \
235 V(F64UConvertI32, 0xaf, d_i) \
236 V(F64SConvertI64, 0xb0, d_l) \
237 V(F64UConvertI64, 0xb1, d_l) \
238 V(F64ConvertF32, 0xb2, d_f) \
239 V(F64ReinterpretI64, 0xb3, d_l) \
240 V(I32ReinterpretF32, 0xb4, i_f) \
Ben Murdochda12d292016-06-02 14:46:10 +0100241 V(I64ReinterpretF64, 0xb5, l_d) \
242 V(I32Ror, 0xb6, i_ii) \
243 V(I32Rol, 0xb7, i_ii) \
244 V(I64Ror, 0xb8, l_ll) \
245 V(I64Rol, 0xb9, l_ll)
246
247// For compatibility with Asm.js.
248#define FOREACH_ASMJS_COMPAT_OPCODE(V) \
249 V(F64Acos, 0xc0, d_d) \
250 V(F64Asin, 0xc1, d_d) \
251 V(F64Atan, 0xc2, d_d) \
252 V(F64Cos, 0xc3, d_d) \
253 V(F64Sin, 0xc4, d_d) \
254 V(F64Tan, 0xc5, d_d) \
255 V(F64Exp, 0xc6, d_d) \
256 V(F64Log, 0xc7, d_d) \
257 V(F64Atan2, 0xc8, d_dd) \
258 V(F64Pow, 0xc9, d_dd) \
Ben Murdochc5610432016-08-08 18:44:38 +0100259 V(F64Mod, 0xca, d_dd) \
260 V(I32AsmjsDivS, 0xd0, i_ii) \
261 V(I32AsmjsDivU, 0xd1, i_ii) \
262 V(I32AsmjsRemS, 0xd2, i_ii) \
263 V(I32AsmjsRemU, 0xd3, i_ii) \
264 V(I32AsmjsLoadMem8S, 0xd4, i_i) \
265 V(I32AsmjsLoadMem8U, 0xd5, i_i) \
266 V(I32AsmjsLoadMem16S, 0xd6, i_i) \
267 V(I32AsmjsLoadMem16U, 0xd7, i_i) \
268 V(I32AsmjsLoadMem, 0xd8, i_i) \
269 V(F32AsmjsLoadMem, 0xd9, f_i) \
270 V(F64AsmjsLoadMem, 0xda, d_i) \
271 V(I32AsmjsStoreMem8, 0xdb, i_ii) \
272 V(I32AsmjsStoreMem16, 0xdc, i_ii) \
273 V(I32AsmjsStoreMem, 0xdd, i_ii) \
274 V(F32AsmjsStoreMem, 0xde, f_if) \
275 V(F64AsmjsStoreMem, 0xdf, d_id) \
276 V(I32AsmjsSConvertF32, 0xe0, i_f) \
277 V(I32AsmjsUConvertF32, 0xe1, i_f) \
278 V(I32AsmjsSConvertF64, 0xe2, i_d) \
279 V(I32AsmjsUConvertF64, 0xe3, i_d)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000280
281// All opcodes.
282#define FOREACH_OPCODE(V) \
283 FOREACH_CONTROL_OPCODE(V) \
284 FOREACH_MISC_OPCODE(V) \
285 FOREACH_SIMPLE_OPCODE(V) \
286 FOREACH_STORE_MEM_OPCODE(V) \
287 FOREACH_LOAD_MEM_OPCODE(V) \
Ben Murdochda12d292016-06-02 14:46:10 +0100288 FOREACH_MISC_MEM_OPCODE(V) \
289 FOREACH_ASMJS_COMPAT_OPCODE(V)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000290
291// All signatures.
292#define FOREACH_SIGNATURE(V) \
293 V(i_ii, kAstI32, kAstI32, kAstI32) \
294 V(i_i, kAstI32, kAstI32) \
295 V(i_v, kAstI32) \
296 V(i_ff, kAstI32, kAstF32, kAstF32) \
297 V(i_f, kAstI32, kAstF32) \
298 V(i_dd, kAstI32, kAstF64, kAstF64) \
299 V(i_d, kAstI32, kAstF64) \
300 V(i_l, kAstI32, kAstI64) \
301 V(l_ll, kAstI64, kAstI64, kAstI64) \
302 V(i_ll, kAstI32, kAstI64, kAstI64) \
303 V(l_l, kAstI64, kAstI64) \
304 V(l_i, kAstI64, kAstI32) \
305 V(l_f, kAstI64, kAstF32) \
306 V(l_d, kAstI64, kAstF64) \
307 V(f_ff, kAstF32, kAstF32, kAstF32) \
308 V(f_f, kAstF32, kAstF32) \
309 V(f_d, kAstF32, kAstF64) \
310 V(f_i, kAstF32, kAstI32) \
311 V(f_l, kAstF32, kAstI64) \
312 V(d_dd, kAstF64, kAstF64, kAstF64) \
313 V(d_d, kAstF64, kAstF64) \
314 V(d_f, kAstF64, kAstF32) \
315 V(d_i, kAstF64, kAstI32) \
316 V(d_l, kAstF64, kAstI64) \
317 V(d_id, kAstF64, kAstI32, kAstF64) \
318 V(f_if, kAstF32, kAstI32, kAstF32) \
319 V(l_il, kAstI64, kAstI32, kAstI64)
320
321enum WasmOpcode {
322// Declare expression opcodes.
323#define DECLARE_NAMED_ENUM(name, opcode, sig) kExpr##name = opcode,
324 FOREACH_OPCODE(DECLARE_NAMED_ENUM)
325#undef DECLARE_NAMED_ENUM
326};
327
Ben Murdochda12d292016-06-02 14:46:10 +0100328// The reason for a trap.
Ben Murdochc5610432016-08-08 18:44:38 +0100329#define FOREACH_WASM_TRAPREASON(V) \
330 V(TrapUnreachable) \
331 V(TrapMemOutOfBounds) \
332 V(TrapDivByZero) \
333 V(TrapDivUnrepresentable) \
334 V(TrapRemByZero) \
335 V(TrapFloatUnrepresentable) \
336 V(TrapFuncInvalid) \
337 V(TrapFuncSigMismatch)
338
Ben Murdochda12d292016-06-02 14:46:10 +0100339enum TrapReason {
Ben Murdochc5610432016-08-08 18:44:38 +0100340#define DECLARE_ENUM(name) k##name,
341 FOREACH_WASM_TRAPREASON(DECLARE_ENUM)
Ben Murdochda12d292016-06-02 14:46:10 +0100342 kTrapCount
Ben Murdochc5610432016-08-08 18:44:38 +0100343#undef DECLARE_ENUM
Ben Murdochda12d292016-06-02 14:46:10 +0100344};
345
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000346// A collection of opcode-related static methods.
347class WasmOpcodes {
348 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000349 static const char* OpcodeName(WasmOpcode opcode);
Ben Murdochc5610432016-08-08 18:44:38 +0100350 static const char* ShortOpcodeName(WasmOpcode opcode);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000351 static FunctionSig* Signature(WasmOpcode opcode);
352
Ben Murdochc5610432016-08-08 18:44:38 +0100353 static int TrapReasonToMessageId(TrapReason reason);
354 static const char* TrapReasonMessage(TrapReason reason);
355
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000356 static byte MemSize(MachineType type) {
357 return 1 << ElementSizeLog2Of(type.representation());
358 }
359
360 static LocalTypeCode LocalTypeCodeFor(LocalType type) {
361 switch (type) {
362 case kAstI32:
363 return kLocalI32;
364 case kAstI64:
365 return kLocalI64;
366 case kAstF32:
367 return kLocalF32;
368 case kAstF64:
369 return kLocalF64;
370 case kAstStmt:
371 return kLocalVoid;
372 default:
373 UNREACHABLE();
374 return kLocalVoid;
375 }
376 }
377
378 static MemTypeCode MemTypeCodeFor(MachineType type) {
379 if (type == MachineType::Int8()) {
380 return kMemI8;
381 } else if (type == MachineType::Uint8()) {
382 return kMemU8;
383 } else if (type == MachineType::Int16()) {
384 return kMemI16;
385 } else if (type == MachineType::Uint16()) {
386 return kMemU16;
387 } else if (type == MachineType::Int32()) {
388 return kMemI32;
389 } else if (type == MachineType::Uint32()) {
390 return kMemU32;
391 } else if (type == MachineType::Int64()) {
392 return kMemI64;
393 } else if (type == MachineType::Uint64()) {
394 return kMemU64;
395 } else if (type == MachineType::Float32()) {
396 return kMemF32;
397 } else if (type == MachineType::Float64()) {
398 return kMemF64;
399 } else {
400 UNREACHABLE();
401 return kMemI32;
402 }
403 }
404
405 static MachineType MachineTypeFor(LocalType type) {
406 switch (type) {
407 case kAstI32:
408 return MachineType::Int32();
409 case kAstI64:
410 return MachineType::Int64();
411 case kAstF32:
412 return MachineType::Float32();
413 case kAstF64:
414 return MachineType::Float64();
415 case kAstStmt:
416 return MachineType::None();
417 default:
418 UNREACHABLE();
419 return MachineType::None();
420 }
421 }
422
423 static LocalType LocalTypeFor(MachineType type) {
424 if (type == MachineType::Int8()) {
425 return kAstI32;
426 } else if (type == MachineType::Uint8()) {
427 return kAstI32;
428 } else if (type == MachineType::Int16()) {
429 return kAstI32;
430 } else if (type == MachineType::Uint16()) {
431 return kAstI32;
432 } else if (type == MachineType::Int32()) {
433 return kAstI32;
434 } else if (type == MachineType::Uint32()) {
435 return kAstI32;
436 } else if (type == MachineType::Int64()) {
437 return kAstI64;
438 } else if (type == MachineType::Uint64()) {
439 return kAstI64;
440 } else if (type == MachineType::Float32()) {
441 return kAstF32;
442 } else if (type == MachineType::Float64()) {
443 return kAstF64;
444 } else {
445 UNREACHABLE();
446 return kAstI32;
447 }
448 }
449
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000450 static WasmOpcode LoadStoreOpcodeOf(MachineType type, bool store) {
451 if (type == MachineType::Int8()) {
452 return store ? kExprI32StoreMem8 : kExprI32LoadMem8S;
453 } else if (type == MachineType::Uint8()) {
454 return store ? kExprI32StoreMem8 : kExprI32LoadMem8U;
455 } else if (type == MachineType::Int16()) {
456 return store ? kExprI32StoreMem16 : kExprI32LoadMem16S;
457 } else if (type == MachineType::Uint16()) {
458 return store ? kExprI32StoreMem16 : kExprI32LoadMem16U;
459 } else if (type == MachineType::Int32()) {
460 return store ? kExprI32StoreMem : kExprI32LoadMem;
461 } else if (type == MachineType::Uint32()) {
462 return store ? kExprI32StoreMem : kExprI32LoadMem;
463 } else if (type == MachineType::Int64()) {
464 return store ? kExprI64StoreMem : kExprI64LoadMem;
465 } else if (type == MachineType::Uint64()) {
466 return store ? kExprI64StoreMem : kExprI64LoadMem;
467 } else if (type == MachineType::Float32()) {
468 return store ? kExprF32StoreMem : kExprF32LoadMem;
469 } else if (type == MachineType::Float64()) {
470 return store ? kExprF64StoreMem : kExprF64LoadMem;
471 } else {
472 UNREACHABLE();
473 return kExprNop;
474 }
475 }
476
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000477 static char ShortNameOf(LocalType type) {
478 switch (type) {
479 case kAstI32:
480 return 'i';
481 case kAstI64:
482 return 'l';
483 case kAstF32:
484 return 'f';
485 case kAstF64:
486 return 'd';
487 case kAstStmt:
488 return 'v';
489 case kAstEnd:
490 return 'x';
491 default:
492 UNREACHABLE();
493 return '?';
494 }
495 }
496
497 static const char* TypeName(LocalType type) {
498 switch (type) {
499 case kAstI32:
500 return "i32";
501 case kAstI64:
502 return "i64";
503 case kAstF32:
504 return "f32";
505 case kAstF64:
506 return "f64";
507 case kAstStmt:
508 return "<stmt>";
509 case kAstEnd:
510 return "<end>";
511 default:
512 return "<unknown>";
513 }
514 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000515};
516} // namespace wasm
517} // namespace internal
518} // namespace v8
519
520#endif // V8_WASM_OPCODES_H_