Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef V8_WASM_DEBUG_H_ | |
| 6 #define V8_WASM_DEBUG_H_ | |
| 7 | |
| 8 #include "src/handles.h" | |
| 9 #include "src/objects.h" | |
| 10 | |
| 11 namespace v8 { | |
| 12 namespace internal { | |
| 13 namespace wasm { | |
| 14 | |
| 15 class WasmDebugInfo : public JSObject { | |
|
titzer
2016/06/10 10:59:26
Why not a fixed array?
clemensh
2016/06/10 11:06:02
Where is the benefit? Is it more lightweight?
I th
| |
| 16 public: | |
| 17 static Handle<WasmDebugInfo> New(Handle<JSObject> wasm); | |
| 18 | |
| 19 static bool IsDebugInfo(Object* object); | |
| 20 static WasmDebugInfo* cast(Object* object); | |
| 21 | |
| 22 JSObject* wasm_object(); | |
| 23 | |
| 24 bool SetBreakPoint(int byte_offset); | |
| 25 | |
| 26 std::pair<int, int> GetFunctionOffsetAndLength(int func_index); | |
| 27 | |
| 28 Script* GetFunctionScript(int func_index); | |
| 29 }; | |
| 30 | |
| 31 // Compute the function offset table. | |
| 32 // Returns a JSArray with two Smis per function: offset and length. | |
| 33 // Returns undefined if the module bytes are invalid. | |
| 34 Handle<Object> GetFunctionOffsetTable(Isolate* isolate, | |
| 35 Handle<String> module_bytes); | |
| 36 | |
| 37 // Decode the given wasm binary code. | |
| 38 // Returns an array with text representation and offset table, or undefined if | |
| 39 // the wasm bytes do not represent a valid wasm function body. | |
| 40 // The boolean flags specify whether text, table or both should be generated. | |
| 41 // Ungenerated array elements will be undefined. | |
| 42 Handle<Object> DisassembleFunction(Isolate* isolate, | |
| 43 Handle<String> function_bytes, bool get_code, | |
| 44 bool get_table); | |
| 45 | |
| 46 } // namespace wasm | |
| 47 } // namespace internal | |
| 48 } // namespace v8 | |
| 49 | |
| 50 #endif // V8_WASM_DEBUG_H_ | |
| OLD | NEW |