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

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

Issue 2571813002: [wasm] TrapIf and TrapUnless TurboFan operators implemented on ia32. (Closed)
Patch Set: Move TrapReasonToFunctionId from wasm-opcodes to wasm-compiler 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') | 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/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 {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 #define TRAPREASON_TO_MESSAGE(name) \ 169 #define TRAPREASON_TO_MESSAGE(name) \
170 case k##name: \ 170 case k##name: \
171 return MessageTemplate::kWasm##name; 171 return MessageTemplate::kWasm##name;
172 FOREACH_WASM_TRAPREASON(TRAPREASON_TO_MESSAGE) 172 FOREACH_WASM_TRAPREASON(TRAPREASON_TO_MESSAGE)
173 #undef TRAPREASON_TO_MESSAGE 173 #undef TRAPREASON_TO_MESSAGE
174 default: 174 default:
175 return MessageTemplate::kNone; 175 return MessageTemplate::kNone;
176 } 176 }
177 } 177 }
178 178
179 int32_t WasmOpcodes::TrapReasonToFunctionId(TrapReason reason) {
180 switch (reason) {
181 #define TRAPREASON_TO_MESSAGE(name) \
182 case k##name: \
183 return static_cast<int32_t>(Runtime::kThrowWasm##name);
184 FOREACH_WASM_TRAPREASON(TRAPREASON_TO_MESSAGE)
185 #undef TRAPREASON_TO_MESSAGE
186 default:
187 UNREACHABLE();
188 return -1;
189 }
190 }
191
192 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) { 179 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) {
193 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason)); 180 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason));
194 } 181 }
195 } // namespace wasm 182 } // namespace wasm
196 } // namespace internal 183 } // namespace internal
197 } // namespace v8 184 } // 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