V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
debug-objects-inl.h
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-inl.h"
11 #include "src/heap/heap-write-barrier.h"
12 #include "src/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 OBJECT_CONSTRUCTORS_IMPL(CoverageInfo, FixedArray)
22 
23 CAST_ACCESSOR(BreakPointInfo)
24 CAST_ACCESSOR(DebugInfo)
25 CAST_ACCESSOR2(CoverageInfo)
26 CAST_ACCESSOR(BreakPoint)
27 
28 SMI_ACCESSORS(DebugInfo, flags, kFlagsOffset)
29 ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
30 SMI_ACCESSORS(DebugInfo, debugger_hints, kDebuggerHintsOffset)
31 ACCESSORS(DebugInfo, script, Object, kScriptOffset)
32 ACCESSORS(DebugInfo, original_bytecode_array, Object,
33  kOriginalBytecodeArrayOffset)
34 ACCESSORS(DebugInfo, debug_bytecode_array, Object, kDebugBytecodeArrayOffset)
35 ACCESSORS2(DebugInfo, break_points, FixedArray, kBreakPointsStateOffset)
36 ACCESSORS(DebugInfo, coverage_info, Object, kCoverageInfoOffset)
37 
38 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, side_effect_state,
39  DebugInfo::SideEffectStateBits)
40 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debug_is_blackboxed,
41  DebugInfo::DebugIsBlackboxedBit)
42 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, computed_debug_is_blackboxed,
43  DebugInfo::ComputedDebugIsBlackboxedBit)
44 BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debugging_id,
45  DebugInfo::DebuggingIdBits)
46 
47 SMI_ACCESSORS(BreakPointInfo, source_position, kSourcePositionOffset)
48 ACCESSORS(BreakPointInfo, break_points, Object, kBreakPointsOffset)
49 
50 SMI_ACCESSORS(BreakPoint, id, kIdOffset)
51 ACCESSORS2(BreakPoint, condition, String, kConditionOffset)
52 
53 bool DebugInfo::HasInstrumentedBytecodeArray() {
54  DCHECK_EQ(debug_bytecode_array()->IsBytecodeArray(),
55  original_bytecode_array()->IsBytecodeArray());
56  return debug_bytecode_array()->IsBytecodeArray();
57 }
58 
59 BytecodeArray DebugInfo::OriginalBytecodeArray() {
60  DCHECK(HasInstrumentedBytecodeArray());
61  return BytecodeArray::cast(original_bytecode_array());
62 }
63 
64 BytecodeArray DebugInfo::DebugBytecodeArray() {
65  DCHECK(HasInstrumentedBytecodeArray());
66  DCHECK_EQ(shared()->GetDebugBytecodeArray(), debug_bytecode_array());
67  return BytecodeArray::cast(debug_bytecode_array());
68 }
69 
70 } // namespace internal
71 } // namespace v8
72 
73 #include "src/objects/object-macros-undef.h"
74 
75 #endif // V8_OBJECTS_DEBUG_OBJECTS_INL_H_
Definition: libplatform.h:13