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

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

Issue 24169005: remove HEAP from tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 // 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 ScopedLoggerInitializer initialize_logger; 432 ScopedLoggerInitializer initialize_logger;
433 Logger* logger = initialize_logger.logger(); 433 Logger* logger = initialize_logger.logger();
434 434
435 // Compile and run a function that creates other functions. 435 // Compile and run a function that creates other functions.
436 CompileRun( 436 CompileRun(
437 "(function f(obj) {\n" 437 "(function f(obj) {\n"
438 " obj.test =\n" 438 " obj.test =\n"
439 " (function a(j) { return function b() { return j; } })(100);\n" 439 " (function a(j) { return function b() { return j; } })(100);\n"
440 "})(this);"); 440 "})(this);");
441 logger->StopProfiler(); 441 logger->StopProfiler();
442 HEAP->CollectAllGarbage(i::Heap::kMakeHeapIterableMask); 442 CcTest::heap()->CollectAllGarbage(i::Heap::kMakeHeapIterableMask);
443 logger->StringEvent("test-logging-done", ""); 443 logger->StringEvent("test-logging-done", "");
444 444
445 // Iterate heap to find compiled functions, will write to log. 445 // Iterate heap to find compiled functions, will write to log.
446 logger->LogCompiledFunctions(); 446 logger->LogCompiledFunctions();
447 logger->StringEvent("test-traversal-done", ""); 447 logger->StringEvent("test-traversal-done", "");
448 448
449 bool exists = false; 449 bool exists = false;
450 i::Vector<const char> log( 450 i::Vector<const char> log(
451 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); 451 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
452 CHECK(exists); 452 CHECK(exists);
(...skipping 21 matching lines...) Expand all
474 v8::Local<v8::String> s = result->ToString(); 474 v8::Local<v8::String> s = result->ToString();
475 i::ScopedVector<char> data(s->Utf8Length() + 1); 475 i::ScopedVector<char> data(s->Utf8Length() + 1);
476 CHECK_NE(NULL, data.start()); 476 CHECK_NE(NULL, data.start());
477 s->WriteUtf8(data.start()); 477 s->WriteUtf8(data.start());
478 printf("%s\n", data.start()); 478 printf("%s\n", data.start());
479 // Make sure that our output is written prior crash due to CHECK failure. 479 // Make sure that our output is written prior crash due to CHECK failure.
480 fflush(stdout); 480 fflush(stdout);
481 CHECK(false); 481 CHECK(false);
482 } 482 }
483 } 483 }
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