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

Side by Side Diff: src/wasm/wasm-opcodes.cc

Issue 2594993002: [wasm] Rename wasm::LocalType to wasm::ValueType and kAst* to kWasm* (Closed)
Patch Set: Fix inspector tests 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // 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 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 #include "src/wasm/wasm-opcodes.h" 5 #include "src/wasm/wasm-opcodes.h"
6 #include "src/messages.h" 6 #include "src/messages.h"
7 #include "src/runtime/runtime.h" 7 #include "src/runtime/runtime.h"
8 #include "src/signature.h" 8 #include "src/signature.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 namespace wasm { 12 namespace wasm {
13 13
14 typedef Signature<LocalType> FunctionSig; 14 typedef Signature<ValueType> FunctionSig;
15 15
16 const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) { 16 const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
17 switch (opcode) { 17 switch (opcode) {
18 #define DECLARE_NAME_CASE(name, opcode, sig) \ 18 #define DECLARE_NAME_CASE(name, opcode, sig) \
19 case kExpr##name: \ 19 case kExpr##name: \
20 return "Expr" #name; 20 return "Expr" #name;
21 FOREACH_OPCODE(DECLARE_NAME_CASE) 21 FOREACH_OPCODE(DECLARE_NAME_CASE)
22 #undef DECLARE_NAME_CASE 22 #undef DECLARE_NAME_CASE
23 default: 23 default:
24 break; 24 break;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 return os; 64 return os;
65 } 65 }
66 66
67 #define DECLARE_SIG_ENUM(name, ...) kSigEnum_##name, 67 #define DECLARE_SIG_ENUM(name, ...) kSigEnum_##name,
68 68
69 enum WasmOpcodeSig { FOREACH_SIGNATURE(DECLARE_SIG_ENUM) }; 69 enum WasmOpcodeSig { FOREACH_SIGNATURE(DECLARE_SIG_ENUM) };
70 70
71 // TODO(titzer): not static-initializer safe. Wrap in LazyInstance. 71 // TODO(titzer): not static-initializer safe. Wrap in LazyInstance.
72 #define DECLARE_SIG(name, ...) \ 72 #define DECLARE_SIG(name, ...) \
73 static LocalType kTypes_##name[] = {__VA_ARGS__}; \ 73 static ValueType kTypes_##name[] = {__VA_ARGS__}; \
74 static const FunctionSig kSig_##name( \ 74 static const FunctionSig kSig_##name( \
75 1, static_cast<int>(arraysize(kTypes_##name)) - 1, kTypes_##name); 75 1, static_cast<int>(arraysize(kTypes_##name)) - 1, kTypes_##name);
76 76
77 FOREACH_SIGNATURE(DECLARE_SIG) 77 FOREACH_SIGNATURE(DECLARE_SIG)
78 78
79 #define DECLARE_SIG_ENTRY(name, ...) &kSig_##name, 79 #define DECLARE_SIG_ENTRY(name, ...) &kSig_##name,
80 80
81 static const FunctionSig* kSimpleExprSigs[] = { 81 static const FunctionSig* kSimpleExprSigs[] = {
82 nullptr, FOREACH_SIGNATURE(DECLARE_SIG_ENTRY)}; 82 nullptr, FOREACH_SIGNATURE(DECLARE_SIG_ENTRY)};
83 83
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return MessageTemplate::kNone; 175 return MessageTemplate::kNone;
176 } 176 }
177 } 177 }
178 178
179 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) { 179 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) {
180 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason)); 180 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason));
181 } 181 }
182 } // namespace wasm 182 } // namespace wasm
183 } // namespace internal 183 } // namespace internal
184 } // namespace v8 184 } // namespace v8
OLDNEW
« 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