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

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

Issue 1880493002: Move TrapReason messages over to messages.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@include-objects-in-messages
Patch Set: rebase Created 4 years, 8 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/wasm-opcodes.h ('k') | no next file » | 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/signature.h" 7 #include "src/signature.h"
7 8
8 namespace v8 { 9 namespace v8 {
9 namespace internal { 10 namespace internal {
10 namespace wasm { 11 namespace wasm {
11 12
12 typedef Signature<LocalType> FunctionSig; 13 typedef Signature<LocalType> FunctionSig;
13 14
14 const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) { 15 const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
15 switch (opcode) { 16 switch (opcode) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 case kExprI64UConvertF64: 139 case kExprI64UConvertF64:
139 140
140 return false; 141 return false;
141 default: 142 default:
142 return true; 143 return true;
143 } 144 }
144 #else 145 #else
145 return true; 146 return true;
146 #endif 147 #endif
147 } 148 }
149
150 int WasmOpcodes::TrapReasonToMessageId(TrapReason reason) {
151 switch (reason) {
152 #define TRAPREASON_TO_MESSAGE(name) \
153 case k##name: \
154 return MessageTemplate::kWasm##name;
155 FOREACH_WASM_TRAPREASON(TRAPREASON_TO_MESSAGE)
156 #undef TRAPREASON_TO_MESSAGE
157 default:
158 return MessageTemplate::kNone;
159 }
160 }
161
162 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) {
163 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason));
164 }
148 } // namespace wasm 165 } // namespace wasm
149 } // namespace internal 166 } // namespace internal
150 } // namespace v8 167 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/wasm-opcodes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698