| OLD | NEW |
| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 ScopedLoggerInitializer initialize_logger(saved_log, saved_prof, isolate); | 478 ScopedLoggerInitializer initialize_logger(saved_log, saved_prof, isolate); |
| 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( | |
| 489 i::Heap::kMakeHeapIterableMask); | |
| 490 logger->StringEvent("test-logging-done", ""); | 488 logger->StringEvent("test-logging-done", ""); |
| 491 | 489 |
| 492 // Iterate heap to find compiled functions, will write to log. | 490 // Iterate heap to find compiled functions, will write to log. |
| 493 logger->LogCompiledFunctions(); | 491 logger->LogCompiledFunctions(); |
| 494 logger->StringEvent("test-traversal-done", ""); | 492 logger->StringEvent("test-traversal-done", ""); |
| 495 | 493 |
| 496 bool exists = false; | 494 bool exists = false; |
| 497 i::Vector<const char> log( | 495 i::Vector<const char> log( |
| 498 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); | 496 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); |
| 499 CHECK(exists); | 497 CHECK(exists); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" | 606 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" |
| 609 "(){})();"; | 607 "(){})();"; |
| 610 | 608 |
| 611 CompileRun(source_text); | 609 CompileRun(source_text); |
| 612 | 610 |
| 613 // Must not crash. | 611 // Must not crash. |
| 614 logger->LogCompiledFunctions(); | 612 logger->LogCompiledFunctions(); |
| 615 } | 613 } |
| 616 isolate->Dispose(); | 614 isolate->Dispose(); |
| 617 } | 615 } |
| OLD | NEW |