Commit 5ed3c81e authored by Maciej Goszczycki's avatar Maciej Goszczycki Committed by Commit Bot

[log] Use uninitialized tests in test-log

Most test-log tests create their own isolates, so initializing the cctest
isolate is not necessary.

Bug: v8:7464
Change-Id: Icc3cd9d5053c4070833709cbe28e5bde2cee9708
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1507719Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#60093}
parent c7436e30
...@@ -330,7 +330,7 @@ TEST(Issue23768) { ...@@ -330,7 +330,7 @@ TEST(Issue23768) {
static void ObjMethod1(const v8::FunctionCallbackInfo<v8::Value>& args) { static void ObjMethod1(const v8::FunctionCallbackInfo<v8::Value>& args) {
} }
TEST(LogCallbacks) { UNINITIALIZED_TEST(LogCallbacks) {
SETUP_FLAGS(); SETUP_FLAGS();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
...@@ -383,7 +383,7 @@ static void Prop2Getter(v8::Local<v8::String> property, ...@@ -383,7 +383,7 @@ static void Prop2Getter(v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) { const v8::PropertyCallbackInfo<v8::Value>& info) {
} }
TEST(LogAccessorCallbacks) { UNINITIALIZED_TEST(LogAccessorCallbacks) {
SETUP_FLAGS(); SETUP_FLAGS();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
...@@ -437,7 +437,7 @@ TEST(LogAccessorCallbacks) { ...@@ -437,7 +437,7 @@ TEST(LogAccessorCallbacks) {
// Test that logging of code create / move events is equivalent to traversal of // Test that logging of code create / move events is equivalent to traversal of
// a resulting heap. // a resulting heap.
TEST(EquivalenceOfLoggingAndTraversal) { UNINITIALIZED_TEST(EquivalenceOfLoggingAndTraversal) {
// This test needs to be run on a "clean" V8 to ensure that snapshot log // This test needs to be run on a "clean" V8 to ensure that snapshot log
// is loaded. This is always true when running using tools/test.py because // is loaded. This is always true when running using tools/test.py because
// it launches a new cctest instance for every test. To be sure that launching // it launches a new cctest instance for every test. To be sure that launching
...@@ -504,8 +504,7 @@ TEST(EquivalenceOfLoggingAndTraversal) { ...@@ -504,8 +504,7 @@ TEST(EquivalenceOfLoggingAndTraversal) {
isolate->Dispose(); isolate->Dispose();
} }
UNINITIALIZED_TEST(LogVersion) {
TEST(LogVersion) {
SETUP_FLAGS(); SETUP_FLAGS();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
...@@ -524,10 +523,9 @@ TEST(LogVersion) { ...@@ -524,10 +523,9 @@ TEST(LogVersion) {
isolate->Dispose(); isolate->Dispose();
} }
// https://crbug.com/539892 // https://crbug.com/539892
// CodeCreateEvents with really large names should not crash. // CodeCreateEvents with really large names should not crash.
TEST(Issue539892) { UNINITIALIZED_TEST(Issue539892) {
class FakeCodeEventLogger : public i::CodeEventLogger { class FakeCodeEventLogger : public i::CodeEventLogger {
public: public:
explicit FakeCodeEventLogger(i::Isolate* isolate) explicit FakeCodeEventLogger(i::Isolate* isolate)
...@@ -542,11 +540,13 @@ TEST(Issue539892) { ...@@ -542,11 +540,13 @@ TEST(Issue539892) {
const char* name, int length) override {} const char* name, int length) override {}
void LogRecordedBuffer(const i::wasm::WasmCode* code, const char* name, void LogRecordedBuffer(const i::wasm::WasmCode* code, const char* name,
int length) override {} int length) override {}
} code_event_logger(CcTest::i_isolate()); };
SETUP_FLAGS(); SETUP_FLAGS();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params); v8::Isolate* isolate = v8::Isolate::New(create_params);
FakeCodeEventLogger code_event_logger(reinterpret_cast<i::Isolate*>(isolate));
{ {
ScopedLoggerInitializer logger(saved_log, saved_prof, isolate); ScopedLoggerInitializer logger(saved_log, saved_prof, isolate);
...@@ -582,7 +582,7 @@ TEST(Issue539892) { ...@@ -582,7 +582,7 @@ TEST(Issue539892) {
isolate->Dispose(); isolate->Dispose();
} }
TEST(LogAll) { UNINITIALIZED_TEST(LogAll) {
SETUP_FLAGS(); SETUP_FLAGS();
i::FLAG_log_all = true; i::FLAG_log_all = true;
i::FLAG_turbo_inlining = false; i::FLAG_turbo_inlining = false;
...@@ -637,7 +637,7 @@ TEST(LogAll) { ...@@ -637,7 +637,7 @@ TEST(LogAll) {
} }
#ifndef V8_TARGET_ARCH_ARM #ifndef V8_TARGET_ARCH_ARM
TEST(LogInterpretedFramesNativeStack) { UNINITIALIZED_TEST(LogInterpretedFramesNativeStack) {
SETUP_FLAGS(); SETUP_FLAGS();
i::FLAG_interpreted_frames_native_stack = true; i::FLAG_interpreted_frames_native_stack = true;
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
...@@ -661,7 +661,7 @@ TEST(LogInterpretedFramesNativeStack) { ...@@ -661,7 +661,7 @@ TEST(LogInterpretedFramesNativeStack) {
} }
#endif // V8_TARGET_ARCH_ARM #endif // V8_TARGET_ARCH_ARM
TEST(ExternalCodeEventListener) { UNINITIALIZED_TEST(ExternalCodeEventListener) {
i::FLAG_log = false; i::FLAG_log = false;
i::FLAG_prof = false; i::FLAG_prof = false;
...@@ -704,7 +704,7 @@ TEST(ExternalCodeEventListener) { ...@@ -704,7 +704,7 @@ TEST(ExternalCodeEventListener) {
isolate->Dispose(); isolate->Dispose();
} }
TEST(ExternalCodeEventListenerInnerFunctions) { UNINITIALIZED_TEST(ExternalCodeEventListenerInnerFunctions) {
i::FLAG_log = false; i::FLAG_log = false;
i::FLAG_prof = false; i::FLAG_prof = false;
...@@ -763,7 +763,7 @@ TEST(ExternalCodeEventListenerInnerFunctions) { ...@@ -763,7 +763,7 @@ TEST(ExternalCodeEventListenerInnerFunctions) {
} }
#ifndef V8_TARGET_ARCH_ARM #ifndef V8_TARGET_ARCH_ARM
TEST(ExternalCodeEventListenerWithInterpretedFramesNativeStack) { UNINITIALIZED_TEST(ExternalCodeEventListenerWithInterpretedFramesNativeStack) {
i::FLAG_log = false; i::FLAG_log = false;
i::FLAG_prof = false; i::FLAG_prof = false;
i::FLAG_interpreted_frames_native_stack = true; i::FLAG_interpreted_frames_native_stack = true;
...@@ -814,7 +814,7 @@ TEST(ExternalCodeEventListenerWithInterpretedFramesNativeStack) { ...@@ -814,7 +814,7 @@ TEST(ExternalCodeEventListenerWithInterpretedFramesNativeStack) {
} }
#endif // V8_TARGET_ARCH_ARM #endif // V8_TARGET_ARCH_ARM
TEST(TraceMaps) { UNINITIALIZED_TEST(TraceMaps) {
SETUP_FLAGS(); SETUP_FLAGS();
i::FLAG_trace_maps = true; i::FLAG_trace_maps = true;
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
...@@ -901,7 +901,7 @@ void ValidateMapDetailsLogging(v8::Isolate* isolate, ...@@ -901,7 +901,7 @@ void ValidateMapDetailsLogging(v8::Isolate* isolate,
} // namespace } // namespace
TEST(LogMapsDetailsStartup) { UNINITIALIZED_TEST(LogMapsDetailsStartup) {
// Reusing map addresses might cause these tests to fail. // Reusing map addresses might cause these tests to fail.
if (i::FLAG_gc_global || i::FLAG_stress_compaction || if (i::FLAG_gc_global || i::FLAG_stress_compaction ||
i::FLAG_stress_incremental_marking) { i::FLAG_stress_incremental_marking) {
...@@ -923,7 +923,7 @@ TEST(LogMapsDetailsStartup) { ...@@ -923,7 +923,7 @@ TEST(LogMapsDetailsStartup) {
isolate->Dispose(); isolate->Dispose();
} }
TEST(LogMapsDetailsCode) { UNINITIALIZED_TEST(LogMapsDetailsCode) {
// Reusing map addresses might cause these tests to fail. // Reusing map addresses might cause these tests to fail.
if (i::FLAG_gc_global || i::FLAG_stress_compaction || if (i::FLAG_gc_global || i::FLAG_stress_compaction ||
i::FLAG_stress_incremental_marking) { i::FLAG_stress_incremental_marking) {
...@@ -1020,7 +1020,7 @@ TEST(LogMapsDetailsCode) { ...@@ -1020,7 +1020,7 @@ TEST(LogMapsDetailsCode) {
isolate->Dispose(); isolate->Dispose();
} }
TEST(LogMapsDetailsContexts) { UNINITIALIZED_TEST(LogMapsDetailsContexts) {
// Reusing map addresses might cause these tests to fail. // Reusing map addresses might cause these tests to fail.
if (i::FLAG_gc_global || i::FLAG_stress_compaction || if (i::FLAG_gc_global || i::FLAG_stress_compaction ||
i::FLAG_stress_incremental_marking) { i::FLAG_stress_incremental_marking) {
...@@ -1056,7 +1056,7 @@ TEST(LogMapsDetailsContexts) { ...@@ -1056,7 +1056,7 @@ TEST(LogMapsDetailsContexts) {
isolate->Dispose(); isolate->Dispose();
} }
TEST(ConsoleTimeEvents) { UNINITIALIZED_TEST(ConsoleTimeEvents) {
SETUP_FLAGS(); SETUP_FLAGS();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
...@@ -1087,7 +1087,7 @@ TEST(ConsoleTimeEvents) { ...@@ -1087,7 +1087,7 @@ TEST(ConsoleTimeEvents) {
isolate->Dispose(); isolate->Dispose();
} }
TEST(LogFunctionEvents) { UNINITIALIZED_TEST(LogFunctionEvents) {
// Always opt and stress opt will break the fine-grained log order. // Always opt and stress opt will break the fine-grained log order.
if (i::FLAG_always_opt) return; if (i::FLAG_always_opt) return;
...@@ -1176,7 +1176,7 @@ TEST(LogFunctionEvents) { ...@@ -1176,7 +1176,7 @@ TEST(LogFunctionEvents) {
isolate->Dispose(); isolate->Dispose();
} }
TEST(BuiltinsNotLoggedAsLazyCompile) { UNINITIALIZED_TEST(BuiltinsNotLoggedAsLazyCompile) {
SETUP_FLAGS(); SETUP_FLAGS();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment