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

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

Issue 1991143002: Convert SIMD wasm ops to runtime function calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Bill's review Created 4 years, 7 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
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/signature.h" 7 #include "src/signature.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 // Initialize the signature table. 73 // Initialize the signature table.
74 static void InitSigTable() { 74 static void InitSigTable() {
75 #define SET_SIG_TABLE(name, opcode, sig) \ 75 #define SET_SIG_TABLE(name, opcode, sig) \
76 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1; 76 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1;
77 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE); 77 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE);
78 FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE); 78 FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE);
79 #undef SET_SIG_TABLE 79 #undef SET_SIG_TABLE
80 } 80 }
81 81
82 bool WasmOpcodes::IsSimd(WasmOpcode opcode) {
titzer 2016/05/19 09:43:27 Could we make this into a range check instead of a
gdeepti 2016/07/01 22:24:48 Converted to a prefix check.
83 switch (opcode) {
84 #define IS_SIMD_OPCODE(name, opcode, sig) \
85 case kExpr##name: \
86 if (kExpr##name == opcode) { \
titzer 2016/05/19 09:43:27 The if here is redundant.
gdeepti 2016/07/01 22:24:48 Function now removed.
87 return true; \
88 }
89 FOREACH_SIMD_OPCODE(IS_SIMD_OPCODE)
90 #undef IS_SIMD_OPCODE
91 default:
92 return false;
93 }
94 }
95
82 class SigTable { 96 class SigTable {
83 public: 97 public:
84 SigTable() { 98 SigTable() {
85 // TODO(ahaas): Move {InitSigTable} into the class. 99 // TODO(ahaas): Move {InitSigTable} into the class.
86 InitSigTable(); 100 InitSigTable();
87 } 101 }
88 FunctionSig* Signature(WasmOpcode opcode) const { 102 FunctionSig* Signature(WasmOpcode opcode) const {
89 return const_cast<FunctionSig*>( 103 return const_cast<FunctionSig*>(
90 kSimpleExprSigs[kSimpleExprSigTable[static_cast<byte>(opcode)]]); 104 kSimpleExprSigs[kSimpleExprSigTable[static_cast<byte>(opcode)]]);
91 } 105 }
(...skipping 23 matching lines...) Expand all
115 return MessageTemplate::kNone; 129 return MessageTemplate::kNone;
116 } 130 }
117 } 131 }
118 132
119 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) { 133 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) {
120 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason)); 134 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason));
121 } 135 }
122 } // namespace wasm 136 } // namespace wasm
123 } // namespace internal 137 } // namespace internal
124 } // namespace v8 138 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698