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_DEBUG_INTERFACE_TYPES_H_ | |
6 #define V8_DEBUG_INTERFACE_TYPES_H_ | |
7 | |
8 #include <cstdint> | |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 namespace v8 { | |
13 namespace debug { | |
Yang
2016/12/05 12:44:49
Having Location in the namespace v8::debug, and De
Clemens Hammacher
2016/12/05 13:30:04
It's here: http://crrev.com/2549133002
I don't par
| |
14 | |
15 /** | |
16 * Defines location inside script. | |
17 * Lines and columns are 0-based. | |
18 */ | |
19 class Location { | |
20 public: | |
21 Location(int line_number, int column_number); | |
22 /** | |
23 * Create empty location. | |
24 */ | |
25 Location(); | |
26 | |
27 int GetLineNumber() const; | |
28 int GetColumnNumber() const; | |
29 bool IsEmpty() const; | |
30 | |
31 private: | |
32 int line_number_; | |
33 int column_number_; | |
34 }; | |
35 | |
36 /** | |
37 * The result of disassembling a wasm function. | |
38 * Consists of the disassembly string and an offset table mapping wasm byte | |
39 * offsets to line and column in the disassembly. | |
40 * The offset table entries are ordered by the byte_offset. | |
41 * All numbers are 0-based. | |
42 */ | |
43 struct WasmDisassemblyOffsetTableEntry { | |
44 WasmDisassemblyOffsetTableEntry(uint32_t byte_offset, int line, int column) | |
45 : byte_offset(byte_offset), line(line), column(column) {} | |
46 | |
47 uint32_t byte_offset; | |
48 int line; | |
49 int column; | |
50 }; | |
51 struct WasmDisassembly { | |
52 using OffsetTable = std::vector<WasmDisassemblyOffsetTableEntry>; | |
53 WasmDisassembly() {} | |
54 WasmDisassembly(std::string disassembly, OffsetTable offset_table) | |
55 : disassembly(std::move(disassembly)), | |
56 offset_table(std::move(offset_table)) {} | |
57 | |
58 std::string disassembly; | |
59 OffsetTable offset_table; | |
60 }; | |
61 | |
62 } // namespace debug | |
63 } // namespace v8 | |
64 | |
65 #endif // V8_DEBUG_INTERFACE_TYPES_H_ | |
OLD | NEW |