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

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

Issue 1729833002: Add wasm internal opcodes for asm.js stdlib functions we're missing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 9 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') | test/mjsunit/wasm/asm-wasm.js » ('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/signature.h" 6 #include "src/signature.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace wasm { 10 namespace wasm {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 nullptr, FOREACH_SIGNATURE(DECLARE_SIG_ENTRY)}; 59 nullptr, FOREACH_SIGNATURE(DECLARE_SIG_ENTRY)};
60 60
61 static byte kSimpleExprSigTable[256]; 61 static byte kSimpleExprSigTable[256];
62 62
63 63
64 // Initialize the signature table. 64 // Initialize the signature table.
65 static void InitSigTable() { 65 static void InitSigTable() {
66 #define SET_SIG_TABLE(name, opcode, sig) \ 66 #define SET_SIG_TABLE(name, opcode, sig) \
67 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1; 67 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1;
68 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE); 68 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE);
69 FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE);
69 #undef SET_SIG_TABLE 70 #undef SET_SIG_TABLE
70 } 71 }
71 72
72 73
73 FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) { 74 FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) {
74 // TODO(titzer): use LazyInstance to make this thread safe. 75 // TODO(titzer): use LazyInstance to make this thread safe.
75 if (kSimpleExprSigTable[kExprI32Add] == 0) InitSigTable(); 76 if (kSimpleExprSigTable[kExprI32Add] == 0) InitSigTable();
76 return const_cast<FunctionSig*>( 77 return const_cast<FunctionSig*>(
77 kSimpleExprSigs[kSimpleExprSigTable[static_cast<byte>(opcode)]]); 78 kSimpleExprSigs[kSimpleExprSigTable[static_cast<byte>(opcode)]]);
78 } 79 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 default: 139 default:
139 return true; 140 return true;
140 } 141 }
141 #else 142 #else
142 return true; 143 return true;
143 #endif 144 #endif
144 } 145 }
145 } // namespace wasm 146 } // namespace wasm
146 } // namespace internal 147 } // namespace internal
147 } // namespace v8 148 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/wasm-opcodes.h ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698