Index: src/wasm/wasm-debug.h |
diff --git a/src/wasm/wasm-debug.h b/src/wasm/wasm-debug.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..28131caa9abacdc2e58867eb0f404f561b302bca |
--- /dev/null |
+++ b/src/wasm/wasm-debug.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2016 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef V8_WASM_DEBUG_H_ |
+#define V8_WASM_DEBUG_H_ |
+ |
+#include "src/handles.h" |
+#include "src/objects.h" |
+ |
+namespace v8 { |
+namespace internal { |
+namespace wasm { |
+ |
+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
|
+ public: |
+ static Handle<WasmDebugInfo> New(Handle<JSObject> wasm); |
+ |
+ static bool IsDebugInfo(Object* object); |
+ static WasmDebugInfo* cast(Object* object); |
+ |
+ JSObject* wasm_object(); |
+ |
+ bool SetBreakPoint(int byte_offset); |
+ |
+ std::pair<int, int> GetFunctionOffsetAndLength(int func_index); |
+ |
+ Script* GetFunctionScript(int func_index); |
+}; |
+ |
+// Compute the function offset table. |
+// Returns a JSArray with two Smis per function: offset and length. |
+// Returns undefined if the module bytes are invalid. |
+Handle<Object> GetFunctionOffsetTable(Isolate* isolate, |
+ Handle<String> module_bytes); |
+ |
+// Decode the given wasm binary code. |
+// Returns an array with text representation and offset table, or undefined if |
+// the wasm bytes do not represent a valid wasm function body. |
+// The boolean flags specify whether text, table or both should be generated. |
+// Ungenerated array elements will be undefined. |
+Handle<Object> DisassembleFunction(Isolate* isolate, |
+ Handle<String> function_bytes, bool get_code, |
+ bool get_table); |
+ |
+} // namespace wasm |
+} // namespace internal |
+} // namespace v8 |
+ |
+#endif // V8_WASM_DEBUG_H_ |