[cleanup] Refactor out enums from debug-interface.h
Moved CoverageMode and TypeProfileMode enums to interface-types.h to save one include in isolate.h. This reduces the expanded lines of code count by ~45k. Bug: v8:8834 R=yangguo@chromium.org Change-Id: I399fe8cf66b1aec79bcb5831afd46a74e358244d Reviewed-on: https://chromium-review.googlesource.com/c/1489072 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/master@{#59886}
This commit is contained in:
parent
834c4b3568
commit
226adea450
@ -9811,7 +9811,7 @@ debug::Coverage debug::Coverage::CollectBestEffort(Isolate* isolate) {
|
||||
i::Coverage::CollectBestEffort(reinterpret_cast<i::Isolate*>(isolate)));
|
||||
}
|
||||
|
||||
void debug::Coverage::SelectMode(Isolate* isolate, debug::Coverage::Mode mode) {
|
||||
void debug::Coverage::SelectMode(Isolate* isolate, debug::CoverageMode mode) {
|
||||
i::Coverage::SelectMode(reinterpret_cast<i::Isolate*>(isolate), mode);
|
||||
}
|
||||
|
||||
@ -9851,7 +9851,7 @@ debug::TypeProfile debug::TypeProfile::Collect(Isolate* isolate) {
|
||||
}
|
||||
|
||||
void debug::TypeProfile::SelectMode(Isolate* isolate,
|
||||
debug::TypeProfile::Mode mode) {
|
||||
debug::TypeProfileMode mode) {
|
||||
i::TypeProfile::SelectMode(reinterpret_cast<i::Isolate*>(isolate), mode);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "include/v8-testing.h"
|
||||
#include "src/contexts.h"
|
||||
#include "src/debug/debug-interface.h"
|
||||
#include "src/detachable-vector.h"
|
||||
#include "src/heap/factory.h"
|
||||
#include "src/isolate.h"
|
||||
@ -28,6 +27,12 @@ namespace internal {
|
||||
class JSArrayBufferView;
|
||||
} // namespace internal
|
||||
|
||||
namespace debug {
|
||||
class GeneratorObject;
|
||||
class Script;
|
||||
class WeakMap;
|
||||
} // namespace debug
|
||||
|
||||
// Constants used in the implementation of the API. The most natural thing
|
||||
// would usually be to place these with the classes that use them, but
|
||||
// we want to keep them out of v8.h because it is an externally
|
||||
|
@ -2960,7 +2960,7 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[], bool last_run) {
|
||||
{
|
||||
SetWaitUntilDone(isolate, false);
|
||||
if (options.lcov_file) {
|
||||
debug::Coverage::SelectMode(isolate, debug::Coverage::kBlockCount);
|
||||
debug::Coverage::SelectMode(isolate, debug::CoverageMode::kBlockCount);
|
||||
}
|
||||
HandleScope scope(isolate);
|
||||
Local<Context> context = CreateEvaluationContext(isolate);
|
||||
|
@ -375,20 +375,20 @@ void ResetAllBlockCounts(SharedFunctionInfo shared) {
|
||||
}
|
||||
}
|
||||
|
||||
bool IsBlockMode(debug::Coverage::Mode mode) {
|
||||
bool IsBlockMode(debug::CoverageMode mode) {
|
||||
switch (mode) {
|
||||
case debug::Coverage::kBlockBinary:
|
||||
case debug::Coverage::kBlockCount:
|
||||
case debug::CoverageMode::kBlockBinary:
|
||||
case debug::CoverageMode::kBlockCount:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsBinaryMode(debug::Coverage::Mode mode) {
|
||||
bool IsBinaryMode(debug::CoverageMode mode) {
|
||||
switch (mode) {
|
||||
case debug::Coverage::kBlockBinary:
|
||||
case debug::Coverage::kPreciseBinary:
|
||||
case debug::CoverageMode::kBlockBinary:
|
||||
case debug::CoverageMode::kPreciseBinary:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -396,14 +396,14 @@ bool IsBinaryMode(debug::Coverage::Mode mode) {
|
||||
}
|
||||
|
||||
void CollectBlockCoverage(CoverageFunction* function, SharedFunctionInfo info,
|
||||
debug::Coverage::Mode mode) {
|
||||
debug::CoverageMode mode) {
|
||||
DCHECK(IsBlockMode(mode));
|
||||
|
||||
function->has_block_coverage = true;
|
||||
function->blocks = GetSortedBlockData(info);
|
||||
|
||||
// If in binary mode, only report counts of 0/1.
|
||||
if (mode == debug::Coverage::kBlockBinary) ClampToBinary(function);
|
||||
if (mode == debug::CoverageMode::kBlockBinary) ClampToBinary(function);
|
||||
|
||||
// Remove singleton ranges with the same start position as a full range and
|
||||
// throw away their counts.
|
||||
@ -456,20 +456,21 @@ std::unique_ptr<Coverage> Coverage::CollectPrecise(Isolate* isolate) {
|
||||
}
|
||||
|
||||
std::unique_ptr<Coverage> Coverage::CollectBestEffort(Isolate* isolate) {
|
||||
return Collect(isolate, v8::debug::Coverage::kBestEffort);
|
||||
return Collect(isolate, v8::debug::CoverageMode::kBestEffort);
|
||||
}
|
||||
|
||||
std::unique_ptr<Coverage> Coverage::Collect(
|
||||
Isolate* isolate, v8::debug::Coverage::Mode collectionMode) {
|
||||
Isolate* isolate, v8::debug::CoverageMode collectionMode) {
|
||||
SharedToCounterMap counter_map;
|
||||
|
||||
const bool reset_count = collectionMode != v8::debug::Coverage::kBestEffort;
|
||||
const bool reset_count =
|
||||
collectionMode != v8::debug::CoverageMode::kBestEffort;
|
||||
|
||||
switch (isolate->code_coverage_mode()) {
|
||||
case v8::debug::Coverage::kBlockBinary:
|
||||
case v8::debug::Coverage::kBlockCount:
|
||||
case v8::debug::Coverage::kPreciseBinary:
|
||||
case v8::debug::Coverage::kPreciseCount: {
|
||||
case v8::debug::CoverageMode::kBlockBinary:
|
||||
case v8::debug::CoverageMode::kBlockCount:
|
||||
case v8::debug::CoverageMode::kPreciseBinary:
|
||||
case v8::debug::CoverageMode::kPreciseCount: {
|
||||
// Feedback vectors are already listed to prevent losing them to GC.
|
||||
DCHECK(isolate->factory()
|
||||
->feedback_vectors_for_profiling_tools()
|
||||
@ -486,11 +487,11 @@ std::unique_ptr<Coverage> Coverage::Collect(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case v8::debug::Coverage::kBestEffort: {
|
||||
case v8::debug::CoverageMode::kBestEffort: {
|
||||
DCHECK(!isolate->factory()
|
||||
->feedback_vectors_for_profiling_tools()
|
||||
->IsArrayList());
|
||||
DCHECK_EQ(v8::debug::Coverage::kBestEffort, collectionMode);
|
||||
DCHECK_EQ(v8::debug::CoverageMode::kBestEffort, collectionMode);
|
||||
HeapIterator heap_iterator(isolate->heap());
|
||||
for (HeapObject current_obj = heap_iterator.next();
|
||||
!current_obj.is_null(); current_obj = heap_iterator.next()) {
|
||||
@ -544,15 +545,15 @@ std::unique_ptr<Coverage> Coverage::Collect(
|
||||
}
|
||||
if (count != 0) {
|
||||
switch (collectionMode) {
|
||||
case v8::debug::Coverage::kBlockCount:
|
||||
case v8::debug::Coverage::kPreciseCount:
|
||||
case v8::debug::CoverageMode::kBlockCount:
|
||||
case v8::debug::CoverageMode::kPreciseCount:
|
||||
break;
|
||||
case v8::debug::Coverage::kBlockBinary:
|
||||
case v8::debug::Coverage::kPreciseBinary:
|
||||
case v8::debug::CoverageMode::kBlockBinary:
|
||||
case v8::debug::CoverageMode::kPreciseBinary:
|
||||
count = info->has_reported_binary_coverage() ? 0 : 1;
|
||||
info->set_has_reported_binary_coverage(true);
|
||||
break;
|
||||
case v8::debug::Coverage::kBestEffort:
|
||||
case v8::debug::CoverageMode::kBestEffort:
|
||||
count = 1;
|
||||
break;
|
||||
}
|
||||
@ -583,9 +584,9 @@ std::unique_ptr<Coverage> Coverage::Collect(
|
||||
return result;
|
||||
}
|
||||
|
||||
void Coverage::SelectMode(Isolate* isolate, debug::Coverage::Mode mode) {
|
||||
void Coverage::SelectMode(Isolate* isolate, debug::CoverageMode mode) {
|
||||
switch (mode) {
|
||||
case debug::Coverage::kBestEffort:
|
||||
case debug::CoverageMode::kBestEffort:
|
||||
// Note that DevTools switches back to best-effort coverage once the
|
||||
// recording is stopped. Since we delete coverage infos at that point, any
|
||||
// following coverage recording (without reloads) will be at function
|
||||
@ -596,10 +597,10 @@ void Coverage::SelectMode(Isolate* isolate, debug::Coverage::Mode mode) {
|
||||
ReadOnlyRoots(isolate).undefined_value());
|
||||
}
|
||||
break;
|
||||
case debug::Coverage::kBlockBinary:
|
||||
case debug::Coverage::kBlockCount:
|
||||
case debug::Coverage::kPreciseBinary:
|
||||
case debug::Coverage::kPreciseCount: {
|
||||
case debug::CoverageMode::kBlockBinary:
|
||||
case debug::CoverageMode::kBlockCount:
|
||||
case debug::CoverageMode::kPreciseBinary:
|
||||
case debug::CoverageMode::kPreciseCount: {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
// Remove all optimized function. Optimized and inlined functions do not
|
||||
|
@ -58,11 +58,11 @@ class Coverage : public std::vector<CoverageScript> {
|
||||
static std::unique_ptr<Coverage> CollectBestEffort(Isolate* isolate);
|
||||
|
||||
// Select code coverage mode.
|
||||
static void SelectMode(Isolate* isolate, debug::Coverage::Mode mode);
|
||||
static void SelectMode(Isolate* isolate, debug::CoverageMode mode);
|
||||
|
||||
private:
|
||||
static std::unique_ptr<Coverage> Collect(
|
||||
Isolate* isolate, v8::debug::Coverage::Mode collectionMode);
|
||||
Isolate* isolate, v8::debug::CoverageMode collectionMode);
|
||||
|
||||
Coverage() = default;
|
||||
};
|
||||
|
@ -225,25 +225,6 @@ class V8_EXPORT_PRIVATE Coverage {
|
||||
public:
|
||||
MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(Coverage);
|
||||
|
||||
enum Mode {
|
||||
// Make use of existing information in feedback vectors on the heap.
|
||||
// Only return a yes/no result. Optimization and GC are not affected.
|
||||
// Collecting best effort coverage does not reset counters.
|
||||
kBestEffort,
|
||||
// Disable optimization and prevent feedback vectors from being garbage
|
||||
// collected in order to preserve precise invocation counts. Collecting
|
||||
// precise count coverage resets counters to get incremental updates.
|
||||
kPreciseCount,
|
||||
// We are only interested in a yes/no result for the function. Optimization
|
||||
// and GC can be allowed once a function has been invoked. Collecting
|
||||
// precise binary coverage resets counters for incremental updates.
|
||||
kPreciseBinary,
|
||||
// Similar to the precise coverage modes but provides coverage at a
|
||||
// lower granularity. Design doc: goo.gl/lA2swZ.
|
||||
kBlockCount,
|
||||
kBlockBinary,
|
||||
};
|
||||
|
||||
// Forward declarations.
|
||||
class ScriptData;
|
||||
class FunctionData;
|
||||
@ -310,7 +291,7 @@ class V8_EXPORT_PRIVATE Coverage {
|
||||
static Coverage CollectPrecise(Isolate* isolate);
|
||||
static Coverage CollectBestEffort(Isolate* isolate);
|
||||
|
||||
static void SelectMode(Isolate* isolate, Mode mode);
|
||||
static void SelectMode(Isolate* isolate, CoverageMode mode);
|
||||
|
||||
size_t ScriptCount() const;
|
||||
ScriptData GetScriptData(size_t i) const;
|
||||
@ -329,10 +310,6 @@ class V8_EXPORT_PRIVATE TypeProfile {
|
||||
public:
|
||||
MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeProfile);
|
||||
|
||||
enum Mode {
|
||||
kNone,
|
||||
kCollect,
|
||||
};
|
||||
class ScriptData; // Forward declaration.
|
||||
|
||||
class V8_EXPORT_PRIVATE Entry {
|
||||
@ -372,7 +349,7 @@ class V8_EXPORT_PRIVATE TypeProfile {
|
||||
|
||||
static TypeProfile Collect(Isolate* isolate);
|
||||
|
||||
static void SelectMode(Isolate* isolate, Mode mode);
|
||||
static void SelectMode(Isolate* isolate, TypeProfileMode mode);
|
||||
|
||||
size_t ScriptCount() const;
|
||||
ScriptData GetScriptData(size_t i) const;
|
||||
|
@ -71,10 +71,10 @@ std::unique_ptr<TypeProfile> TypeProfile::Collect(Isolate* isolate) {
|
||||
return result;
|
||||
}
|
||||
|
||||
void TypeProfile::SelectMode(Isolate* isolate, debug::TypeProfile::Mode mode) {
|
||||
void TypeProfile::SelectMode(Isolate* isolate, debug::TypeProfileMode mode) {
|
||||
HandleScope handle_scope(isolate);
|
||||
|
||||
if (mode == debug::TypeProfile::Mode::kNone) {
|
||||
if (mode == debug::TypeProfileMode::kNone) {
|
||||
if (!isolate->factory()
|
||||
->feedback_vectors_for_profiling_tools()
|
||||
->IsUndefined(isolate)) {
|
||||
@ -106,7 +106,7 @@ void TypeProfile::SelectMode(Isolate* isolate, debug::TypeProfile::Mode mode) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DCHECK_EQ(debug::TypeProfile::Mode::kCollect, mode);
|
||||
DCHECK_EQ(debug::TypeProfileMode::kCollect, mode);
|
||||
isolate->MaybeInitializeVectorListFromHeap();
|
||||
}
|
||||
isolate->set_type_profile_mode(mode);
|
||||
|
@ -34,7 +34,7 @@ struct TypeProfileScript {
|
||||
class TypeProfile : public std::vector<TypeProfileScript> {
|
||||
public:
|
||||
static std::unique_ptr<TypeProfile> Collect(Isolate* isolate);
|
||||
static void SelectMode(Isolate* isolate, debug::TypeProfile::Mode mode);
|
||||
static void SelectMode(Isolate* isolate, debug::TypeProfileMode mode);
|
||||
|
||||
private:
|
||||
TypeProfile() = default;
|
||||
|
@ -86,6 +86,30 @@ enum BreakLocationType {
|
||||
kCommonBreakLocation
|
||||
};
|
||||
|
||||
enum class CoverageMode {
|
||||
// Make use of existing information in feedback vectors on the heap.
|
||||
// Only return a yes/no result. Optimization and GC are not affected.
|
||||
// Collecting best effort coverage does not reset counters.
|
||||
kBestEffort,
|
||||
// Disable optimization and prevent feedback vectors from being garbage
|
||||
// collected in order to preserve precise invocation counts. Collecting
|
||||
// precise count coverage resets counters to get incremental updates.
|
||||
kPreciseCount,
|
||||
// We are only interested in a yes/no result for the function. Optimization
|
||||
// and GC can be allowed once a function has been invoked. Collecting
|
||||
// precise binary coverage resets counters for incremental updates.
|
||||
kPreciseBinary,
|
||||
// Similar to the precise coverage modes but provides coverage at a
|
||||
// lower granularity. Design doc: goo.gl/lA2swZ.
|
||||
kBlockCount,
|
||||
kBlockBinary,
|
||||
};
|
||||
|
||||
enum class TypeProfileMode {
|
||||
kNone,
|
||||
kCollect,
|
||||
};
|
||||
|
||||
class V8_EXPORT_PRIVATE BreakLocation : public Location {
|
||||
public:
|
||||
BreakLocation(int line_number, int column_number, BreakLocationType type)
|
||||
|
@ -304,9 +304,10 @@ Response V8ProfilerAgentImpl::startPreciseCoverage(Maybe<bool> callCount,
|
||||
// each function recompiled after the BlockCount mode has been set); and
|
||||
// function-granularity coverage data otherwise.
|
||||
typedef v8::debug::Coverage C;
|
||||
C::Mode mode = callCountValue
|
||||
? (detailedValue ? C::kBlockCount : C::kPreciseCount)
|
||||
: (detailedValue ? C::kBlockBinary : C::kPreciseBinary);
|
||||
typedef v8::debug::CoverageMode Mode;
|
||||
Mode mode = callCountValue
|
||||
? (detailedValue ? Mode::kBlockCount : Mode::kPreciseCount)
|
||||
: (detailedValue ? Mode::kBlockBinary : Mode::kPreciseBinary);
|
||||
C::SelectMode(m_isolate, mode);
|
||||
return Response::OK();
|
||||
}
|
||||
@ -316,7 +317,8 @@ Response V8ProfilerAgentImpl::stopPreciseCoverage() {
|
||||
m_state->setBoolean(ProfilerAgentState::preciseCoverageStarted, false);
|
||||
m_state->setBoolean(ProfilerAgentState::preciseCoverageCallCount, false);
|
||||
m_state->setBoolean(ProfilerAgentState::preciseCoverageDetailed, false);
|
||||
v8::debug::Coverage::SelectMode(m_isolate, v8::debug::Coverage::kBestEffort);
|
||||
v8::debug::Coverage::SelectMode(m_isolate,
|
||||
v8::debug::CoverageMode::kBestEffort);
|
||||
return Response::OK();
|
||||
}
|
||||
|
||||
@ -461,13 +463,14 @@ typeProfileToProtocol(V8InspectorImpl* inspector,
|
||||
Response V8ProfilerAgentImpl::startTypeProfile() {
|
||||
m_state->setBoolean(ProfilerAgentState::typeProfileStarted, true);
|
||||
v8::debug::TypeProfile::SelectMode(m_isolate,
|
||||
v8::debug::TypeProfile::kCollect);
|
||||
v8::debug::TypeProfileMode::kCollect);
|
||||
return Response::OK();
|
||||
}
|
||||
|
||||
Response V8ProfilerAgentImpl::stopTypeProfile() {
|
||||
m_state->setBoolean(ProfilerAgentState::typeProfileStarted, false);
|
||||
v8::debug::TypeProfile::SelectMode(m_isolate, v8::debug::TypeProfile::kNone);
|
||||
v8::debug::TypeProfile::SelectMode(m_isolate,
|
||||
v8::debug::TypeProfileMode::kNone);
|
||||
return Response::OK();
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "src/base/macros.h"
|
||||
#include "src/builtins/builtins.h"
|
||||
#include "src/contexts.h"
|
||||
#include "src/debug/debug-interface.h"
|
||||
#include "src/debug/interface-types.h"
|
||||
#include "src/execution.h"
|
||||
#include "src/futex-emulation.h"
|
||||
#include "src/globals.h"
|
||||
@ -50,6 +50,7 @@ class RandomNumberGenerator;
|
||||
|
||||
namespace debug {
|
||||
class ConsoleDelegate;
|
||||
class AsyncEventDelegate;
|
||||
}
|
||||
|
||||
namespace internal {
|
||||
@ -359,47 +360,47 @@ V8_EXPORT_PRIVATE void FreeCurrentEmbeddedBlob();
|
||||
|
||||
typedef std::vector<HeapObject> DebugObjectCache;
|
||||
|
||||
#define ISOLATE_INIT_LIST(V) \
|
||||
/* Assembler state. */ \
|
||||
V(FatalErrorCallback, exception_behavior, nullptr) \
|
||||
V(OOMErrorCallback, oom_behavior, nullptr) \
|
||||
V(LogEventCallback, event_logger, nullptr) \
|
||||
V(AllowCodeGenerationFromStringsCallback, allow_code_gen_callback, nullptr) \
|
||||
V(AllowWasmCodeGenerationCallback, allow_wasm_code_gen_callback, nullptr) \
|
||||
V(ExtensionCallback, wasm_module_callback, &NoExtension) \
|
||||
V(ExtensionCallback, wasm_instance_callback, &NoExtension) \
|
||||
V(WasmStreamingCallback, wasm_streaming_callback, nullptr) \
|
||||
V(WasmThreadsEnabledCallback, wasm_threads_enabled_callback, nullptr) \
|
||||
/* State for Relocatable. */ \
|
||||
V(Relocatable*, relocatable_top, nullptr) \
|
||||
V(DebugObjectCache*, string_stream_debug_object_cache, nullptr) \
|
||||
V(Object, string_stream_current_security_token, Object()) \
|
||||
V(const intptr_t*, api_external_references, nullptr) \
|
||||
V(AddressToIndexHashMap*, external_reference_map, nullptr) \
|
||||
V(HeapObjectToIndexHashMap*, root_index_map, nullptr) \
|
||||
V(MicrotaskQueue*, default_microtask_queue, nullptr) \
|
||||
V(CompilationStatistics*, turbo_statistics, nullptr) \
|
||||
V(CodeTracer*, code_tracer, nullptr) \
|
||||
V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \
|
||||
V(PromiseRejectCallback, promise_reject_callback, nullptr) \
|
||||
V(const v8::StartupData*, snapshot_blob, nullptr) \
|
||||
V(int, code_and_metadata_size, 0) \
|
||||
V(int, bytecode_and_metadata_size, 0) \
|
||||
V(int, external_script_source_size, 0) \
|
||||
/* true if being profiled. Causes collection of extra compile info. */ \
|
||||
V(bool, is_profiling, false) \
|
||||
/* true if a trace is being formatted through Error.prepareStackTrace. */ \
|
||||
V(bool, formatting_stack_trace, false) \
|
||||
/* Perform side effect checks on function call and API callbacks. */ \
|
||||
V(DebugInfo::ExecutionMode, debug_execution_mode, DebugInfo::kBreakpoints) \
|
||||
/* Current code coverage mode */ \
|
||||
V(debug::Coverage::Mode, code_coverage_mode, debug::Coverage::kBestEffort) \
|
||||
V(debug::TypeProfile::Mode, type_profile_mode, debug::TypeProfile::kNone) \
|
||||
V(int, last_stack_frame_info_id, 0) \
|
||||
V(int, last_console_context_id, 0) \
|
||||
V(v8_inspector::V8Inspector*, inspector, nullptr) \
|
||||
V(bool, next_v8_call_is_safe_for_termination, false) \
|
||||
V(bool, only_terminate_in_safe_scope, false) \
|
||||
#define ISOLATE_INIT_LIST(V) \
|
||||
/* Assembler state. */ \
|
||||
V(FatalErrorCallback, exception_behavior, nullptr) \
|
||||
V(OOMErrorCallback, oom_behavior, nullptr) \
|
||||
V(LogEventCallback, event_logger, nullptr) \
|
||||
V(AllowCodeGenerationFromStringsCallback, allow_code_gen_callback, nullptr) \
|
||||
V(AllowWasmCodeGenerationCallback, allow_wasm_code_gen_callback, nullptr) \
|
||||
V(ExtensionCallback, wasm_module_callback, &NoExtension) \
|
||||
V(ExtensionCallback, wasm_instance_callback, &NoExtension) \
|
||||
V(WasmStreamingCallback, wasm_streaming_callback, nullptr) \
|
||||
V(WasmThreadsEnabledCallback, wasm_threads_enabled_callback, nullptr) \
|
||||
/* State for Relocatable. */ \
|
||||
V(Relocatable*, relocatable_top, nullptr) \
|
||||
V(DebugObjectCache*, string_stream_debug_object_cache, nullptr) \
|
||||
V(Object, string_stream_current_security_token, Object()) \
|
||||
V(const intptr_t*, api_external_references, nullptr) \
|
||||
V(AddressToIndexHashMap*, external_reference_map, nullptr) \
|
||||
V(HeapObjectToIndexHashMap*, root_index_map, nullptr) \
|
||||
V(MicrotaskQueue*, default_microtask_queue, nullptr) \
|
||||
V(CompilationStatistics*, turbo_statistics, nullptr) \
|
||||
V(CodeTracer*, code_tracer, nullptr) \
|
||||
V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \
|
||||
V(PromiseRejectCallback, promise_reject_callback, nullptr) \
|
||||
V(const v8::StartupData*, snapshot_blob, nullptr) \
|
||||
V(int, code_and_metadata_size, 0) \
|
||||
V(int, bytecode_and_metadata_size, 0) \
|
||||
V(int, external_script_source_size, 0) \
|
||||
/* true if being profiled. Causes collection of extra compile info. */ \
|
||||
V(bool, is_profiling, false) \
|
||||
/* true if a trace is being formatted through Error.prepareStackTrace. */ \
|
||||
V(bool, formatting_stack_trace, false) \
|
||||
/* Perform side effect checks on function call and API callbacks. */ \
|
||||
V(DebugInfo::ExecutionMode, debug_execution_mode, DebugInfo::kBreakpoints) \
|
||||
/* Current code coverage mode */ \
|
||||
V(debug::CoverageMode, code_coverage_mode, debug::CoverageMode::kBestEffort) \
|
||||
V(debug::TypeProfileMode, type_profile_mode, debug::TypeProfileMode::kNone) \
|
||||
V(int, last_stack_frame_info_id, 0) \
|
||||
V(int, last_console_context_id, 0) \
|
||||
V(v8_inspector::V8Inspector*, inspector, nullptr) \
|
||||
V(bool, next_v8_call_is_safe_for_termination, false) \
|
||||
V(bool, only_terminate_in_safe_scope, false) \
|
||||
V(bool, detailed_source_positions_for_profiling, FLAG_detailed_line_info)
|
||||
|
||||
#define THREAD_LOCAL_TOP_ACCESSOR(type, name) \
|
||||
@ -1048,23 +1049,23 @@ class Isolate final : private HiddenFactory {
|
||||
bool NeedsDetailedOptimizedCodeLineInfo() const;
|
||||
|
||||
bool is_best_effort_code_coverage() const {
|
||||
return code_coverage_mode() == debug::Coverage::kBestEffort;
|
||||
return code_coverage_mode() == debug::CoverageMode::kBestEffort;
|
||||
}
|
||||
|
||||
bool is_precise_count_code_coverage() const {
|
||||
return code_coverage_mode() == debug::Coverage::kPreciseCount;
|
||||
return code_coverage_mode() == debug::CoverageMode::kPreciseCount;
|
||||
}
|
||||
|
||||
bool is_precise_binary_code_coverage() const {
|
||||
return code_coverage_mode() == debug::Coverage::kPreciseBinary;
|
||||
return code_coverage_mode() == debug::CoverageMode::kPreciseBinary;
|
||||
}
|
||||
|
||||
bool is_block_count_code_coverage() const {
|
||||
return code_coverage_mode() == debug::Coverage::kBlockCount;
|
||||
return code_coverage_mode() == debug::CoverageMode::kBlockCount;
|
||||
}
|
||||
|
||||
bool is_block_binary_code_coverage() const {
|
||||
return code_coverage_mode() == debug::Coverage::kBlockBinary;
|
||||
return code_coverage_mode() == debug::CoverageMode::kBlockBinary;
|
||||
}
|
||||
|
||||
bool is_block_code_coverage() const {
|
||||
@ -1072,7 +1073,7 @@ class Isolate final : private HiddenFactory {
|
||||
}
|
||||
|
||||
bool is_collecting_type_profile() const {
|
||||
return type_profile_mode() == debug::TypeProfile::kCollect;
|
||||
return type_profile_mode() == debug::TypeProfileMode::kCollect;
|
||||
}
|
||||
|
||||
// Collect feedback vectors with data for code coverage or type profile.
|
||||
|
@ -723,16 +723,16 @@ RUNTIME_FUNCTION(Runtime_DebugCollectCoverage) {
|
||||
RUNTIME_FUNCTION(Runtime_DebugTogglePreciseCoverage) {
|
||||
SealHandleScope shs(isolate);
|
||||
CONVERT_BOOLEAN_ARG_CHECKED(enable, 0);
|
||||
Coverage::SelectMode(isolate, enable ? debug::Coverage::kPreciseCount
|
||||
: debug::Coverage::kBestEffort);
|
||||
Coverage::SelectMode(isolate, enable ? debug::CoverageMode::kPreciseCount
|
||||
: debug::CoverageMode::kBestEffort);
|
||||
return ReadOnlyRoots(isolate).undefined_value();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_DebugToggleBlockCoverage) {
|
||||
SealHandleScope shs(isolate);
|
||||
CONVERT_BOOLEAN_ARG_CHECKED(enable, 0);
|
||||
Coverage::SelectMode(isolate, enable ? debug::Coverage::kBlockCount
|
||||
: debug::Coverage::kBestEffort);
|
||||
Coverage::SelectMode(isolate, enable ? debug::CoverageMode::kBlockCount
|
||||
: debug::CoverageMode::kBestEffort);
|
||||
return ReadOnlyRoots(isolate).undefined_value();
|
||||
}
|
||||
|
||||
|
@ -4037,7 +4037,8 @@ TEST(DebugCoverage) {
|
||||
LocalContext env;
|
||||
v8::Isolate* isolate = env->GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
v8::debug::Coverage::SelectMode(isolate, v8::debug::Coverage::kPreciseCount);
|
||||
v8::debug::Coverage::SelectMode(isolate,
|
||||
v8::debug::CoverageMode::kPreciseCount);
|
||||
v8::Local<v8::String> source = v8_str(
|
||||
"function f() {\n"
|
||||
"}\n"
|
||||
@ -4092,7 +4093,8 @@ TEST(DebugCoverageWithCoverageOutOfScope) {
|
||||
LocalContext env;
|
||||
v8::Isolate* isolate = env->GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
v8::debug::Coverage::SelectMode(isolate, v8::debug::Coverage::kPreciseCount);
|
||||
v8::debug::Coverage::SelectMode(isolate,
|
||||
v8::debug::CoverageMode::kPreciseCount);
|
||||
v8::Local<v8::String> source = v8_str(
|
||||
"function f() {\n"
|
||||
"}\n"
|
||||
@ -4163,7 +4165,8 @@ TEST(DebugCoverageWithScriptDataOutOfScope) {
|
||||
LocalContext env;
|
||||
v8::Isolate* isolate = env->GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
v8::debug::Coverage::SelectMode(isolate, v8::debug::Coverage::kPreciseCount);
|
||||
v8::debug::Coverage::SelectMode(isolate,
|
||||
v8::debug::CoverageMode::kPreciseCount);
|
||||
v8::Local<v8::String> source = v8_str(
|
||||
"function f() {\n"
|
||||
"}\n"
|
||||
|
Loading…
Reference in New Issue
Block a user