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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/api.h" | 10 #include "src/api.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
394 const WasmModule* module); | 394 const WasmModule* module); |
395 | 395 |
396 // Populates a function table by replacing function indices with handles to | 396 // Populates a function table by replacing function indices with handles to |
397 // the compiled code. | 397 // the compiled code. |
398 void PopulateFunctionTable(Handle<FixedArray> table, uint32_t table_size, | 398 void PopulateFunctionTable(Handle<FixedArray> table, uint32_t table_size, |
399 const std::vector<Handle<Code>>* code_table); | 399 const std::vector<Handle<Code>>* code_table); |
400 | 400 |
401 Handle<JSObject> CreateCompiledModuleObject(Isolate* isolate, | 401 Handle<JSObject> CreateCompiledModuleObject(Isolate* isolate, |
402 Handle<FixedArray> compiled_module); | 402 Handle<FixedArray> compiled_module); |
403 | 403 |
404 MaybeHandle<JSObject> CreateModuleObjectFromBytes( | |
405 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower, | |
406 bool verify, ModuleOrigin origin); | |
bradnelson
2016/09/01 03:48:31
None of the callers use the verify option being tr
Mircea Trofin
2016/09/01 04:36:18
Done.
| |
407 | |
404 // Assumed to be called with a code object associated to a wasm module instance. | 408 // Assumed to be called with a code object associated to a wasm module instance. |
405 // Intended to be called from runtime functions. | 409 // Intended to be called from runtime functions. |
406 // Returns undefined if the runtime support was not setup, nullptr if the | 410 // Returns undefined if the runtime support was not setup, nullptr if the |
407 // instance | 411 // instance |
408 // was collected, or the instance object owning the Code object | 412 // was collected, or the instance object owning the Code object |
409 Object* GetOwningWasmInstance(Object* undefined, Code* code); | 413 Object* GetOwningWasmInstance(Object* undefined, Code* code); |
410 | 414 |
411 namespace testing { | 415 namespace testing { |
412 | 416 |
413 // Decode, verify, and run the function labeled "main" in the | 417 // Decode, verify, and run the function labeled "main" in the |
414 // given encoded module. The module should have no imports. | 418 // given encoded module. The module should have no imports. |
415 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 419 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |
416 const byte* module_end, bool asm_js = false); | 420 const byte* module_end, bool asm_js = false); |
417 | 421 |
418 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance, | 422 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance, |
419 ErrorThrower* thrower, const char* name, int argc, | 423 ErrorThrower* thrower, const char* name, int argc, |
420 Handle<Object> argv[], bool asm_js = false); | 424 Handle<Object> argv[], bool asm_js = false); |
421 } // namespace testing | 425 } // namespace testing |
422 } // namespace wasm | 426 } // namespace wasm |
423 } // namespace internal | 427 } // namespace internal |
424 } // namespace v8 | 428 } // namespace v8 |
425 | 429 |
426 #endif // V8_WASM_MODULE_H_ | 430 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |