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 TQ_OBJECT_CONSTRUCTORS_IMPL(BreakPoint)
TQ_OBJECT_CONSTRUCTORS_IMPL(BreakPointInfo)22 TQ_OBJECT_CONSTRUCTORS_IMPL(BreakPointInfo)
23 TQ_OBJECT_CONSTRUCTORS_IMPL(CoverageInfo)
24 TQ_OBJECT_CONSTRUCTORS_IMPL(DebugInfo)
25 
26 NEVER_READ_ONLY_SPACE_IMPL(DebugInfo)
27 
28 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, side_effect_state,
29                     DebugInfo::SideEffectStateBits)
30 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debug_is_blackboxed,
31                     DebugInfo::DebugIsBlackboxedBit)
32 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, computed_debug_is_blackboxed,
33                     DebugInfo::ComputedDebugIsBlackboxedBit)
34 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debugging_id,
35                     DebugInfo::DebuggingIdBits)
36 
37 bool DebugInfo::HasInstrumentedBytecodeArray() {
38   DCHECK_EQ(debug_bytecode_array().IsBytecodeArray(),
39             original_bytecode_array().IsBytecodeArray());
40   return debug_bytecode_array().IsBytecodeArray();
41 }
42 
OriginalBytecodeArray()43 BytecodeArray DebugInfo::OriginalBytecodeArray() {
44   DCHECK(HasInstrumentedBytecodeArray());
45   return BytecodeArray::cast(original_bytecode_array());
46 }
47 
DebugBytecodeArray()48 BytecodeArray DebugInfo::DebugBytecodeArray() {
49   DCHECK(HasInstrumentedBytecodeArray());
50   DCHECK_EQ(shared().GetDebugBytecodeArray(), debug_bytecode_array());
51   return BytecodeArray::cast(debug_bytecode_array());
52 }
53 
54 }  // namespace internal
55 }  // namespace v8
56 
57 #include "src/objects/object-macros-undef.h"
58 
59 #endif  // V8_OBJECTS_DEBUG_OBJECTS_INL_H_
60