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

Side by Side Diff: src/wasm/wasm-module.h

Issue 1648503003: [wasm] Fix CallIndirect with the case of no indirect function table. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/compiler/wasm-compiler.cc ('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 #ifndef V8_WASM_MODULE_H_ 5 #ifndef V8_WASM_MODULE_H_
6 #define V8_WASM_MODULE_H_ 6 #define V8_WASM_MODULE_H_
7 7
8 #include "src/wasm/wasm-opcodes.h" 8 #include "src/wasm/wasm-opcodes.h"
9 #include "src/wasm/wasm-result.h" 9 #include "src/wasm/wasm-result.h"
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 FunctionSig* GetFunctionSignature(uint32_t index) { 174 FunctionSig* GetFunctionSignature(uint32_t index) {
175 DCHECK(IsValidFunction(index)); 175 DCHECK(IsValidFunction(index));
176 return module->functions->at(index).sig; 176 return module->functions->at(index).sig;
177 } 177 }
178 FunctionSig* GetSignature(uint32_t index) { 178 FunctionSig* GetSignature(uint32_t index) {
179 DCHECK(IsValidSignature(index)); 179 DCHECK(IsValidSignature(index));
180 return module->signatures->at(index); 180 return module->signatures->at(index);
181 } 181 }
182 size_t FunctionTableSize() { 182 size_t FunctionTableSize() {
183 return module ? module->function_table->size() : 0; 183 return module && module->function_table ? module->function_table->size()
184 : 0;
184 } 185 }
185 186
186 Handle<Code> GetFunctionCode(uint32_t index); 187 Handle<Code> GetFunctionCode(uint32_t index);
187 Handle<FixedArray> GetFunctionTable(); 188 Handle<FixedArray> GetFunctionTable();
188 189
189 compiler::CallDescriptor* GetWasmCallDescriptor(Zone* zone, FunctionSig* sig); 190 compiler::CallDescriptor* GetWasmCallDescriptor(Zone* zone, FunctionSig* sig);
190 compiler::CallDescriptor* GetCallDescriptor(Zone* zone, uint32_t index); 191 compiler::CallDescriptor* GetCallDescriptor(Zone* zone, uint32_t index);
191 }; 192 };
192 193
193 std::ostream& operator<<(std::ostream& os, const WasmModule& module); 194 std::ostream& operator<<(std::ostream& os, const WasmModule& module);
194 std::ostream& operator<<(std::ostream& os, const WasmFunction& function); 195 std::ostream& operator<<(std::ostream& os, const WasmFunction& function);
195 196
196 typedef Result<WasmModule*> ModuleResult; 197 typedef Result<WasmModule*> ModuleResult;
197 typedef Result<WasmFunction*> FunctionResult; 198 typedef Result<WasmFunction*> FunctionResult;
198 199
199 // For testing. Decode, verify, and run the last exported function in the 200 // For testing. Decode, verify, and run the last exported function in the
200 // given encoded module. 201 // given encoded module.
201 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, 202 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
202 const byte* module_end, bool asm_js = false); 203 const byte* module_end, bool asm_js = false);
203 204
204 // For testing. Decode, verify, and run the last exported function in the 205 // For testing. Decode, verify, and run the last exported function in the
205 // given decoded module. 206 // given decoded module.
206 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module); 207 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module);
207 } // namespace wasm 208 } // namespace wasm
208 } // namespace internal 209 } // namespace internal
209 } // namespace v8 210 } // namespace v8
210 211
211 #endif // V8_WASM_MODULE_H_ 212 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698