1 // Copyright 2017 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_OBJECTS_DEBUG_OBJECTS_INL_H_
6 #define V8_OBJECTS_DEBUG_OBJECTS_INL_H_
7
8 #include "src/objects/debug-objects.h"
9
10 #include "src/heap/heap-write-barrier-inl.h"
11 #include "src/objects/code-inl.h"
12 #include "src/objects/objects-inl.h"
13 #include "src/objects/shared-function-info.h"
14
15 // Has to be the last include (doesn't have include guards):
16 #include "src/objects/object-macros.h"
17
18 namespace v8 {
19 namespace internal {
20
21 #include "torque-generated/src/objects/debug-objects-tq-inl.inc"
22
23 TQ_OBJECT_CONSTRUCTORS_IMPL(BreakPoint)
TQ_OBJECT_CONSTRUCTORS_IMPL(BreakPointInfo)24 TQ_OBJECT_CONSTRUCTORS_IMPL(BreakPointInfo)
25 TQ_OBJECT_CONSTRUCTORS_IMPL(CoverageInfo)
26 TQ_OBJECT_CONSTRUCTORS_IMPL(DebugInfo)
27
28 NEVER_READ_ONLY_SPACE_IMPL(DebugInfo)
29
30 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, side_effect_state,
31 DebugInfo::SideEffectStateBits)
32 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debug_is_blackboxed,
33 DebugInfo::DebugIsBlackboxedBit)
34 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, computed_debug_is_blackboxed,
35 DebugInfo::ComputedDebugIsBlackboxedBit)
36 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debugging_id,
37 DebugInfo::DebuggingIdBits)
38
39 bool DebugInfo::HasInstrumentedBytecodeArray() {
40 DCHECK_EQ(debug_bytecode_array().IsBytecodeArray(),
41 original_bytecode_array().IsBytecodeArray());
42 return debug_bytecode_array().IsBytecodeArray();
43 }
44
OriginalBytecodeArray()45 BytecodeArray DebugInfo::OriginalBytecodeArray() {
46 DCHECK(HasInstrumentedBytecodeArray());
47 return BytecodeArray::cast(original_bytecode_array());
48 }
49
DebugBytecodeArray()50 BytecodeArray DebugInfo::DebugBytecodeArray() {
51 DCHECK(HasInstrumentedBytecodeArray());
52 DCHECK_EQ(shared().GetDebugBytecodeArray(), debug_bytecode_array());
53 return BytecodeArray::cast(debug_bytecode_array());
54 }
55
56 TQ_OBJECT_CONSTRUCTORS_IMPL(WasmValue)
57 NEVER_READ_ONLY_SPACE_IMPL(WasmValue)
58
59 } // namespace internal
60 } // namespace v8
61
62 #include "src/objects/object-macros-undef.h"
63
64 #endif // V8_OBJECTS_DEBUG_OBJECTS_INL_H_
65