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

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

Issue 2520943002: [wasm] Implement official wasm text format (Closed)
Patch Set: Address comments Created 4 years 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/ast-decoder.h ('k') | src/wasm/wasm-module.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 <memory> 8 #include <memory>
9 9
10 #include "src/api.h" 10 #include "src/api.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 // Get the script of the wasm module. If the origin of the module is asm.js, the 384 // 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 385 // returned Script will be a JavaScript Script of Script::TYPE_NORMAL, otherwise
386 // it's of type TYPE_WASM. 386 // it's of type TYPE_WASM.
387 Handle<Script> GetScript(Handle<JSObject> instance); 387 Handle<Script> GetScript(Handle<JSObject> instance);
388 388
389 // Compute the disassembly of a wasm function. 389 // Compute the disassembly of a wasm function.
390 // Returns the disassembly string and a list of <byte_offset, line, column> 390 // 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. 391 // entries, mapping wasm byte offsets to line and column in the disassembly.
392 // The list is guaranteed to be ordered by the byte_offset. 392 // 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.
393 std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>> 394 std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>>
394 DisassembleFunction(Handle<WasmCompiledModule> compiled_module, int func_index); 395 DisassembleFunction(Handle<WasmCompiledModule> compiled_module, int func_index);
395 396
396 // Get the asm.js source position for the given byte offset in the given 397 // Get the asm.js source position for the given byte offset in the given
397 // function. 398 // function.
398 int GetAsmWasmSourcePosition(Handle<JSObject> instance, int func_index, 399 int GetAsmWasmSourcePosition(Handle<JSObject> instance, int func_index,
399 int byte_offset); 400 int byte_offset);
400 401
401 V8_EXPORT_PRIVATE MaybeHandle<WasmModuleObject> CreateModuleObjectFromBytes( 402 V8_EXPORT_PRIVATE MaybeHandle<WasmModuleObject> CreateModuleObjectFromBytes(
402 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower, 403 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); 446 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj);
446 void ValidateOrphanedInstance(Isolate* isolate, 447 void ValidateOrphanedInstance(Isolate* isolate,
447 Handle<WasmInstanceObject> instance); 448 Handle<WasmInstanceObject> instance);
448 449
449 } // namespace testing 450 } // namespace testing
450 } // namespace wasm 451 } // namespace wasm
451 } // namespace internal 452 } // namespace internal
452 } // namespace v8 453 } // namespace v8
453 454
454 #endif // V8_WASM_MODULE_H_ 455 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/ast-decoder.h ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698