| OLD | NEW |
| 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/api.h" | 8 #include "src/api.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/wasm/wasm-opcodes.h" | 10 #include "src/wasm/wasm-opcodes.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 size_t size = module_end - module_start; | 226 size_t size = module_end - module_start; |
| 227 return start <= size && end <= size; | 227 return start <= size && end <= size; |
| 228 } | 228 } |
| 229 | 229 |
| 230 // Creates a new instantiation of the module in the given isolate. | 230 // Creates a new instantiation of the module in the given isolate. |
| 231 static MaybeHandle<JSObject> Instantiate(Isolate* isolate, | 231 static MaybeHandle<JSObject> Instantiate(Isolate* isolate, |
| 232 Handle<FixedArray> compiled_module, | 232 Handle<FixedArray> compiled_module, |
| 233 Handle<JSReceiver> ffi, | 233 Handle<JSReceiver> ffi, |
| 234 Handle<JSArrayBuffer> memory); | 234 Handle<JSArrayBuffer> memory); |
| 235 | 235 |
| 236 MaybeHandle<FixedArray> CompileFunctions(Isolate* isolate) const; | 236 MaybeHandle<FixedArray> CompileFunctions(Isolate* isolate, |
| 237 ErrorThrower* thrower) const; |
| 237 | 238 |
| 238 uint32_t FunctionTableSize() const { | 239 uint32_t FunctionTableSize() const { |
| 239 if (indirect_table_size > 0) { | 240 if (indirect_table_size > 0) { |
| 240 return indirect_table_size; | 241 return indirect_table_size; |
| 241 } | 242 } |
| 242 DCHECK_LE(function_table.size(), UINT32_MAX); | 243 DCHECK_LE(function_table.size(), UINT32_MAX); |
| 243 return static_cast<uint32_t>(function_table.size()); | 244 return static_cast<uint32_t>(function_table.size()); |
| 244 } | 245 } |
| 245 }; | 246 }; |
| 246 | 247 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // given encoded module. The module should have no imports. | 388 // given encoded module. The module should have no imports. |
| 388 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 389 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |
| 389 const byte* module_end, bool asm_js = false); | 390 const byte* module_end, bool asm_js = false); |
| 390 | 391 |
| 391 } // namespace testing | 392 } // namespace testing |
| 392 } // namespace wasm | 393 } // namespace wasm |
| 393 } // namespace internal | 394 } // namespace internal |
| 394 } // namespace v8 | 395 } // namespace v8 |
| 395 | 396 |
| 396 #endif // V8_WASM_MODULE_H_ | 397 #endif // V8_WASM_MODULE_H_ |
| OLD | NEW |