Reland "Move logging and diagnostics related source files"

TBR=verwaest@chromium.org,rmcilroy@chromium.org
NOTREECHECKS=true
NOPRESUBMIT=true

Bug: v8:9247
Change-Id: I9ddfb6e56ca8e47c4ac186a8df5f442d26420a69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617661
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61642}
This commit is contained in:
Yang Guo 2019-05-20 11:15:06 +02:00 committed by Commit Bot
parent d5c4d577c4
commit bf372a73d8
236 changed files with 587 additions and 733 deletions

View File

@ -2061,8 +2061,6 @@ v8_source_set("v8_base_without_compiler") {
"src/ast/variables.h",
"src/bailout-reason.cc",
"src/bailout-reason.h",
"src/basic-block-profiler.cc",
"src/basic-block-profiler.h",
"src/bit-vector.cc",
"src/bit-vector.h",
"src/boxed-float.h",
@ -2138,10 +2136,6 @@ v8_source_set("v8_base_without_compiler") {
"src/contexts-inl.h",
"src/contexts.cc",
"src/contexts.h",
"src/counters-definitions.h",
"src/counters-inl.h",
"src/counters.cc",
"src/counters.h",
"src/cpu-features.h",
"src/date/date.cc",
"src/date/date.h",
@ -2176,11 +2170,20 @@ v8_source_set("v8_base_without_compiler") {
"src/deoptimizer.h",
"src/detachable-vector.cc",
"src/detachable-vector.h",
"src/disasm.h",
"src/disassembler.cc",
"src/disassembler.h",
"src/eh-frame.cc",
"src/eh-frame.h",
"src/diagnostics/basic-block-profiler.cc",
"src/diagnostics/basic-block-profiler.h",
"src/diagnostics/disasm.h",
"src/diagnostics/disassembler.cc",
"src/diagnostics/disassembler.h",
"src/diagnostics/eh-frame.cc",
"src/diagnostics/eh-frame.h",
"src/diagnostics/gdb-jit.cc",
"src/diagnostics/gdb-jit.h",
"src/diagnostics/objects-debug.cc",
"src/diagnostics/objects-printer.cc",
"src/diagnostics/perf-jit.cc",
"src/diagnostics/perf-jit.h",
"src/diagnostics/unwinder.cc",
"src/execution.cc",
"src/execution.h",
"src/extensions/externalize-string-extension.cc",
@ -2214,8 +2217,6 @@ v8_source_set("v8_base_without_compiler") {
"src/function-kind.h",
"src/futex-emulation.cc",
"src/futex-emulation.h",
"src/gdb-jit.cc",
"src/gdb-jit.h",
"src/global-handles.cc",
"src/global-handles.h",
"src/handler-table.cc",
@ -2383,11 +2384,15 @@ v8_source_set("v8_base_without_compiler") {
"src/label.h",
"src/locked-queue-inl.h",
"src/locked-queue.h",
"src/log-inl.h",
"src/log-utils.cc",
"src/log-utils.h",
"src/log.cc",
"src/log.h",
"src/logging/counters-definitions.h",
"src/logging/counters-inl.h",
"src/logging/counters.cc",
"src/logging/counters.h",
"src/logging/log-inl.h",
"src/logging/log-utils.cc",
"src/logging/log-utils.h",
"src/logging/log.cc",
"src/logging/log.h",
"src/machine-type.cc",
"src/machine-type.h",
"src/macro-assembler-inl.h",
@ -2426,9 +2431,7 @@ v8_source_set("v8_base_without_compiler") {
"src/numbers/strtod.h",
"src/objects-body-descriptors-inl.h",
"src/objects-body-descriptors.h",
"src/objects-debug.cc",
"src/objects-inl.h",
"src/objects-printer.cc",
"src/objects.cc",
"src/objects.h",
"src/objects/allocation-site-inl.h",
@ -2658,8 +2661,6 @@ v8_source_set("v8_base_without_compiler") {
"src/parsing/token.h",
"src/pending-compilation-error-handler.cc",
"src/pending-compilation-error-handler.h",
"src/perf-jit.cc",
"src/perf-jit.h",
"src/pointer-with-payload.h",
"src/profiler/allocation-tracker.cc",
"src/profiler/allocation-tracker.h",
@ -2848,7 +2849,6 @@ v8_source_set("v8_base_without_compiler") {
"src/unicode.h",
"src/unoptimized-compilation-info.cc",
"src/unoptimized-compilation-info.h",
"src/unwinder.cc",
"src/uri.cc",
"src/uri.h",
"src/utils-inl.h",
@ -3043,11 +3043,11 @@ v8_source_set("v8_base_without_compiler") {
}
if (is_win) {
sources += [
"src/diagnostics/unwinding-info-win64.cc",
"src/diagnostics/unwinding-info-win64.h",
"src/trap-handler/handler-inside-win.cc",
"src/trap-handler/handler-inside-win.h",
"src/trap-handler/handler-outside-win.cc",
"src/unwinding-info-win64.cc",
"src/unwinding-info-win64.h",
]
}
} else if (v8_current_cpu == "arm") {

37
COMMON_OWNERS Normal file
View File

@ -0,0 +1,37 @@
adamk@chromium.org
ahaas@chromium.org
bbudge@chromium.org
binji@chromium.org
bmeurer@chromium.org
cbruni@chromium.org
clemensh@chromium.org
danno@chromium.org
delphick@chromium.org
gdeepti@chromium.org
gsathya@chromium.org
hablich@chromium.org
hpayer@chromium.org
ishell@chromium.org
jarin@chromium.org
jgruber@chromium.org
jkummerow@chromium.org
leszeks@chromium.org
machenbach@chromium.org
mathias@chromium.org
marja@chromium.org
mlippautz@chromium.org
mslekova@chromium.org
mstarzinger@chromium.org
mvstanton@chromium.org
mythria@chromium.org
neis@chromium.org
petermarshall@chromium.org
rmcilroy@chromium.org
sergiyb@chromium.org
sigurds@chromium.org
szuend@chromium.org
tebbi@chromium.org
titzer@chromium.org
ulan@chromium.org
verwaest@chromium.org
yangguo@chromium.org

View File

@ -433,6 +433,8 @@ def _CheckMacroUndefs(input_api, output_api):
undef_match = undef_pattern.match(line)
if undef_match:
if "// NOLINT" in line:
continue
name = undef_match.group(1)
if not name in defined_macros:
errors.append('{}:{}: Macro named \'{}\' was not defined before.'

View File

@ -6,12 +6,12 @@
#include "src/api/api-inl.h"
#include "src/contexts.h"
#include "src/counters.h"
#include "src/deoptimizer.h"
#include "src/execution.h"
#include "src/frames-inl.h"
#include "src/heap/factory.h"
#include "src/isolate-inl.h"
#include "src/logging/counters.h"
#include "src/messages.h"
#include "src/objects/api-callbacks.h"
#include "src/objects/field-index-inl.h"

View File

@ -28,7 +28,6 @@
#include "src/compiler-dispatcher/compiler-dispatcher.h"
#include "src/compiler.h"
#include "src/contexts.h"
#include "src/counters.h"
#include "src/cpu-features.h"
#include "src/date/date.h"
#include "src/debug/debug-coverage.h"
@ -38,9 +37,9 @@
#include "src/debug/liveedit.h"
#include "src/deoptimizer.h"
#include "src/detachable-vector.h"
#include "src/diagnostics/gdb-jit.h"
#include "src/execution.h"
#include "src/frames-inl.h"
#include "src/gdb-jit.h"
#include "src/global-handles.h"
#include "src/globals.h"
#include "src/heap/heap-inl.h"
@ -50,6 +49,7 @@
#include "src/isolate-inl.h"
#include "src/json-parser.h"
#include "src/json-stringifier.h"
#include "src/logging/counters.h"
#include "src/messages.h"
#include "src/microtask-queue.h"
#include "src/numbers/conversions-inl.h"
@ -121,7 +121,7 @@
#include "include/v8-wasm-trap-handler-win.h"
#include "src/trap-handler/handler-inside-win.h"
#if V8_TARGET_ARCH_X64
#include "src/unwinding-info-win64.h"
#include "src/diagnostics/unwinding-info-win64.h"
#endif // V8_TARGET_ARCH_X64
#endif // V8_OS_WIN

View File

@ -34,7 +34,7 @@
#include "src/arm/constants-arm.h"
#include "src/base/bits.h"
#include "src/base/platform/platform.h"
#include "src/disasm.h"
#include "src/diagnostics/disasm.h"
#include "src/vector.h"
namespace v8 {

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
namespace v8 {
namespace internal {

View File

@ -12,12 +12,12 @@
#include "src/base/utils/random-number-generator.h"
#include "src/callable.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/external-reference-table.h"
#include "src/frames-inl.h"
#include "src/heap/heap-inl.h" // For MemoryChunk.
#include "src/init/bootstrapper.h"
#include "src/logging/counters.h"
#include "src/macro-assembler.h"
#include "src/numbers/double.h"
#include "src/objects-inl.h"

View File

@ -14,7 +14,7 @@
#include "src/assembler-inl.h"
#include "src/base/bits.h"
#include "src/base/lazy-instance.h"
#include "src/disasm.h"
#include "src/diagnostics/disasm.h"
#include "src/heap/combined-heap.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"

View File

@ -13,7 +13,7 @@
#include "src/arm64/disasm-arm64.h"
#include "src/arm64/utils-arm64.h"
#include "src/base/platform/platform.h"
#include "src/disasm.h"
#include "src/diagnostics/disasm.h"
namespace v8 {
namespace internal {

View File

@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "src/arm64/assembler-arm64-inl.h"
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
namespace v8 {
namespace internal {

View File

@ -9,13 +9,13 @@
#include "src/base/division-by-constant.h"
#include "src/callable.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/external-reference-table.h"
#include "src/frame-constants.h"
#include "src/frames-inl.h"
#include "src/heap/heap-inl.h" // For MemoryChunk.
#include "src/init/bootstrapper.h"
#include "src/logging/counters.h"
#include "src/macro-assembler-inl.h"
#include "src/register-configuration.h"
#include "src/runtime/runtime.h"

View File

@ -14,7 +14,7 @@
#include "src/arm64/decoder-arm64-inl.h"
#include "src/assembler-inl.h"
#include "src/base/lazy-instance.h"
#include "src/disasm.h"
#include "src/diagnostics/disasm.h"
#include "src/heap/combined-heap.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"

View File

@ -11,11 +11,11 @@
#include "src/base/optional.h"
#include "src/base/platform/elapsed-timer.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/execution.h"
#include "src/handles.h"
#include "src/heap/factory.h"
#include "src/isolate.h"
#include "src/logging/counters.h"
#include "src/message-template.h"
#include "src/objects-inl.h"
#include "src/objects/heap-number-inl.h"

View File

@ -36,7 +36,7 @@
#include "src/assembler-inl.h"
#include "src/deoptimizer.h"
#include "src/disassembler.h"
#include "src/diagnostics/disassembler.h"
#include "src/heap/heap-inl.h" // For MemoryAllocator. TODO(jkummerow): Drop.
#include "src/isolate.h"
#include "src/ostreams.h"

View File

@ -9,8 +9,8 @@
#include "src/accessors.h"
#include "src/ast/ast.h"
#include "src/base/optional.h"
#include "src/counters.h"
#include "src/init/bootstrapper.h"
#include "src/logging/counters.h"
#include "src/message-template.h"
#include "src/objects-inl.h"
#include "src/objects/module-inl.h"

View File

@ -6,11 +6,11 @@
#include "src/api/api-arguments.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -6,11 +6,11 @@
#include "src/api/api-arguments.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -6,8 +6,8 @@
#include "src/api/api-natives.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/objects-inl.h"
#include "src/objects/prototype.h"
#include "src/objects/templates.h"

View File

@ -6,10 +6,10 @@
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/contexts.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/global-handles.h"
#include "src/isolate.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/elements-inl.h"
#include "src/objects/hash-table-inl.h"

View File

@ -4,8 +4,8 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // For ToBoolean. TODO(jkummerow): Drop.
#include "src/logging/counters.h"
#include "src/maybe-handles-inl.h"
#include "src/numbers/conversions.h"
#include "src/objects-inl.h"

View File

@ -4,7 +4,7 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/numbers/conversions.h"
#include "src/objects-inl.h"
#ifdef V8_INTL_SUPPORT

View File

@ -4,8 +4,8 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // For ToBoolean.
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/frame-array-inl.h"

View File

@ -4,7 +4,7 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/js-collection-inl.h"

View File

@ -5,9 +5,9 @@
#include "src/api/api-inl.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/debug/interface-types.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -11,8 +11,8 @@
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
#include "src/counters.h"
#include "src/interface-descriptors.h"
#include "src/logging/counters.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"

View File

@ -4,9 +4,9 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/heap/factory.h"
#include "src/isolate.h"
#include "src/logging/counters.h"
#include "src/numbers/conversions.h"
#include "src/objects-inl.h"
#include "src/objects/js-array-buffer-inl.h"

View File

@ -5,9 +5,9 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/date/date.h"
#include "src/date/dateparser-inl.h"
#include "src/logging/counters.h"
#include "src/numbers/conversions.h"
#include "src/objects-inl.h"
#ifdef V8_INTL_SUPPORT

View File

@ -5,8 +5,8 @@
#include "src/accessors.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/isolate-inl.h"
#include "src/logging/counters.h"
#include "src/messages.h"
#include "src/objects-inl.h"
#include "src/objects/api-callbacks.h"

View File

@ -6,7 +6,7 @@
#include "src/builtins/builtins.h"
#include "src/objects/elements.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -6,7 +6,7 @@
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/numbers/conversions.h"
#include "src/objects-inl.h"
#include "src/objects/api-callbacks.h"

View File

@ -6,7 +6,7 @@
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/uri.h"

View File

@ -6,10 +6,10 @@
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // crbug.com/v8/8499
#include "src/ic/accessor-assembler.h"
#include "src/ic/keyed-store-generic.h"
#include "src/logging/counters.h"
#include "src/macro-assembler.h"
#include "src/objects/debug-objects.h"
#include "src/objects/shared-function-info.h"

View File

@ -4,8 +4,8 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/interface-descriptors.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -12,8 +12,8 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/date/date.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/elements.h"
#include "src/objects/intl-objects.h"

View File

@ -4,9 +4,9 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/json-parser.h"
#include "src/json-stringifier.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -4,7 +4,7 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -5,7 +5,7 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/numbers/conversions.h"
#include "src/objects-inl.h"
#ifdef V8_INTL_SUPPORT

View File

@ -5,9 +5,9 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // For ToBoolean. TODO(jkummerow): Drop.
#include "src/keys.h"
#include "src/logging/counters.h"
#include "src/message-template.h"
#include "src/objects-inl.h"
#include "src/objects/lookup.h"

View File

@ -6,8 +6,8 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // For ToBoolean. TODO(jkummerow): Drop.
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -7,7 +7,7 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -4,8 +4,8 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/keys.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/lookup.h"
#include "src/objects/property-descriptor.h"

View File

@ -10,8 +10,8 @@
#include "src/builtins/growable-fixed-array-gen.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
#include "src/counters.h"
#include "src/heap/factory-inl.h"
#include "src/logging/counters.h"
#include "src/objects/js-regexp-string-iterator.h"
#include "src/objects/js-regexp.h"
#include "src/objects/regexp-match-info.h"

View File

@ -4,7 +4,7 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/regexp/jsregexp.h"
#include "src/regexp/regexp-utils.h"

View File

@ -8,10 +8,10 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/futex-emulation.h"
#include "src/globals.h"
#include "src/heap/factory.h"
#include "src/logging/counters.h"
#include "src/numbers/conversions-inl.h"
#include "src/objects-inl.h"
#include "src/objects/js-array-buffer-inl.h"

View File

@ -4,8 +4,8 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // For ToBoolean. TODO(jkummerow): Drop.
#include "src/logging/counters.h"
#include "src/numbers/conversions.h"
#include "src/objects-inl.h"
#ifdef V8_INTL_SUPPORT

View File

@ -4,8 +4,8 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // For public_symbol_table().
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -5,9 +5,9 @@
#include "src/api/api-inl.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // For ToBoolean. TODO(jkummerow): Drop.
#include "src/json-stringifier.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
namespace v8 {

View File

@ -4,7 +4,7 @@
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/elements.h"
#include "src/objects/heap-number-inl.h"

View File

@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "src/builtins/builtins-utils-inl.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects/js-weak-refs-inl.h"
namespace v8 {

View File

@ -7,11 +7,11 @@
#include "src/api/api-arguments.h"
#include "src/base/adapters.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -6,11 +6,11 @@
#include "src/api/api-arguments.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -6,11 +6,11 @@
#include "src/api/api-arguments.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -6,11 +6,11 @@
#include "src/api/api-arguments.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -6,11 +6,11 @@
#include "src/api/api-arguments.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -7,10 +7,10 @@
#include "src/api/api-arguments.h"
#include "src/base/adapters.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/deoptimizer.h"
#include "src/frame-constants.h"
#include "src/frames.h"
#include "src/logging/counters.h"
// For interpreter_entry_return_pc_offset. TODO(jkummerow): Drop.
#include "src/heap/heap-inl.h"
#include "src/macro-assembler-inl.h"

View File

@ -5,11 +5,11 @@
#include "src/code-stub-assembler.h"
#include "src/code-factory.h"
#include "src/counters.h"
#include "src/frames-inl.h"
#include "src/frames.h"
#include "src/function-kind.h"
#include "src/heap/heap-inl.h" // For Page/MemoryChunk. TODO(jkummerow): Drop.
#include "src/logging/counters.h"
#include "src/objects/api-callbacks.h"
#include "src/objects/cell.h"
#include "src/objects/descriptor-array.h"

View File

@ -4,10 +4,10 @@
#include "src/compilation-cache.h"
#include "src/counters.h"
#include "src/globals.h"
#include "src/heap/factory.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/objects-inl.h"
#include "src/objects/compilation-cache-inl.h"
#include "src/objects/slots.h"

View File

@ -8,9 +8,9 @@
#include "src/base/template-utils.h"
#include "src/cancelable-task.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/isolate.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/objects-inl.h"
#include "src/optimized-compilation-info.h"
#include "src/tracing/trace-event.h"

View File

@ -25,7 +25,7 @@
#include "src/init/bootstrapper.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h"
#include "src/log-inl.h"
#include "src/logging/log-inl.h"
#include "src/message-template.h"
#include "src/objects/feedback-cell-inl.h"
#include "src/objects/map.h"

View File

@ -9,8 +9,8 @@
#include "src/accessors.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/type-cache.h"
#include "src/counters.h"
#include "src/ic/call-optimization.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/cell-inl.h"
#include "src/objects/field-index-inl.h"

View File

@ -5,7 +5,7 @@
#ifndef V8_COMPILER_BACKEND_ARM_UNWINDING_INFO_WRITER_ARM_H_
#define V8_COMPILER_BACKEND_ARM_UNWINDING_INFO_WRITER_ARM_H_
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
#include "src/flags.h"
namespace v8 {

View File

@ -5,7 +5,7 @@
#ifndef V8_COMPILER_BACKEND_ARM64_UNWINDING_INFO_WRITER_ARM64_H_
#define V8_COMPILER_BACKEND_ARM64_UNWINDING_INFO_WRITER_ARM64_H_
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
#include "src/flags.h"
namespace v8 {

View File

@ -11,10 +11,10 @@
#include "src/compiler/linkage.h"
#include "src/compiler/pipeline.h"
#include "src/compiler/wasm-compiler.h"
#include "src/counters.h"
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
#include "src/frames.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/macro-assembler-inl.h"
#include "src/objects/smi.h"
#include "src/optimized-compilation-info.h"

View File

@ -5,7 +5,7 @@
#ifndef V8_COMPILER_BACKEND_X64_UNWINDING_INFO_WRITER_X64_H_
#define V8_COMPILER_BACKEND_X64_UNWINDING_INFO_WRITER_X64_H_
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
#include "src/flags.h"
namespace v8 {

View File

@ -6,7 +6,7 @@
#define V8_COMPILER_BASIC_BLOCK_INSTRUMENTOR_H_
#include "src/allocation.h"
#include "src/basic-block-profiler.h"
#include "src/diagnostics/basic-block-profiler.h"
namespace v8 {
namespace internal {

View File

@ -21,9 +21,9 @@
#include "src/compiler/property-access-builder.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/type-cache.h"
#include "src/counters.h"
#include "src/feedback-vector-inl.h"
#include "src/ic/call-optimization.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/arguments-inl.h"
#include "src/objects/js-array-buffer-inl.h"

View File

@ -13,7 +13,7 @@
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
#include "src/counters.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/js-generator.h"

View File

@ -76,7 +76,7 @@
#include "src/compiler/verifier.h"
#include "src/compiler/wasm-compiler.h"
#include "src/compiler/zone-stats.h"
#include "src/disassembler.h"
#include "src/diagnostics/disassembler.h"
#include "src/init/bootstrapper.h"
#include "src/isolate-inl.h"
#include "src/objects/shared-function-info.h"

View File

@ -31,11 +31,11 @@
#include "src/compiler/pipeline.h"
#include "src/compiler/simd-scalar-lowering.h"
#include "src/compiler/zone-stats.h"
#include "src/counters.h"
#include "src/heap/factory.h"
#include "src/interface-descriptors.h"
#include "src/isolate-inl.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/objects/heap-number.h"
#include "src/optimized-compilation-info.h"
#include "src/tracing/trace-event.h"

View File

@ -27,11 +27,11 @@
#include "src/base/platform/platform.h"
#include "src/base/platform/time.h"
#include "src/base/sys-info.h"
#include "src/basic-block-profiler.h"
#include "src/d8/d8-console.h"
#include "src/d8/d8-platforms.h"
#include "src/d8/d8.h"
#include "src/debug/debug-interface.h"
#include "src/diagnostics/basic-block-profiler.h"
#include "src/interpreter/interpreter.h"
#include "src/msan.h"
#include "src/objects-inl.h"

View File

@ -15,7 +15,6 @@
#include "src/builtins/builtins.h"
#include "src/compilation-cache.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/debug/debug-evaluate.h"
#include "src/debug/liveedit.h"
#include "src/deoptimizer.h"
@ -29,6 +28,7 @@
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h"
#include "src/logging/counters.h"
#include "src/message-template.h"
#include "src/objects/api-callbacks-inl.h"
#include "src/objects/debug-objects-inl.h"

View File

@ -14,7 +14,7 @@
#include "src/debug/debug.h"
#include "src/frames-inl.h"
#include "src/isolate-inl.h"
#include "src/log.h"
#include "src/logging/log.h"
#include "src/objects-inl.h"
#include "src/objects/hash-table-inl.h"
#include "src/objects/js-generator-inl.h"

View File

@ -10,13 +10,13 @@
#include "src/assembler-inl.h"
#include "src/ast/prettyprinter.h"
#include "src/callable.h"
#include "src/counters.h"
#include "src/disasm.h"
#include "src/diagnostics/disasm.h"
#include "src/frames-inl.h"
#include "src/global-handles.h"
#include "src/heap/heap-inl.h"
#include "src/interpreter/interpreter.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/macro-assembler.h"
#include "src/objects/debug-objects-inl.h"
#include "src/objects/heap-number-inl.h"

1
src/diagnostics/OWNERS Normal file
View File

@ -0,0 +1 @@
file://COMMON_OWNERS

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/basic-block-profiler.h"
#include "src/diagnostics/basic-block-profiler.h"
#include <algorithm>
#include <numeric>
@ -51,7 +51,6 @@ intptr_t BasicBlockProfiler::Data::GetCounterAddress(size_t offset) {
return reinterpret_cast<intptr_t>(&(counts_[offset]));
}
void BasicBlockProfiler::Data::ResetCounts() {
for (size_t i = 0; i < n_blocks_; ++i) {
counts_[i] = 0;
@ -65,21 +64,18 @@ BasicBlockProfiler::Data* BasicBlockProfiler::NewData(size_t n_blocks) {
return data;
}
BasicBlockProfiler::~BasicBlockProfiler() {
for (DataList::iterator i = data_list_.begin(); i != data_list_.end(); ++i) {
delete (*i);
}
}
void BasicBlockProfiler::ResetCounts() {
for (DataList::iterator i = data_list_.begin(); i != data_list_.end(); ++i) {
(*i)->ResetCounts();
}
}
std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler& p) {
os << "---- Start Profiling Data ----" << std::endl;
typedef BasicBlockProfiler::DataList::const_iterator iterator;
@ -90,7 +86,6 @@ std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler& p) {
return os;
}
std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler::Data& d) {
int block_count_sum = std::accumulate(d.counts_.begin(), d.counts_.end(), 0);
if (block_count_sum == 0) return os;
@ -112,8 +107,7 @@ std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler::Data& d) {
std::sort(pairs.begin(), pairs.end(),
[=](std::pair<int32_t, uint32_t> left,
std::pair<int32_t, uint32_t> right) {
if (right.second == left.second)
return left.first < right.first;
if (right.second == left.second) return left.first < right.first;
return right.second < left.second;
});
for (auto it : pairs) {

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_BASIC_BLOCK_PROFILER_H_
#define V8_BASIC_BLOCK_PROFILER_H_
#ifndef V8_DIAGNOSTICS_BASIC_BLOCK_PROFILER_H_
#define V8_DIAGNOSTICS_BASIC_BLOCK_PROFILER_H_
#include <iosfwd>
#include <list>
@ -77,4 +77,4 @@ std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler::Data& s);
} // namespace internal
} // namespace v8
#endif // V8_BASIC_BLOCK_PROFILER_H_
#endif // V8_DIAGNOSTICS_BASIC_BLOCK_PROFILER_H_

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_DISASM_H_
#define V8_DISASM_H_
#ifndef V8_DIAGNOSTICS_DISASM_H_
#define V8_DIAGNOSTICS_DISASM_H_
#include "src/vector.h"
@ -78,4 +78,4 @@ class Disassembler {
} // namespace disasm
#endif // V8_DISASM_H_
#endif // V8_DIAGNOSTICS_DISASM_H_

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/disassembler.h"
#include "src/diagnostics/disassembler.h"
#include <memory>
#include <unordered_map>
@ -13,7 +13,7 @@
#include "src/code-reference.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/disasm.h"
#include "src/diagnostics/disasm.h"
#include "src/ic/ic.h"
#include "src/isolate-data.h"
#include "src/macro-assembler.h"
@ -30,7 +30,7 @@ namespace internal {
#ifdef ENABLE_DISASSEMBLER
class V8NameConverter: public disasm::NameConverter {
class V8NameConverter : public disasm::NameConverter {
public:
explicit V8NameConverter(Isolate* isolate, CodeReference code = {})
: isolate_(isolate), code_(code) {}
@ -108,7 +108,6 @@ const char* V8NameConverter::NameOfAddress(byte* pc) const {
return disasm::NameConverter::NameOfAddress(pc);
}
const char* V8NameConverter::NameInCode(byte* addr) const {
// The V8NameConverter is used for well known code, so we can "safely"
// dereference pointers in generated code.
@ -188,7 +187,6 @@ static void DumpBuffer(std::ostream* os, StringBuilder* out) {
out->Reset();
}
static const int kOutBufferSize = 2048 + String::kMaxShortPrintLength;
static const int kRelocInfoPosition = 57;
@ -293,8 +291,7 @@ static int DecodeIt(Isolate* isolate, ExternalReferenceEncoder* ref_encoder,
// First decode instruction so that we know its length.
byte* prev_pc = pc;
if (constants > 0) {
SNPrintF(decode_buffer,
"%08x constant",
SNPrintF(decode_buffer, "%08x constant",
*reinterpret_cast<int32_t*>(pc));
constants--;
pc += 4;
@ -381,8 +378,7 @@ static int DecodeIt(Isolate* isolate, ExternalReferenceEncoder* ref_encoder,
// already, check if we can find some RelocInfo for the target address in
// the constant pool.
if (pcs.empty() && !code.is_null()) {
RelocInfo dummy_rinfo(reinterpret_cast<Address>(prev_pc),
RelocInfo::NONE,
RelocInfo dummy_rinfo(reinterpret_cast<Address>(prev_pc), RelocInfo::NONE,
0, Code());
if (dummy_rinfo.IsInConstantPool()) {
Address constant_pool_entry_address =

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_DISASSEMBLER_H_
#define V8_DISASSEMBLER_H_
#ifndef V8_DIAGNOSTICS_DISASSEMBLER_H_
#define V8_DIAGNOSTICS_DISASSEMBLER_H_
#include "src/allocation.h"
#include "src/code-reference.h"
@ -29,4 +29,4 @@ class Disassembler : public AllStatic {
} // namespace internal
} // namespace v8
#endif // V8_DISASSEMBLER_H_
#endif // V8_DIAGNOSTICS_DISASSEMBLER_H_

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
#include <iomanip>
#include <ostream>
@ -493,8 +493,9 @@ void EhFrameDisassembler::DumpDwarfDirectives(std::ostream& stream, // NOLINT
if (((bytecode >> EhFrameConstants::kSavedRegisterMaskSize) & 0xFF) ==
EhFrameConstants::kSavedRegisterTag) {
int32_t decoded_offset = eh_frame_iterator.GetNextULeb128();
stream << "| " << DwarfRegisterCodeToString(
bytecode & EhFrameConstants::kLocationMask)
stream << "| "
<< DwarfRegisterCodeToString(bytecode &
EhFrameConstants::kLocationMask)
<< " saved at base" << std::showpos
<< decoded_offset * EhFrameConstants::kDataAlignmentFactor
<< std::noshowpos << '\n';
@ -503,8 +504,9 @@ void EhFrameDisassembler::DumpDwarfDirectives(std::ostream& stream, // NOLINT
if (((bytecode >> EhFrameConstants::kFollowInitialRuleMaskSize) & 0xFF) ==
EhFrameConstants::kFollowInitialRuleTag) {
stream << "| " << DwarfRegisterCodeToString(
bytecode & EhFrameConstants::kLocationMask)
stream << "| "
<< DwarfRegisterCodeToString(bytecode &
EhFrameConstants::kLocationMask)
<< " follows rule in CIE\n";
continue;
}

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_EH_FRAME_H_
#define V8_EH_FRAME_H_
#ifndef V8_DIAGNOSTICS_EH_FRAME_H_
#define V8_DIAGNOSTICS_EH_FRAME_H_
#include "src/base/compiler-specific.h"
#include "src/globals.h"
@ -305,4 +305,4 @@ class EhFrameDisassembler final {
} // namespace internal
} // namespace v8
#endif // V8_EH_FRAME_H_
#endif // V8_DIAGNOSTICS_EH_FRAME_H_

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/gdb-jit.h"
#include "src/diagnostics/gdb-jit.h"
#include <memory>
#include <vector>
@ -47,58 +47,47 @@ class Writer {
: debug_object_(debug_object),
position_(0),
capacity_(1024),
buffer_(reinterpret_cast<byte*>(malloc(capacity_))) {
}
buffer_(reinterpret_cast<byte*>(malloc(capacity_))) {}
~Writer() {
free(buffer_);
}
~Writer() { free(buffer_); }
uintptr_t position() const {
return position_;
}
uintptr_t position() const { return position_; }
template<typename T>
template <typename T>
class Slot {
public:
Slot(Writer* w, uintptr_t offset) : w_(w), offset_(offset) { }
Slot(Writer* w, uintptr_t offset) : w_(w), offset_(offset) {}
T* operator-> () {
return w_->RawSlotAt<T>(offset_);
}
T* operator->() { return w_->RawSlotAt<T>(offset_); }
void set(const T& value) {
*w_->RawSlotAt<T>(offset_) = value;
}
void set(const T& value) { *w_->RawSlotAt<T>(offset_) = value; }
Slot<T> at(int i) {
return Slot<T>(w_, offset_ + sizeof(T) * i);
}
Slot<T> at(int i) { return Slot<T>(w_, offset_ + sizeof(T) * i); }
private:
Writer* w_;
uintptr_t offset_;
};
template<typename T>
template <typename T>
void Write(const T& val) {
Ensure(position_ + sizeof(T));
*RawSlotAt<T>(position_) = val;
position_ += sizeof(T);
}
template<typename T>
template <typename T>
Slot<T> SlotAt(uintptr_t offset) {
Ensure(offset + sizeof(T));
return Slot<T>(this, offset);
}
template<typename T>
template <typename T>
Slot<T> CreateSlotHere() {
return CreateSlotsHere<T>(1);
}
template<typename T>
template <typename T>
Slot<T> CreateSlotsHere(uint32_t count) {
uintptr_t slot_position = position_;
position_ += sizeof(T) * count;
@ -158,9 +147,10 @@ class Writer {
}
private:
template<typename T> friend class Slot;
template <typename T>
friend class Slot;
template<typename T>
template <typename T>
T* RawSlotAt(uintptr_t offset) {
DCHECK(offset < capacity_ && offset + sizeof(T) <= capacity_);
return reinterpret_cast<T*>(&buffer_[offset]);
@ -174,7 +164,7 @@ class Writer {
class ELFStringTable;
template<typename THeader>
template <typename THeader>
class DebugSectionBase : public ZoneObject {
public:
virtual ~DebugSectionBase() = default;
@ -191,14 +181,11 @@ class DebugSectionBase : public ZoneObject {
}
}
virtual bool WriteBodyInternal(Writer* writer) {
return false;
}
virtual bool WriteBodyInternal(Writer* writer) { return false; }
typedef THeader Header;
};
struct MachOSectionHeader {
char sectname[16];
char segname[16];
@ -218,7 +205,6 @@ struct MachOSectionHeader {
uint32_t reserved2;
};
class MachOSection : public DebugSectionBase<MachOSectionHeader> {
public:
enum Type {
@ -265,7 +251,6 @@ class MachOSection : public DebugSectionBase<MachOSectionHeader> {
uint32_t flags_;
};
struct ELFSectionHeader {
uint32_t name;
uint32_t type;
@ -279,7 +264,6 @@ struct ELFSectionHeader {
uintptr_t entry_size;
};
#if defined(__ELF)
class ELFSection : public DebugSectionBase<ELFSectionHeader> {
public:
@ -303,16 +287,12 @@ class ELFSection : public DebugSectionBase<ELFSectionHeader> {
TYPE_HIUSER = 0xFFFFFFFF
};
enum Flags {
FLAG_WRITE = 1,
FLAG_ALLOC = 2,
FLAG_EXEC = 4
};
enum Flags { FLAG_WRITE = 1, FLAG_ALLOC = 2, FLAG_EXEC = 4 };
enum SpecialIndexes { INDEX_ABSOLUTE = 0xFFF1 };
ELFSection(const char* name, Type type, uintptr_t align)
: name_(name), type_(type), align_(align) { }
: name_(name), type_(type), align_(align) {}
~ELFSection() override = default;
@ -351,7 +331,6 @@ class ELFSection : public DebugSectionBase<ELFSectionHeader> {
};
#endif // defined(__ELF)
#if defined(__MACH_O)
class MachOTextSection : public MachOSection {
public:
@ -376,22 +355,17 @@ class MachOTextSection : public MachOSection {
};
#endif // defined(__MACH_O)
#if defined(__ELF)
class FullHeaderELFSection : public ELFSection {
public:
FullHeaderELFSection(const char* name,
Type type,
uintptr_t align,
uintptr_t addr,
uintptr_t offset,
uintptr_t size,
FullHeaderELFSection(const char* name, Type type, uintptr_t align,
uintptr_t addr, uintptr_t offset, uintptr_t size,
uintptr_t flags)
: ELFSection(name, type, align),
addr_(addr),
offset_(offset),
size_(size),
flags_(flags) { }
flags_(flags) {}
protected:
void PopulateHeader(Writer::Slot<Header> header) override {
@ -409,7 +383,6 @@ class FullHeaderELFSection : public ELFSection {
uintptr_t flags_;
};
class ELFStringTable : public ELFSection {
public:
explicit ELFStringTable(const char* name)
@ -458,7 +431,6 @@ class ELFStringTable : public ELFSection {
uintptr_t size_;
};
void ELFSection::PopulateHeader(Writer::Slot<ELFSection::Header> header,
ELFStringTable* strtab) {
header->name = static_cast<uint32_t>(strtab->Add(name_));
@ -468,7 +440,6 @@ void ELFSection::PopulateHeader(Writer::Slot<ELFSection::Header> header,
}
#endif // defined(__ELF)
#if defined(__MACH_O)
class MachO {
public:
@ -482,9 +453,8 @@ class MachO {
void Write(Writer* w, uintptr_t code_start, uintptr_t code_size) {
Writer::Slot<MachOHeader> header = WriteHeader(w);
uintptr_t load_command_start = w->position();
Writer::Slot<MachOSegmentCommand> cmd = WriteSegmentCommand(w,
code_start,
code_size);
Writer::Slot<MachOSegmentCommand> cmd =
WriteSegmentCommand(w, code_start, code_size);
WriteSections(w, cmd, header, load_command_start);
}
@ -528,18 +498,17 @@ class MachO {
LC_SEGMENT_64 = 0x00000019u
};
Writer::Slot<MachOHeader> WriteHeader(Writer* w) {
DCHECK_EQ(w->position(), 0);
Writer::Slot<MachOHeader> header = w->CreateSlotHere<MachOHeader>();
#if V8_TARGET_ARCH_IA32
header->magic = 0xFEEDFACEu;
header->cputype = 7; // i386
header->cputype = 7; // i386
header->cpusubtype = 3; // CPU_SUBTYPE_I386_ALL
#elif V8_TARGET_ARCH_X64
header->magic = 0xFEEDFACFu;
header->cputype = 7 | 0x01000000; // i386 | 64-bit ABI
header->cpusubtype = 3; // CPU_SUBTYPE_I386_ALL
header->cpusubtype = 3; // CPU_SUBTYPE_I386_ALL
header->reserved = 0;
#else
#error Unsupported target architecture.
@ -551,7 +520,6 @@ class MachO {
return header;
}
Writer::Slot<MachOSegmentCommand> WriteSegmentCommand(Writer* w,
uintptr_t code_start,
uintptr_t code_size) {
@ -571,14 +539,12 @@ class MachO {
cmd->flags = 0;
cmd->nsects = static_cast<uint32_t>(sections_.size());
memset(cmd->segname, 0, 16);
cmd->cmdsize = sizeof(MachOSegmentCommand) + sizeof(MachOSection::Header) *
cmd->nsects;
cmd->cmdsize = sizeof(MachOSegmentCommand) +
sizeof(MachOSection::Header) * cmd->nsects;
return cmd;
}
void WriteSections(Writer* w,
Writer::Slot<MachOSegmentCommand> cmd,
void WriteSections(Writer* w, Writer::Slot<MachOSegmentCommand> cmd,
Writer::Slot<MachOHeader> header,
uintptr_t load_command_start) {
Writer::Slot<MachOSection::Header> headers =
@ -600,7 +566,6 @@ class MachO {
};
#endif // defined(__MACH_O)
#if defined(__ELF)
class ELF {
public:
@ -641,15 +606,14 @@ class ELF {
uint16_t sht_strtab_index;
};
void WriteHeader(Writer* w) {
DCHECK_EQ(w->position(), 0);
Writer::Slot<ELFHeader> header = w->CreateSlotHere<ELFHeader>();
#if (V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM)
const uint8_t ident[16] = {0x7F, 'E', 'L', 'F', 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0};
#elif(V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT) || \
(V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
#elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT || \
V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN
const uint8_t ident[16] = {0x7F, 'E', 'L', 'F', 2, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0};
#elif V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN && V8_OS_LINUX
@ -763,39 +727,27 @@ class ELFSymbol {
BIND_HIPROC = 15
};
ELFSymbol(const char* name,
uintptr_t value,
uintptr_t size,
Binding binding,
Type type,
uint16_t section)
ELFSymbol(const char* name, uintptr_t value, uintptr_t size, Binding binding,
Type type, uint16_t section)
: name(name),
value(value),
size(size),
info((binding << 4) | type),
other(0),
section(section) {
}
section(section) {}
Binding binding() const {
return static_cast<Binding>(info >> 4);
}
#if (V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || \
Binding binding() const { return static_cast<Binding>(info >> 4); }
#if (V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || \
(V8_TARGET_ARCH_S390 && V8_TARGET_ARCH_32_BIT))
struct SerializedLayout {
SerializedLayout(uint32_t name,
uintptr_t value,
uintptr_t size,
Binding binding,
Type type,
uint16_t section)
SerializedLayout(uint32_t name, uintptr_t value, uintptr_t size,
Binding binding, Type type, uint16_t section)
: name(name),
value(value),
size(size),
info((binding << 4) | type),
other(0),
section(section) {
}
section(section) {}
uint32_t name;
uintptr_t value;
@ -804,22 +756,17 @@ class ELFSymbol {
uint8_t other;
uint16_t section;
};
#elif(V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT) || \
(V8_TARGET_ARCH_PPC64 && V8_OS_LINUX) || V8_TARGET_ARCH_S390X
#elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT || \
V8_TARGET_ARCH_PPC64 && V8_OS_LINUX || V8_TARGET_ARCH_S390X
struct SerializedLayout {
SerializedLayout(uint32_t name,
uintptr_t value,
uintptr_t size,
Binding binding,
Type type,
uint16_t section)
SerializedLayout(uint32_t name, uintptr_t value, uintptr_t size,
Binding binding, Type type, uint16_t section)
: name(name),
info((binding << 4) | type),
other(0),
section(section),
value(value),
size(size) {
}
size(size) {}
uint32_t name;
uint8_t info;
@ -849,7 +796,6 @@ class ELFSymbol {
uint16_t section;
};
class ELFSymbolTable : public ELFSection {
public:
ELFSymbolTable(const char* name, Zone* zone)
@ -872,12 +818,8 @@ class ELFSymbolTable : public ELFSection {
ELFStringTable* strtab =
static_cast<ELFStringTable*>(w->debug_object()->SectionAt(index() + 1));
strtab->AttachWriter(w);
symbols.at(0).set(ELFSymbol::SerializedLayout(0,
0,
0,
ELFSymbol::BIND_LOCAL,
ELFSymbol::TYPE_NOTYPE,
0));
symbols.at(0).set(ELFSymbol::SerializedLayout(
0, 0, 0, ELFSymbol::BIND_LOCAL, ELFSymbol::TYPE_NOTYPE, 0));
WriteSymbolsList(&locals_, symbols.at(1), strtab);
WriteSymbolsList(&globals_,
symbols.at(static_cast<uint32_t>(locals_.size() + 1)),
@ -917,7 +859,6 @@ class ELFSymbolTable : public ELFSection {
};
#endif // defined(__ELF)
class LineInfo : public Malloced {
public:
void SetPosition(intptr_t pc, int pos, bool is_statement) {
@ -956,9 +897,7 @@ class CodeDescription {
LineInfo* lineinfo)
: name_(name), code_(code), shared_info_(shared), lineinfo_(lineinfo) {}
const char* name() const {
return name_;
}
const char* name() const { return name_; }
LineInfo* lineinfo() const { return lineinfo_; }
@ -982,9 +921,7 @@ class CodeDescription {
return static_cast<uintptr_t>(code_->InstructionEnd());
}
uintptr_t CodeSize() const {
return CodeEnd() - CodeStart();
}
uintptr_t CodeSize() const { return CodeEnd() - CodeStart(); }
bool has_script() {
return !shared_info_.is_null() && shared_info_->script()->IsScript();
@ -1037,8 +974,8 @@ class CodeDescription {
#if defined(__ELF)
static void CreateSymbolsTable(CodeDescription* desc, Zone* zone, ELF* elf,
size_t text_section_index) {
ELFSymbolTable* symtab = new(zone) ELFSymbolTable(".symtab", zone);
ELFStringTable* strtab = new(zone) ELFStringTable(".strtab");
ELFSymbolTable* symtab = new (zone) ELFSymbolTable(".symtab", zone);
ELFStringTable* strtab = new (zone) ELFStringTable(".strtab");
// Symbol table should be followed by the linked string table.
elf->AddSection(symtab);
@ -1053,19 +990,17 @@ static void CreateSymbolsTable(CodeDescription* desc, Zone* zone, ELF* elf,
}
#endif // defined(__ELF)
class DebugInfoSection : public DebugSection {
public:
explicit DebugInfoSection(CodeDescription* desc)
#if defined(__ELF)
: ELFSection(".debug_info", TYPE_PROGBITS, 1),
#else
: MachOSection("__debug_info",
"__DWARF",
1,
: MachOSection("__debug_info", "__DWARF", 1,
MachOSection::S_REGULAR | MachOSection::S_ATTR_DEBUG),
#endif
desc_(desc) { }
desc_(desc) {
}
// DWARF2 standard
enum DWARF2LocationOp {
@ -1104,10 +1039,7 @@ class DebugInfoSection : public DebugSection {
DW_OP_fbreg = 0x91 // 1 param: SLEB128 offset
};
enum DWARF2Encoding {
DW_ATE_ADDRESS = 0x1,
DW_ATE_SIGNED = 0x5
};
enum DWARF2Encoding { DW_ATE_ADDRESS = 0x1, DW_ATE_SIGNED = 0x5 };
bool WriteBodyInternal(Writer* w) override {
uintptr_t cu_start = w->position();
@ -1193,9 +1125,7 @@ class DebugInfoSection : public DebugSection {
w->WriteULEB128(current_abbreviation++);
w->WriteString(".native_context");
for (int context_slot = 0;
context_slot < context_slots;
++context_slot) {
for (int context_slot = 0; context_slot < context_slots; ++context_slot) {
w->WriteULEB128(current_abbreviation++);
builder.Reset();
builder.AddFormatted("context_slot%d", context_slot + internal_slots);
@ -1236,19 +1166,17 @@ class DebugInfoSection : public DebugSection {
CodeDescription* desc_;
};
class DebugAbbrevSection : public DebugSection {
public:
explicit DebugAbbrevSection(CodeDescription* desc)
#ifdef __ELF
: ELFSection(".debug_abbrev", TYPE_PROGBITS, 1),
#else
: MachOSection("__debug_abbrev",
"__DWARF",
1,
: MachOSection("__debug_abbrev", "__DWARF", 1,
MachOSection::S_REGULAR | MachOSection::S_ATTR_DEBUG),
#endif
desc_(desc) { }
desc_(desc) {
}
// DWARF2 standard, figure 14.
enum DWARF2Tags {
@ -1262,10 +1190,7 @@ class DebugAbbrevSection : public DebugSection {
};
// DWARF2 standard, figure 16.
enum DWARF2ChildrenDetermination {
DW_CHILDREN_NO = 0,
DW_CHILDREN_YES = 1
};
enum DWARF2ChildrenDetermination { DW_CHILDREN_NO = 0, DW_CHILDREN_YES = 1 };
// DWARF standard, figure 17.
enum DWARF2Attribute {
@ -1292,10 +1217,8 @@ class DebugAbbrevSection : public DebugSection {
DW_FORM_REF4 = 0x13
};
void WriteVariableAbbreviation(Writer* w,
int abbreviation_code,
bool has_value,
bool is_parameter) {
void WriteVariableAbbreviation(Writer* w, int abbreviation_code,
bool has_value, bool is_parameter) {
w->WriteULEB128(abbreviation_code);
w->WriteULEB128(is_parameter ? DW_TAG_FORMAL_PARAMETER : DW_TAG_VARIABLE);
w->Write<uint8_t>(DW_CHILDREN_NO);
@ -1368,15 +1291,12 @@ class DebugAbbrevSection : public DebugSection {
WriteVariableAbbreviation(w, current_abbreviation++, true, true);
}
for (int internal_slot = 0;
internal_slot < internal_slots;
for (int internal_slot = 0; internal_slot < internal_slots;
++internal_slot) {
WriteVariableAbbreviation(w, current_abbreviation++, false, false);
}
for (int context_slot = 0;
context_slot < context_slots;
++context_slot) {
for (int context_slot = 0; context_slot < context_slots; ++context_slot) {
WriteVariableAbbreviation(w, current_abbreviation++, false, false);
}
@ -1397,19 +1317,17 @@ class DebugAbbrevSection : public DebugSection {
CodeDescription* desc_;
};
class DebugLineSection : public DebugSection {
public:
explicit DebugLineSection(CodeDescription* desc)
#ifdef __ELF
: ELFSection(".debug_line", TYPE_PROGBITS, 1),
#else
: MachOSection("__debug_line",
"__DWARF",
1,
: MachOSection("__debug_line", "__DWARF", 1,
MachOSection::S_REGULAR | MachOSection::S_ATTR_DEBUG),
#endif
desc_(desc) { }
desc_(desc) {
}
// DWARF2 standard, figure 34.
enum DWARF2Opcodes {
@ -1442,22 +1360,22 @@ class DebugLineSection : public DebugSection {
w->Write<uint16_t>(2); // Field version.
Writer::Slot<uint32_t> prologue_length = w->CreateSlotHere<uint32_t>();
uintptr_t prologue_start = w->position();
w->Write<uint8_t>(1); // Field minimum_instruction_length.
w->Write<uint8_t>(1); // Field default_is_stmt.
w->Write<int8_t>(line_base); // Field line_base.
w->Write<uint8_t>(line_range); // Field line_range.
w->Write<uint8_t>(1); // Field minimum_instruction_length.
w->Write<uint8_t>(1); // Field default_is_stmt.
w->Write<int8_t>(line_base); // Field line_base.
w->Write<uint8_t>(line_range); // Field line_range.
w->Write<uint8_t>(opcode_base); // Field opcode_base.
w->Write<uint8_t>(0); // DW_LNS_COPY operands count.
w->Write<uint8_t>(1); // DW_LNS_ADVANCE_PC operands count.
w->Write<uint8_t>(1); // DW_LNS_ADVANCE_LINE operands count.
w->Write<uint8_t>(1); // DW_LNS_SET_FILE operands count.
w->Write<uint8_t>(1); // DW_LNS_SET_COLUMN operands count.
w->Write<uint8_t>(0); // DW_LNS_NEGATE_STMT operands count.
w->Write<uint8_t>(0); // Empty include_directories sequence.
w->Write<uint8_t>(0); // DW_LNS_COPY operands count.
w->Write<uint8_t>(1); // DW_LNS_ADVANCE_PC operands count.
w->Write<uint8_t>(1); // DW_LNS_ADVANCE_LINE operands count.
w->Write<uint8_t>(1); // DW_LNS_SET_FILE operands count.
w->Write<uint8_t>(1); // DW_LNS_SET_COLUMN operands count.
w->Write<uint8_t>(0); // DW_LNS_NEGATE_STMT operands count.
w->Write<uint8_t>(0); // Empty include_directories sequence.
w->WriteString(desc_->GetFilename().get()); // File name.
w->WriteULEB128(0); // Current directory.
w->WriteULEB128(0); // Unknown modification time.
w->WriteULEB128(0); // Unknown file size.
w->WriteULEB128(0); // Current directory.
w->WriteULEB128(0); // Unknown modification time.
w->WriteULEB128(0); // Unknown file size.
w->Write<uint8_t>(0);
prologue_length.set(static_cast<uint32_t>(w->position() - prologue_start));
@ -1478,7 +1396,7 @@ class DebugLineSection : public DebugSection {
// Reduce bloating in the debug line table by removing duplicate line
// entries (per DWARF2 standard).
intptr_t new_line = desc_->GetScriptLineNumber(info->pos_);
intptr_t new_line = desc_->GetScriptLineNumber(info->pos_);
if (new_line == line) {
continue;
}
@ -1503,8 +1421,8 @@ class DebugLineSection : public DebugSection {
intptr_t line_diff = new_line - line;
// Compute special opcode (see DWARF 2.0 standard)
intptr_t special_opcode = (line_diff - line_base) +
(line_range * pc_diff) + opcode_base;
intptr_t special_opcode =
(line_diff - line_base) + (line_range * pc_diff) + opcode_base;
// If special_opcode is less than or equal to 255, it can be used as a
// special opcode. If line_diff is larger than the max line increment
@ -1536,8 +1454,7 @@ class DebugLineSection : public DebugSection {
}
private:
void WriteExtendedOpcode(Writer* w,
DWARF2ExtendedOpcode op,
void WriteExtendedOpcode(Writer* w, DWARF2ExtendedOpcode op,
size_t operands_size) {
w->Write<uint8_t>(0);
w->WriteULEB128(operands_size + 1);
@ -1558,7 +1475,6 @@ class DebugLineSection : public DebugSection {
CodeDescription* desc_;
};
#if V8_TARGET_ARCH_X64
class UnwindInfoSection : public DebugSection {
@ -1574,8 +1490,7 @@ class UnwindInfoSection : public DebugSection {
void WriteFDEStateAfterRBPSet(Writer* w);
void WriteFDEStateAfterRBPPop(Writer* w);
void WriteLength(Writer* w,
Writer::Slot<uint32_t>* length_slot,
void WriteLength(Writer* w, Writer::Slot<uint32_t>* length_slot,
int initial_position);
private:
@ -1629,7 +1544,6 @@ class UnwindInfoSection : public DebugSection {
};
};
void UnwindInfoSection::WriteLength(Writer* w,
Writer::Slot<uint32_t>* length_slot,
int initial_position) {
@ -1645,7 +1559,6 @@ void UnwindInfoSection::WriteLength(Writer* w,
length_slot->set(static_cast<uint32_t>(w->position() - initial_position));
}
UnwindInfoSection::UnwindInfoSection(CodeDescription* desc)
#ifdef __ELF
: ELFSection(".eh_frame", TYPE_X86_64_UNWIND, 1),
@ -1653,7 +1566,8 @@ UnwindInfoSection::UnwindInfoSection(CodeDescription* desc)
: MachOSection("__eh_frame", "__TEXT", sizeof(uintptr_t),
MachOSection::S_REGULAR),
#endif
desc_(desc) { }
desc_(desc) {
}
int UnwindInfoSection::WriteCIE(Writer* w) {
Writer::Slot<uint32_t> cie_length_slot = w->CreateSlotHere<uint32_t>();
@ -1674,7 +1588,6 @@ int UnwindInfoSection::WriteCIE(Writer* w) {
return cie_position;
}
void UnwindInfoSection::WriteFDE(Writer* w, int cie_position) {
// The only FDE for this function. The CFA is the current RBP.
Writer::Slot<uint32_t> fde_length_slot = w->CreateSlotHere<uint32_t>();
@ -1692,7 +1605,6 @@ void UnwindInfoSection::WriteFDE(Writer* w, int cie_position) {
WriteLength(w, &fde_length_slot, fde_position);
}
void UnwindInfoSection::WriteFDEStateOnEntry(Writer* w) {
// The first state, just after the control has been transferred to the the
// function.
@ -1719,7 +1631,6 @@ void UnwindInfoSection::WriteFDEStateOnEntry(Writer* w) {
desc_->GetStackStateStartAddress(CodeDescription::POST_RBP_PUSH));
}
void UnwindInfoSection::WriteFDEStateAfterRBPPush(Writer* w) {
// The second state, just after RBP has been pushed.
@ -1740,7 +1651,6 @@ void UnwindInfoSection::WriteFDEStateAfterRBPPush(Writer* w) {
desc_->GetStackStateStartAddress(CodeDescription::POST_RBP_SET));
}
void UnwindInfoSection::WriteFDEStateAfterRBPSet(Writer* w) {
// The third state, after the RBP has been set.
@ -1755,7 +1665,6 @@ void UnwindInfoSection::WriteFDEStateAfterRBPSet(Writer* w) {
desc_->GetStackStateStartAddress(CodeDescription::POST_RBP_POP));
}
void UnwindInfoSection::WriteFDEStateAfterRBPPop(Writer* w) {
// The fourth (final) state. The RBP has been popped (just before issuing a
// return).
@ -1775,80 +1684,69 @@ void UnwindInfoSection::WriteFDEStateAfterRBPPop(Writer* w) {
w->Write<uint64_t>(desc_->CodeEnd());
}
bool UnwindInfoSection::WriteBodyInternal(Writer* w) {
uint32_t cie_position = WriteCIE(w);
WriteFDE(w, cie_position);
return true;
}
#endif // V8_TARGET_ARCH_X64
static void CreateDWARFSections(CodeDescription* desc,
Zone* zone,
static void CreateDWARFSections(CodeDescription* desc, Zone* zone,
DebugObject* obj) {
if (desc->IsLineInfoAvailable()) {
obj->AddSection(new(zone) DebugInfoSection(desc));
obj->AddSection(new(zone) DebugAbbrevSection(desc));
obj->AddSection(new(zone) DebugLineSection(desc));
obj->AddSection(new (zone) DebugInfoSection(desc));
obj->AddSection(new (zone) DebugAbbrevSection(desc));
obj->AddSection(new (zone) DebugLineSection(desc));
}
#if V8_TARGET_ARCH_X64
obj->AddSection(new(zone) UnwindInfoSection(desc));
obj->AddSection(new (zone) UnwindInfoSection(desc));
#endif
}
// -------------------------------------------------------------------
// Binary GDB JIT Interface as described in
// http://sourceware.org/gdb/onlinedocs/gdb/Declarations.html
extern "C" {
typedef enum {
JIT_NOACTION = 0,
JIT_REGISTER_FN,
JIT_UNREGISTER_FN
} JITAction;
typedef enum { JIT_NOACTION = 0, JIT_REGISTER_FN, JIT_UNREGISTER_FN } JITAction;
struct JITCodeEntry {
JITCodeEntry* next_;
JITCodeEntry* prev_;
Address symfile_addr_;
uint64_t symfile_size_;
};
struct JITCodeEntry {
JITCodeEntry* next_;
JITCodeEntry* prev_;
Address symfile_addr_;
uint64_t symfile_size_;
};
struct JITDescriptor {
uint32_t version_;
uint32_t action_flag_;
JITCodeEntry* relevant_entry_;
JITCodeEntry* first_entry_;
};
struct JITDescriptor {
uint32_t version_;
uint32_t action_flag_;
JITCodeEntry* relevant_entry_;
JITCodeEntry* first_entry_;
};
// GDB will place breakpoint into this function.
// To prevent GCC from inlining or removing it we place noinline attribute
// and inline assembler statement inside.
void __attribute__((noinline)) __jit_debug_register_code() {
__asm__("");
}
// GDB will place breakpoint into this function.
// To prevent GCC from inlining or removing it we place noinline attribute
// and inline assembler statement inside.
void __attribute__((noinline)) __jit_debug_register_code() { __asm__(""); }
// GDB will inspect contents of this descriptor.
// Static initialization is necessary to prevent GDB from seeing
// uninitialized descriptor.
JITDescriptor __jit_debug_descriptor = {1, 0, nullptr, nullptr};
// GDB will inspect contents of this descriptor.
// Static initialization is necessary to prevent GDB from seeing
// uninitialized descriptor.
JITDescriptor __jit_debug_descriptor = {1, 0, nullptr, nullptr};
#ifdef OBJECT_PRINT
void __gdb_print_v8_object(Object object) {
StdoutStream os;
object->Print(os);
os << std::flush;
}
void __gdb_print_v8_object(Object object) {
StdoutStream os;
object->Print(os);
os << std::flush;
}
#endif
}
static JITCodeEntry* CreateCodeEntry(Address symfile_addr,
uintptr_t symfile_size) {
JITCodeEntry* entry = static_cast<JITCodeEntry*>(
malloc(sizeof(JITCodeEntry) + symfile_size));
JITCodeEntry* entry =
static_cast<JITCodeEntry*>(malloc(sizeof(JITCodeEntry) + symfile_size));
entry->symfile_addr_ = reinterpret_cast<Address>(entry + 1);
entry->symfile_size_ = symfile_size;
@ -1860,23 +1758,18 @@ static JITCodeEntry* CreateCodeEntry(Address symfile_addr,
return entry;
}
static void DestroyCodeEntry(JITCodeEntry* entry) {
free(entry);
}
static void DestroyCodeEntry(JITCodeEntry* entry) { free(entry); }
static void RegisterCodeEntry(JITCodeEntry* entry) {
entry->next_ = __jit_debug_descriptor.first_entry_;
if (entry->next_ != nullptr) entry->next_->prev_ = entry;
__jit_debug_descriptor.first_entry_ =
__jit_debug_descriptor.relevant_entry_ = entry;
__jit_debug_descriptor.first_entry_ = __jit_debug_descriptor.relevant_entry_ =
entry;
__jit_debug_descriptor.action_flag_ = JIT_REGISTER_FN;
__jit_debug_register_code();
}
static void UnregisterCodeEntry(JITCodeEntry* entry) {
if (entry->prev_ != nullptr) {
entry->prev_->next_ = entry->next_;
@ -1893,16 +1786,14 @@ static void UnregisterCodeEntry(JITCodeEntry* entry) {
__jit_debug_register_code();
}
static JITCodeEntry* CreateELFObject(CodeDescription* desc, Isolate* isolate) {
#ifdef __MACH_O
Zone zone(isolate->allocator(), ZONE_NAME);
MachO mach_o(&zone);
Writer w(&mach_o);
mach_o.AddSection(new(&zone) MachOTextSection(kCodeAlignment,
desc->CodeStart(),
desc->CodeSize()));
mach_o.AddSection(new (&zone) MachOTextSection(
kCodeAlignment, desc->CodeStart(), desc->CodeSize()));
CreateDWARFSections(desc, &zone, &mach_o);
@ -1926,7 +1817,6 @@ static JITCodeEntry* CreateELFObject(CodeDescription* desc, Isolate* isolate) {
return CreateCodeEntry(reinterpret_cast<Address>(w.buffer()), w.position());
}
struct AddressRange {
Address start;
Address end;
@ -1954,7 +1844,6 @@ static CodeMap* GetCodeMap() {
return code_map;
}
static uint32_t HashCodeAddress(Address addr) {
static const uintptr_t kGoldenRatio = 2654435761u;
return static_cast<uint32_t>((addr >> kCodeAlignmentBits) * kGoldenRatio);
@ -1968,7 +1857,6 @@ static base::HashMap* GetLineMap() {
return line_map;
}
static void PutLineInfo(Address addr, LineInfo* info) {
base::HashMap* line_map = GetLineMap();
base::HashMap::Entry* e = line_map->LookupOrInsert(
@ -1977,14 +1865,12 @@ static void PutLineInfo(Address addr, LineInfo* info) {
e->value = info;
}
static LineInfo* GetLineInfo(Address addr) {
void* value = GetLineMap()->Remove(reinterpret_cast<void*>(addr),
HashCodeAddress(addr));
return static_cast<LineInfo*>(value);
}
static void AddUnwindInfo(CodeDescription* desc) {
#if V8_TARGET_ARCH_X64
if (desc->is_function()) {
@ -2021,10 +1907,8 @@ static void AddUnwindInfo(CodeDescription* desc) {
#endif // V8_TARGET_ARCH_X64
}
static base::LazyMutex mutex = LAZY_MUTEX_INITIALIZER;
// Remove entries from the splay tree that intersect the given address range,
// and deregister them from GDB.
static void RemoveJITCodeEntries(CodeMap* map, const AddressRange& range) {
@ -2055,7 +1939,6 @@ static void RemoveJITCodeEntries(CodeMap* map, const AddressRange& range) {
}
}
// Insert the entry into the splay tree and register it with GDB.
static void AddJITCodeEntry(CodeMap* map, const AddressRange& range,
JITCodeEntry* entry, bool dump_if_enabled,
@ -2168,3 +2051,6 @@ void EventHandler(const v8::JitCodeEvent* event) {
} // namespace GDBJITInterface
} // namespace internal
} // namespace v8
#undef __MACH_O
#undef __ELF

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_GDB_JIT_H_
#define V8_GDB_JIT_H_
#ifndef V8_DIAGNOSTICS_GDB_JIT_H_
#define V8_DIAGNOSTICS_GDB_JIT_H_
#include "include/v8.h"
@ -36,4 +36,4 @@ void EventHandler(const v8::JitCodeEvent* event);
} // namespace internal
} // namespace v8
#endif // V8_GDB_JIT_H_
#endif // V8_DIAGNOSTICS_GDB_JIT_H_

View File

@ -5,14 +5,14 @@
#include "src/objects.h"
#include "src/assembler-inl.h"
#include "src/counters.h"
#include "src/date/date.h"
#include "src/disasm.h"
#include "src/disassembler.h"
#include "src/diagnostics/disasm.h"
#include "src/diagnostics/disassembler.h"
#include "src/heap/combined-heap.h"
#include "src/heap/heap-write-barrier-inl.h"
#include "src/ic/handler-configuration-inl.h"
#include "src/init/bootstrapper.h"
#include "src/logging/counters.h"
#include "src/objects-inl.h"
#include "src/objects/allocation-site-inl.h"
#include "src/objects/arguments-inl.h"
@ -1947,7 +1947,7 @@ void JSObject::IncrementSpillStatistics(Isolate* isolate,
// Named properties
if (HasFastProperties()) {
info->number_of_objects_with_fast_properties_++;
info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex();
info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex();
info->number_of_fast_unused_fields_ += map()->UnusedPropertyFields();
} else if (IsJSGlobalObject()) {
GlobalDictionary dict = JSGlobalObject::cast(*this)->global_dictionary();
@ -1980,7 +1980,7 @@ void JSObject::IncrementSpillStatistics(Isolate* isolate,
for (int i = 0; i < len; i++) {
if (e->get(i)->IsTheHole(isolate)) holes++;
}
info->number_of_fast_used_elements_ += len - holes;
info->number_of_fast_used_elements_ += len - holes;
info->number_of_fast_unused_elements_ += holes;
break;
}
@ -2010,7 +2010,6 @@ void JSObject::IncrementSpillStatistics(Isolate* isolate,
}
}
void JSObject::SpillInformation::Clear() {
number_of_objects_ = 0;
number_of_objects_with_fast_properties_ = 0;
@ -2025,21 +2024,20 @@ void JSObject::SpillInformation::Clear() {
number_of_slow_unused_elements_ = 0;
}
void JSObject::SpillInformation::Print() {
PrintF("\n JSObject Spill Statistics (#%d):\n", number_of_objects_);
PrintF(" - fast properties (#%d): %d (used) %d (unused)\n",
number_of_objects_with_fast_properties_,
number_of_fast_used_fields_, number_of_fast_unused_fields_);
number_of_objects_with_fast_properties_, number_of_fast_used_fields_,
number_of_fast_unused_fields_);
PrintF(" - slow properties (#%d): %d (used) %d (unused)\n",
number_of_objects_ - number_of_objects_with_fast_properties_,
number_of_slow_used_properties_, number_of_slow_unused_properties_);
PrintF(" - fast elements (#%d): %d (used) %d (unused)\n",
number_of_objects_with_fast_elements_,
number_of_fast_used_elements_, number_of_fast_unused_elements_);
number_of_objects_with_fast_elements_, number_of_fast_used_elements_,
number_of_fast_unused_elements_);
PrintF(" - slow elements (#%d): %d (used) %d (unused)\n",
number_of_objects_ - number_of_objects_with_fast_elements_,

View File

@ -7,8 +7,8 @@
#include <iomanip>
#include <memory>
#include "src/disasm.h"
#include "src/disassembler.h"
#include "src/diagnostics/disasm.h"
#include "src/diagnostics/disassembler.h"
#include "src/heap/heap-inl.h" // For InOldSpace.
#include "src/heap/heap-write-barrier-inl.h" // For GetIsolateFromWritableObj.
#include "src/init/bootstrapper.h"
@ -472,12 +472,10 @@ void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT
Disassemble(os);
}
void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT
os << "free space, size " << Size() << "\n";
}
template <class Traits>
void FixedTypedArray<Traits>::FixedTypedArrayPrint(
std::ostream& os) { // NOLINT
@ -877,7 +875,6 @@ void Symbol::SymbolPrint(std::ostream& os) { // NOLINT
os << "\n - private: " << is_private();
}
void DescriptorArray::DescriptorArrayPrint(std::ostream& os) {
PrintHeader(os, "DescriptorArray");
os << "\n - enum_cache: ";
@ -1209,7 +1206,6 @@ void JSMessageObject::JSMessageObjectPrint(std::ostream& os) { // NOLINT
JSObjectPrintBody(os, *this);
}
void String::StringPrint(std::ostream& os) { // NOLINT
if (!IsOneByteRepresentation()) {
os << "u";
@ -1241,7 +1237,6 @@ void String::StringPrint(std::ostream& os) { // NOLINT
if (!StringShape(*this).IsInternalized()) os << "\"";
}
void Name::NamePrint(std::ostream& os) { // NOLINT
if (IsString()) {
String::cast(*this)->StringPrint(os);
@ -1250,10 +1245,8 @@ void Name::NamePrint(std::ostream& os) { // NOLINT
}
}
static const char* const weekdays[] = {
"???", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
static const char* const weekdays[] = {"???", "Sun", "Mon", "Tue",
"Wed", "Thu", "Fri", "Sat"};
void JSDate::JSDatePrint(std::ostream& os) { // NOLINT
JSObjectPrintHeader(os, *this, "JSDate");
@ -1276,7 +1269,6 @@ void JSDate::JSDatePrint(std::ostream& os) { // NOLINT
JSObjectPrintBody(os, *this);
}
void JSProxy::JSProxyPrint(std::ostream& os) { // NOLINT
PrintHeader(os, "JSProxy");
os << "\n - target: ";
@ -1643,7 +1635,6 @@ void Foreign::ForeignPrint(std::ostream& os) { // NOLINT
os << "\n";
}
void AccessorInfo::AccessorInfoPrint(std::ostream& os) { // NOLINT
PrintHeader(os, "AccessorInfo");
os << "\n - name: " << Brief(name());
@ -1968,7 +1959,6 @@ void AccessorPair::AccessorPairPrint(std::ostream& os) { // NOLINT
os << "\n";
}
void AccessCheckInfo::AccessCheckInfoPrint(std::ostream& os) { // NOLINT
PrintHeader(os, "AccessCheckInfo");
os << "\n - callback: " << Brief(callback());
@ -1999,7 +1989,6 @@ void InterceptorInfo::InterceptorInfoPrint(std::ostream& os) { // NOLINT
os << "\n";
}
void FunctionTemplateInfo::FunctionTemplateInfoPrint(
std::ostream& os) { // NOLINT
PrintHeader(os, "FunctionTemplateInfo");
@ -2056,7 +2045,6 @@ void ObjectTemplateInfo::ObjectTemplateInfoPrint(std::ostream& os) { // NOLINT
os << "\n";
}
void AllocationSite::AllocationSitePrint(std::ostream& os) { // NOLINT
PrintHeader(os, "AllocationSite");
if (this->HasWeakNext()) os << "\n - weak_next: " << Brief(weak_next());
@ -2080,7 +2068,6 @@ void AllocationSite::AllocationSitePrint(std::ostream& os) { // NOLINT
os << "\n";
}
void AllocationMemento::AllocationMementoPrint(std::ostream& os) { // NOLINT
PrintHeader(os, "AllocationMemento");
os << "\n - allocation site: ";
@ -2091,7 +2078,6 @@ void AllocationMemento::AllocationMementoPrint(std::ostream& os) { // NOLINT
}
}
void Script::ScriptPrint(std::ostream& os) { // NOLINT
PrintHeader(os, "Script");
os << "\n - source: " << Brief(source());

View File

@ -25,12 +25,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "src/perf-jit.h"
#include "src/diagnostics/perf-jit.h"
#include <memory>
#include "src/assembler.h"
#include "src/eh-frame.h"
#include "src/diagnostics/eh-frame.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "src/snapshot/embedded-data.h"
@ -40,7 +40,8 @@
#if V8_OS_LINUX
#include <fcntl.h>
#include <sys/mman.h>
#undef MAP_TYPE // jumbo: conflicts with v8::internal::InstanceType::MAP_TYPE
// jumbo: conflicts with v8::internal::InstanceType::MAP_TYPE
#undef MAP_TYPE // NOLINT
#include <unistd.h>
#endif // V8_OS_LINUX

View File

@ -25,10 +25,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_PERF_JIT_H_
#define V8_PERF_JIT_H_
#ifndef V8_DIAGNOSTICS_PERF_JIT_H_
#define V8_DIAGNOSTICS_PERF_JIT_H_
#include "src/log.h"
#include "src/logging/log.h"
namespace v8 {
namespace internal {
@ -144,4 +144,4 @@ class PerfJitLogger : public CodeEventLogger {
} // namespace internal
} // namespace v8
#endif // V8_PERF_JIT_H_
#endif // V8_DIAGNOSTICS_PERF_JIT_H_

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/unwinding-info-win64.h"
#include "src/diagnostics/unwinding-info-win64.h"
#if defined(V8_OS_WIN_X64)

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_UNWINDING_INFO_WIN64_H_
#define V8_UNWINDING_INFO_WIN64_H_
#ifndef V8_DIAGNOSTICS_UNWINDING_INFO_WIN64_H_
#define V8_DIAGNOSTICS_UNWINDING_INFO_WIN64_H_
#include "include/v8.h"
#include "include/v8config.h"
@ -98,4 +98,4 @@ class XdataEncoder {
#endif // defined(V8_OS_WIN_X64)
#endif // V8_UNWINDING_INFO_WIN64_H_
#endif // V8_DIAGNOSTICS_UNWINDING_INFO_WIN64_H_

View File

@ -4,9 +4,9 @@
#include "src/extensions/statistics-extension.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h" // crbug.com/v8/8499
#include "src/isolate.h"
#include "src/logging/counters.h"
namespace v8 {
namespace internal {

View File

@ -5,9 +5,9 @@
#include "src/external-reference-table.h"
#include "src/accessors.h"
#include "src/counters.h"
#include "src/external-reference.h"
#include "src/ic/stub-cache.h"
#include "src/logging/counters.h"
#if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID)
#define SYMBOLIZE_FUNCTION

View File

@ -9,8 +9,8 @@
#include "src/accessors.h"
#include "src/builtins/builtins.h"
#include "src/counters-definitions.h"
#include "src/external-reference.h"
#include "src/logging/counters-definitions.h"
namespace v8 {
namespace internal {

View File

@ -7,13 +7,13 @@
#include "src/api/api.h"
#include "src/base/ieee754.h"
#include "src/compiler/code-assembler.h"
#include "src/counters.h"
#include "src/cpu-features.h"
#include "src/date/date.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/hash-seed-inl.h"
#include "src/heap/heap.h"
#include "src/logging/counters.h"
#include "src/objects/elements.h"
#include "src/objects/ordered-hash-table.h"
// For IncrementalMarking::RecordWriteFromCode. TODO(jkummerow): Drop.
@ -21,7 +21,7 @@
#include "src/ic/stub-cache.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate.h"
#include "src/log.h"
#include "src/logging/log.h"
#include "src/microtask-queue.h"
#include "src/numbers/math-random.h"
#include "src/objects-inl.h"

View File

@ -13,8 +13,8 @@
#include "src/allocation.h"
#include "src/base/functional.h"
#include "src/base/platform/platform.h"
#include "src/counters.h"
#include "src/cpu-features.h"
#include "src/logging/counters.h"
#include "src/memcopy.h"
#include "src/ostreams.h"
#include "src/utils.h"

View File

@ -11,7 +11,6 @@
#include "src/base/bits.h"
#include "src/builtins/constants-table-builder.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/hash-seed-inl.h"
#include "src/heap/heap-inl.h"
#include "src/heap/incremental-marking.h"
@ -21,7 +20,8 @@
#include "src/init/bootstrapper.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h"
#include "src/log.h"
#include "src/logging/counters.h"
#include "src/logging/log.h"
#include "src/numbers/conversions.h"
#include "src/objects/allocation-site-inl.h"
#include "src/objects/api-callbacks.h"

View File

@ -7,11 +7,11 @@
#include <cstdarg>
#include "src/base/atomic-utils.h"
#include "src/counters-inl.h"
#include "src/heap/heap-inl.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/spaces.h"
#include "src/isolate.h"
#include "src/logging/counters-inl.h"
namespace v8 {
namespace internal {

View File

@ -8,10 +8,10 @@
#include "src/base/compiler-specific.h"
#include "src/base/platform/platform.h"
#include "src/base/ring-buffer.h"
#include "src/counters.h"
#include "src/globals.h"
#include "src/heap-symbols.h"
#include "src/heap/heap.h"
#include "src/logging/counters.h"
#include "testing/gtest/include/gtest/gtest_prod.h" // nogncheck
namespace v8 {

View File

@ -49,7 +49,7 @@
#include "src/heap/sweeper.h"
#include "src/init/bootstrapper.h"
#include "src/interpreter/interpreter.h"
#include "src/log.h"
#include "src/logging/log.h"
#include "src/microtask-queue.h"
#include "src/numbers/conversions.h"
#include "src/objects/data-handler.h"

Some files were not shown because too many files have changed in this diff Show More