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

Unified Diff: src/wasm/wasm-debug.h

Issue 2050953003: [wasm] Split off debug info from wasm object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@decode-function-offsets-table
Patch Set: Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/v8.gyp ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « src/v8.gyp ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698