| 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" |
| 11 #include "src/debug/debug-interface.h" |
| 11 #include "src/globals.h" | 12 #include "src/globals.h" |
| 12 #include "src/handles.h" | 13 #include "src/handles.h" |
| 13 #include "src/parsing/preparse-data.h" | 14 #include "src/parsing/preparse-data.h" |
| 14 | 15 |
| 15 #include "src/wasm/managed.h" | 16 #include "src/wasm/managed.h" |
| 16 #include "src/wasm/signature-map.h" | 17 #include "src/wasm/signature-map.h" |
| 17 #include "src/wasm/wasm-opcodes.h" | 18 #include "src/wasm/wasm-opcodes.h" |
| 18 | 19 |
| 19 namespace v8 { | 20 namespace v8 { |
| 20 namespace internal { | 21 namespace internal { |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 // Get the script of the wasm module. If the origin of the module is asm.js, the | 385 // Get the script of the wasm module. If the origin of the module is asm.js, the |
| 385 // returned Script will be a JavaScript Script of Script::TYPE_NORMAL, otherwise | 386 // returned Script will be a JavaScript Script of Script::TYPE_NORMAL, otherwise |
| 386 // it's of type TYPE_WASM. | 387 // it's of type TYPE_WASM. |
| 387 Handle<Script> GetScript(Handle<JSObject> instance); | 388 Handle<Script> GetScript(Handle<JSObject> instance); |
| 388 | 389 |
| 389 // Compute the disassembly of a wasm function. | 390 // Compute the disassembly of a wasm function. |
| 390 // Returns the disassembly string and a list of <byte_offset, line, column> | 391 // Returns the disassembly string and a list of <byte_offset, line, column> |
| 391 // entries, mapping wasm byte offsets to line and column in the disassembly. | 392 // entries, mapping wasm byte offsets to line and column in the disassembly. |
| 392 // The list is guaranteed to be ordered by the byte_offset. | 393 // The list is guaranteed to be ordered by the byte_offset. |
| 393 // Returns an empty string and empty vector if the function index is invalid. | 394 // Returns an empty string and empty vector if the function index is invalid. |
| 394 std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>> | 395 DebugInterface::WasmDisassembly DisassembleFunction( |
| 395 DisassembleFunction(Handle<WasmCompiledModule> compiled_module, int func_index); | 396 Handle<WasmCompiledModule> compiled_module, int func_index); |
| 396 | 397 |
| 397 // Get the asm.js source position for the given byte offset in the given | 398 // Get the asm.js source position for the given byte offset in the given |
| 398 // function. | 399 // function. |
| 399 int GetAsmWasmSourcePosition(Handle<JSObject> instance, int func_index, | 400 int GetAsmWasmSourcePosition(Handle<JSObject> instance, int func_index, |
| 400 int byte_offset); | 401 int byte_offset); |
| 401 | 402 |
| 402 V8_EXPORT_PRIVATE MaybeHandle<WasmModuleObject> CreateModuleObjectFromBytes( | 403 V8_EXPORT_PRIVATE MaybeHandle<WasmModuleObject> CreateModuleObjectFromBytes( |
| 403 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower, | 404 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower, |
| 404 ModuleOrigin origin, Handle<Script> asm_js_script, | 405 ModuleOrigin origin, Handle<Script> asm_js_script, |
| 405 const byte* asm_offset_tables_start, const byte* asm_offset_tables_end); | 406 const byte* asm_offset_tables_start, const byte* asm_offset_tables_end); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); | 448 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); |
| 448 void ValidateOrphanedInstance(Isolate* isolate, | 449 void ValidateOrphanedInstance(Isolate* isolate, |
| 449 Handle<WasmInstanceObject> instance); | 450 Handle<WasmInstanceObject> instance); |
| 450 | 451 |
| 451 } // namespace testing | 452 } // namespace testing |
| 452 } // namespace wasm | 453 } // namespace wasm |
| 453 } // namespace internal | 454 } // namespace internal |
| 454 } // namespace v8 | 455 } // namespace v8 |
| 455 | 456 |
| 456 #endif // V8_WASM_MODULE_H_ | 457 #endif // V8_WASM_MODULE_H_ |
| OLD | NEW |