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

Side by Side Diff: test/cctest/test-log.cc

Issue 2310143002: [heap] Introduce enum of garbage collection reasons. (Closed)
Patch Set: rebase Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-identity-map.cc ('k') | test/cctest/test-mementos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 Logger* logger = initialize_logger.logger(); 479 Logger* logger = initialize_logger.logger();
480 480
481 // Compile and run a function that creates other functions. 481 // Compile and run a function that creates other functions.
482 CompileRun( 482 CompileRun(
483 "(function f(obj) {\n" 483 "(function f(obj) {\n"
484 " obj.test =\n" 484 " obj.test =\n"
485 " (function a(j) { return function b() { return j; } })(100);\n" 485 " (function a(j) { return function b() { return j; } })(100);\n"
486 "})(this);"); 486 "})(this);");
487 logger->StopProfiler(); 487 logger->StopProfiler();
488 reinterpret_cast<i::Isolate*>(isolate)->heap()->CollectAllGarbage( 488 reinterpret_cast<i::Isolate*>(isolate)->heap()->CollectAllGarbage(
489 i::Heap::kMakeHeapIterableMask); 489 i::Heap::kMakeHeapIterableMask, i::GarbageCollectionReason::kTesting);
490 logger->StringEvent("test-logging-done", ""); 490 logger->StringEvent("test-logging-done", "");
491 491
492 // Iterate heap to find compiled functions, will write to log. 492 // Iterate heap to find compiled functions, will write to log.
493 logger->LogCompiledFunctions(); 493 logger->LogCompiledFunctions();
494 logger->StringEvent("test-traversal-done", ""); 494 logger->StringEvent("test-traversal-done", "");
495 495
496 bool exists = false; 496 bool exists = false;
497 i::Vector<const char> log( 497 i::Vector<const char> log(
498 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); 498 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
499 CHECK(exists); 499 CHECK(exists);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" 608 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac"
609 "(){})();"; 609 "(){})();";
610 610
611 CompileRun(source_text); 611 CompileRun(source_text);
612 612
613 // Must not crash. 613 // Must not crash.
614 logger->LogCompiledFunctions(); 614 logger->LogCompiledFunctions();
615 } 615 }
616 isolate->Dispose(); 616 isolate->Dispose();
617 } 617 }
OLDNEW
« no previous file with comments | « test/cctest/test-identity-map.cc ('k') | test/cctest/test-mementos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698