debug-objects-inl.h 2.37 KB
Newer Older
1 2 3 4 5 6 7 8 9
// Copyright 2017 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.

#ifndef V8_OBJECTS_DEBUG_OBJECTS_INL_H_
#define V8_OBJECTS_DEBUG_OBJECTS_INL_H_

#include "src/objects/debug-objects.h"

10 11
#include "src/heap/heap-write-barrier-inl.h"
#include "src/objects/code-inl.h"
12
#include "src/objects/objects-inl.h"
13
#include "src/objects/shared-function-info.h"
14 15 16 17 18 19 20

// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"

namespace v8 {
namespace internal {

21 22
OBJECT_CONSTRUCTORS_IMPL(BreakPoint, Tuple2)
OBJECT_CONSTRUCTORS_IMPL(BreakPointInfo, Tuple2)
23
OBJECT_CONSTRUCTORS_IMPL(CoverageInfo, FixedArray)
24
TQ_OBJECT_CONSTRUCTORS_IMPL(DebugInfo)
25

26 27
NEVER_READ_ONLY_SPACE_IMPL(DebugInfo)

28 29 30
CAST_ACCESSOR(BreakPointInfo)
CAST_ACCESSOR(CoverageInfo)
CAST_ACCESSOR(BreakPoint)
31

32 33
TQ_SMI_ACCESSORS(DebugInfo, flags)
TQ_SMI_ACCESSORS(DebugInfo, debugger_hints)
34

35 36 37 38 39 40 41 42 43
BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, side_effect_state,
                    DebugInfo::SideEffectStateBits)
BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debug_is_blackboxed,
                    DebugInfo::DebugIsBlackboxedBit)
BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, computed_debug_is_blackboxed,
                    DebugInfo::ComputedDebugIsBlackboxedBit)
BIT_FIELD_ACCESSORS(DebugInfo, debugger_hints, debugging_id,
                    DebugInfo::DebuggingIdBits)

44
SMI_ACCESSORS(BreakPointInfo, source_position, kSourcePositionOffset)
45
ACCESSORS(BreakPointInfo, break_points, Object, kBreakPointsOffset)
46

47
SMI_ACCESSORS(BreakPoint, id, kIdOffset)
48
ACCESSORS(BreakPoint, condition, String, kConditionOffset)
49

50
bool DebugInfo::HasInstrumentedBytecodeArray() {
51 52 53
  DCHECK_EQ(debug_bytecode_array().IsBytecodeArray(),
            original_bytecode_array().IsBytecodeArray());
  return debug_bytecode_array().IsBytecodeArray();
54 55
}

56
BytecodeArray DebugInfo::OriginalBytecodeArray() {
57 58
  DCHECK(HasInstrumentedBytecodeArray());
  return BytecodeArray::cast(original_bytecode_array());
59 60
}

61
BytecodeArray DebugInfo::DebugBytecodeArray() {
62
  DCHECK(HasInstrumentedBytecodeArray());
63
  DCHECK_EQ(shared().GetDebugBytecodeArray(), debug_bytecode_array());
64
  return BytecodeArray::cast(debug_bytecode_array());
65 66 67 68 69 70 71 72
}

}  // namespace internal
}  // namespace v8

#include "src/objects/object-macros-undef.h"

#endif  // V8_OBJECTS_DEBUG_OBJECTS_INL_H_