Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Unified Diff: src/objects/debug-objects-inl.h

Issue 2900713004: [objects] Extract DebugInfo and BreakPointInfo to own file (Closed)
Patch Set: Remove undefs from objects-inl.h Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects/debug-objects.cc ('k') | src/objects/object-macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects/debug-objects-inl.h
diff --git a/src/objects/debug-objects-inl.h b/src/objects/debug-objects-inl.h
new file mode 100644
index 0000000000000000000000000000000000000000..b71c4c0f56e4646a7f125eba17b0d96104fe7936
--- /dev/null
+++ b/src/objects/debug-objects-inl.h
@@ -0,0 +1,60 @@
+// 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"
+
+#include "src/heap/heap-inl.h"
+
+// Has to be the last include (doesn't have include guards):
+#include "src/objects/object-macros.h"
+
+namespace v8 {
+namespace internal {
+
+CAST_ACCESSOR(BreakPointInfo)
+CAST_ACCESSOR(DebugInfo)
+
+ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex)
+SMI_ACCESSORS(DebugInfo, debugger_hints, kDebuggerHintsIndex)
+ACCESSORS(DebugInfo, debug_bytecode_array, Object, kDebugBytecodeArrayIndex)
+ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex)
+
+SMI_ACCESSORS(BreakPointInfo, source_position, kSourcePositionIndex)
+ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex)
+
+bool DebugInfo::HasDebugBytecodeArray() {
+ return debug_bytecode_array()->IsBytecodeArray();
+}
+
+bool DebugInfo::HasDebugCode() {
+ Code* code = shared()->code();
+ bool has = code->kind() == Code::FUNCTION;
+ DCHECK(!has || code->has_debug_break_slots());
+ return has;
+}
+
+BytecodeArray* DebugInfo::OriginalBytecodeArray() {
+ DCHECK(HasDebugBytecodeArray());
+ return shared()->bytecode_array();
+}
+
+BytecodeArray* DebugInfo::DebugBytecodeArray() {
+ DCHECK(HasDebugBytecodeArray());
+ return BytecodeArray::cast(debug_bytecode_array());
+}
+
+Code* DebugInfo::DebugCode() {
+ DCHECK(HasDebugCode());
+ return shared()->code();
+}
+
+} // namespace internal
+} // namespace v8
+
+#include "src/objects/object-macros-undef.h"
+
+#endif // V8_OBJECTS_DEBUG_OBJECTS_INL_H_
« no previous file with comments | « src/objects/debug-objects.cc ('k') | src/objects/object-macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698