Skip to content

Commit a7f6c04

Browse files
refackrvagg
authored andcommitted
Revert "src: enable detailed source positions in V8"
This reverts commit e2a8e32. This reverts commit 715bbb9. PR-URL: #24394 Fixes: #24393 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 81ec97b commit a7f6c04

File tree

6 files changed

+2
-57
lines changed

6 files changed

+2
-57
lines changed

deps/v8/include/v8-profiler.h

-6
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,6 @@ class V8_EXPORT CpuProfiler {
341341
V8_DEPRECATED("Use Isolate::SetIdle(bool) instead.",
342342
void SetIdle(bool is_idle));
343343

344-
/**
345-
* Generate more detailed source positions to code objects. This results in
346-
* better results when mapping profiling samples to script source.
347-
*/
348-
static void UseDetailedSourcePositionsForProfiling(Isolate* isolate);
349-
350344
private:
351345
CpuProfiler();
352346
~CpuProfiler();

deps/v8/src/api.cc

-5
Original file line numberDiff line numberDiff line change
@@ -10132,11 +10132,6 @@ void CpuProfiler::SetIdle(bool is_idle) {
1013210132
isolate->SetIdle(is_idle);
1013310133
}
1013410134

10135-
void CpuProfiler::UseDetailedSourcePositionsForProfiling(Isolate* isolate) {
10136-
reinterpret_cast<i::Isolate*>(isolate)
10137-
->set_detailed_source_positions_for_profiling(true);
10138-
}
10139-
1014010135
uintptr_t CodeEvent::GetCodeStartAddress() {
1014110136
return reinterpret_cast<i::CodeEvent*>(this)->code_start_address;
1014210137
}

deps/v8/src/isolate.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3257,8 +3257,7 @@ bool Isolate::use_optimizer() {
32573257
}
32583258

32593259
bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const {
3260-
return NeedsSourcePositionsForProfiling() ||
3261-
detailed_source_positions_for_profiling();
3260+
return NeedsSourcePositionsForProfiling() || FLAG_detailed_line_info;
32623261
}
32633262

32643263
bool Isolate::NeedsSourcePositionsForProfiling() const {

deps/v8/src/isolate.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,7 @@ typedef std::vector<HeapObject*> DebugObjectCache;
553553
V(int, last_console_context_id, 0) \
554554
V(v8_inspector::V8Inspector*, inspector, nullptr) \
555555
V(bool, next_v8_call_is_safe_for_termination, false) \
556-
V(bool, only_terminate_in_safe_scope, false) \
557-
V(bool, detailed_source_positions_for_profiling, FLAG_detailed_line_info)
556+
V(bool, only_terminate_in_safe_scope, false)
558557

559558
#define THREAD_LOCAL_TOP_ACCESSOR(type, name) \
560559
inline void set_##name(type v) { thread_local_top_.name##_ = v; } \

deps/v8/test/cctest/test-cpu-profiler.cc

-41
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include "src/objects-inl.h"
4141
#include "src/profiler/cpu-profiler-inl.h"
4242
#include "src/profiler/profiler-listener.h"
43-
#include "src/source-position-table.h"
4443
#include "src/utils.h"
4544
#include "test/cctest/cctest.h"
4645
#include "test/cctest/profiler-extension.h"
@@ -2545,46 +2544,6 @@ TEST(MultipleProfilers) {
25452544
profiler2->StopProfiling("2");
25462545
}
25472546

2548-
UNINITIALIZED_TEST(DetailedSourcePositionAPI) {
2549-
i::FLAG_detailed_line_info = false;
2550-
i::FLAG_allow_natives_syntax = true;
2551-
v8::Isolate::CreateParams create_params;
2552-
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
2553-
v8::Isolate* isolate = v8::Isolate::New(create_params);
2554-
2555-
const char* source =
2556-
"function fib(i) {"
2557-
" if (i <= 1) return 1; "
2558-
" return fib(i - 1) +"
2559-
" fib(i - 2);"
2560-
"}"
2561-
"fib(5);"
2562-
"%OptimizeFunctionOnNextCall(fib);"
2563-
"fib(5);"
2564-
"fib";
2565-
{
2566-
v8::Isolate::Scope isolate_scope(isolate);
2567-
v8::HandleScope handle_scope(isolate);
2568-
v8::Local<v8::Context> context = v8::Context::New(isolate);
2569-
v8::Context::Scope context_scope(context);
2570-
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
2571-
2572-
CHECK(!i_isolate->NeedsDetailedOptimizedCodeLineInfo());
2573-
2574-
int non_detailed_positions = GetSourcePositionEntryCount(i_isolate, source);
2575-
2576-
v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate);
2577-
CHECK(i_isolate->NeedsDetailedOptimizedCodeLineInfo());
2578-
2579-
int detailed_positions = GetSourcePositionEntryCount(i_isolate, source);
2580-
2581-
CHECK((non_detailed_positions == -1 && detailed_positions == -1) ||
2582-
non_detailed_positions < detailed_positions);
2583-
}
2584-
2585-
isolate->Dispose();
2586-
}
2587-
25882547
} // namespace test_cpu_profiler
25892548
} // namespace internal
25902549
} // namespace v8

src/node.cc

-1
Original file line numberDiff line numberDiff line change
@@ -2608,7 +2608,6 @@ Isolate* NewIsolate(ArrayBufferAllocator* allocator, uv_loop_t* event_loop) {
26082608
isolate->SetMicrotasksPolicy(MicrotasksPolicy::kExplicit);
26092609
isolate->SetFatalErrorHandler(OnFatalError);
26102610
isolate->SetAllowWasmCodeGenerationCallback(AllowWasmCodeGenerationCallback);
2611-
v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate);
26122611

26132612
return isolate;
26142613
}

0 commit comments

Comments
 (0)