summaryrefslogtreecommitdiff
path: root/deps/v8/src/debug/interface-types.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/debug/interface-types.h')
-rw-r--r--deps/v8/src/debug/interface-types.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/deps/v8/src/debug/interface-types.h b/deps/v8/src/debug/interface-types.h
new file mode 100644
index 0000000000..2b7072ce2b
--- /dev/null
+++ b/deps/v8/src/debug/interface-types.h
@@ -0,0 +1,75 @@
+// 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_DEBUG_INTERFACE_TYPES_H_
+#define V8_DEBUG_INTERFACE_TYPES_H_
+
+#include <cstdint>
+#include <string>
+#include <vector>
+
+namespace v8 {
+namespace debug {
+
+/**
+ * Defines location inside script.
+ * Lines and columns are 0-based.
+ */
+class Location {
+ public:
+ Location(int line_number, int column_number);
+ /**
+ * Create empty location.
+ */
+ Location();
+
+ int GetLineNumber() const;
+ int GetColumnNumber() const;
+ bool IsEmpty() const;
+
+ private:
+ int line_number_;
+ int column_number_;
+};
+
+/**
+ * The result of disassembling a wasm function.
+ * Consists of the disassembly string and an offset table mapping wasm byte
+ * offsets to line and column in the disassembly.
+ * The offset table entries are ordered by the byte_offset.
+ * All numbers are 0-based.
+ */
+struct WasmDisassemblyOffsetTableEntry {
+ WasmDisassemblyOffsetTableEntry(uint32_t byte_offset, int line, int column)
+ : byte_offset(byte_offset), line(line), column(column) {}
+
+ uint32_t byte_offset;
+ int line;
+ int column;
+};
+struct WasmDisassembly {
+ using OffsetTable = std::vector<WasmDisassemblyOffsetTableEntry>;
+ WasmDisassembly() {}
+ WasmDisassembly(std::string disassembly, OffsetTable offset_table)
+ : disassembly(std::move(disassembly)),
+ offset_table(std::move(offset_table)) {}
+
+ std::string disassembly;
+ OffsetTable offset_table;
+};
+
+enum PromiseDebugActionType {
+ kDebugEnqueueAsyncFunction,
+ kDebugEnqueuePromiseResolve,
+ kDebugEnqueuePromiseReject,
+ kDebugEnqueuePromiseResolveThenableJob,
+ kDebugPromiseCollected,
+ kDebugWillHandle,
+ kDebugDidHandle,
+};
+
+} // namespace debug
+} // namespace v8
+
+#endif // V8_DEBUG_INTERFACE_TYPES_H_