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

Unified Diff: test/cctest/test-log.cc

Issue 1403763002: Reland improve perf_basic_prof filename reporting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-log.cc
diff --git a/test/cctest/test-log.cc b/test/cctest/test-log.cc
index 9ca2f839631fe1c3a5b4fcb7f0df0693f5f306e9..925803cc150d8d05f909aa23aefe180a81444bc3 100644
--- a/test/cctest/test-log.cc
+++ b/test/cctest/test-log.cc
@@ -531,3 +531,58 @@ TEST(LogVersion) {
}
isolate->Dispose();
}
+
+
+// https://crbug.com/539892
+// CodeCreateEvents with really large names should not crash.
+TEST(Issue539892) {
+ class : public i::CodeEventLogger {
+ public:
+ virtual void CodeMoveEvent(Address from, Address to) {}
+ virtual void CodeDeleteEvent(Address from) {}
+ virtual void CodeDisableOptEvent(i::Code* code,
+ i::SharedFunctionInfo* shared) {}
+
+ private:
+ virtual void LogRecordedBuffer(i::Code* code, i::SharedFunctionInfo* shared,
+ const char* name, int length) {}
+ } code_event_logger;
+ SETUP_FLAGS();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
+
+ {
+ ScopedLoggerInitializer initialize_logger(saved_log, saved_prof, isolate);
+ Logger* logger = initialize_logger.logger();
+ logger->addCodeEventListener(&code_event_logger);
+
+ // Function with a really large name.
+ const char* source_text =
+ "(function "
+ "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac"
+ "(){})();";
+
+ CompileRun(source_text);
+
+ // Must not crash.
+ logger->LogCompiledFunctions();
+ }
+ isolate->Dispose();
+}
« no previous file with comments | « src/log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698