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

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

Issue 7945009: Merge experimental/gc branch to the bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-mark-compact.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 // 2 //
3 // Tests of logging functions from log.h 3 // Tests of logging functions from log.h
4 4
5 #ifdef __linux__ 5 #ifdef __linux__
6 #include <math.h> 6 #include <math.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <signal.h> 8 #include <signal.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #endif // __linux__ 10 #endif // __linux__
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 // Start with profiling to capture all code events from the beginning. 487 // Start with profiling to capture all code events from the beginning.
488 ScopedLoggerInitializer initialize_logger(false); 488 ScopedLoggerInitializer initialize_logger(false);
489 489
490 // Compile and run a function that creates other functions. 490 // Compile and run a function that creates other functions.
491 CompileRun( 491 CompileRun(
492 "(function f(obj) {\n" 492 "(function f(obj) {\n"
493 " obj.test =\n" 493 " obj.test =\n"
494 " (function a(j) { return function b() { return j; } })(100);\n" 494 " (function a(j) { return function b() { return j; } })(100);\n"
495 "})(this);"); 495 "})(this);");
496 v8::V8::PauseProfiler(); 496 v8::V8::PauseProfiler();
497 HEAP->CollectAllGarbage(true); 497 HEAP->CollectAllGarbage(i::Heap::kMakeHeapIterableMask);
498 LOGGER->StringEvent("test-logging-done", ""); 498 LOGGER->StringEvent("test-logging-done", "");
499 499
500 // Iterate heap to find compiled functions, will write to log. 500 // Iterate heap to find compiled functions, will write to log.
501 LOGGER->LogCompiledFunctions(); 501 LOGGER->LogCompiledFunctions();
502 LOGGER->StringEvent("test-traversal-done", ""); 502 LOGGER->StringEvent("test-traversal-done", "");
503 503
504 bool exists = false; 504 bool exists = false;
505 i::Vector<const char> log( 505 i::Vector<const char> log(
506 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); 506 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
507 CHECK(exists); 507 CHECK(exists);
(...skipping 21 matching lines...) Expand all
529 v8::Local<v8::String> s = result->ToString(); 529 v8::Local<v8::String> s = result->ToString();
530 i::ScopedVector<char> data(s->Length() + 1); 530 i::ScopedVector<char> data(s->Length() + 1);
531 CHECK_NE(NULL, data.start()); 531 CHECK_NE(NULL, data.start());
532 s->WriteAscii(data.start()); 532 s->WriteAscii(data.start());
533 printf("%s\n", data.start()); 533 printf("%s\n", data.start());
534 // Make sure that our output is written prior crash due to CHECK failure. 534 // Make sure that our output is written prior crash due to CHECK failure.
535 fflush(stdout); 535 fflush(stdout);
536 CHECK(false); 536 CHECK(false);
537 } 537 }
538 } 538 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698