summaryrefslogtreecommitdiff
path: root/chromium/v8/src/objects/debug-objects.tq
blob: ee8201e615cba59c9cc3bed6dede9da4e53e08b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright 2019 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.

@generateCppClass
@generatePrint
extern class BreakPoint extends Struct {
  id: Smi;
  condition: String;
}

@generateCppClass
@generatePrint
extern class BreakPointInfo extends Struct {
  // The position in the source for the break position.
  source_position: Smi;
  // List of related JavaScript break points.
  break_points: FixedArray|BreakPoint|Undefined;
}

bitfield struct DebugInfoFlags extends uint31 {
  has_break_info: bool: 1 bit;
  prepared_for_debug_execution: bool: 1 bit;
  has_coverage_info: bool: 1 bit;
  break_at_entry: bool: 1 bit;
  can_break_at_entry: bool: 1 bit;
  debug_execution_mode: bool: 1 bit;
}

bitfield struct DebuggerHints extends uint31 {
  side_effect_state: int32: 2 bit;
  debug_is_blackboxed: bool: 1 bit;
  computed_debug_is_blackboxed: bool: 1 bit;
  debugging_id: int32: 20 bit;
}

@generateCppClass
@generatePrint
extern class DebugInfo extends Struct {
  shared: SharedFunctionInfo;
  // Bit field containing various information collected for debugging.
  debugger_hints: SmiTagged<DebuggerHints>;
  // Script field from shared function info.
  script: Undefined|Script;
  // The original uninstrumented bytecode array for functions with break
  // points - the instrumented bytecode is held in the shared function info.
  original_bytecode_array: Undefined|BytecodeArray;
  // The debug instrumented bytecode array for functions with break points
  // - also pointed to by the shared function info.
  debug_bytecode_array: Undefined|BytecodeArray;
  // Fixed array holding status information for each active break point.
  break_points: FixedArray;
  // A bitfield that lists uses of the current instance.
  flags: SmiTagged<DebugInfoFlags>;
  coverage_info: CoverageInfo|Undefined;
}

@export
struct CoverageInfoSlot {
  start_source_position: int32;
  end_source_position: int32;
  block_count: int32;
  padding: int32;  // Padding to make the index count 4.
}

// CoverageInfo's visitor is included in DATA_ONLY_VISITOR_ID_LIST, so it must
// not contain any HeapObject fields.
@generateCppClass
extern class CoverageInfo extends HeapObject {
  const slot_count: int32;
  slots[slot_count]: CoverageInfoSlot;
}

@generateCppClass
@generatePrint
extern class WasmValue extends Struct {
  // TODO(7748): Name and comment are outdated.
  // The type, should map to ValueType::Kind values in value-type.h.
  value_type: SmiTagged<WasmValueType>;
  // Holds the actual value. For example, if this holds a Wasm i32, this will
  // be of length 4, for s128, it will have length 16. These values are
  // represented by the respective C++ types, and memcpy-ed in.
  // When value_type is a externref, it holds the object that externref points
  // to.
  bytes_or_ref: Object|ByteArray;
}