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 // | 2 // |
3 // Tests of logging functions from log.h | 3 // Tests of logging functions from log.h |
4 | 4 |
5 #ifdef ENABLE_LOGGING_AND_PROFILING | 5 #ifdef ENABLE_LOGGING_AND_PROFILING |
6 | 6 |
7 #ifdef __linux__ | 7 #ifdef __linux__ |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 #endif | 10 #endif |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 v8::Handle<v8::Context> env = v8::Context::New( | 678 v8::Handle<v8::Context> env = v8::Context::New( |
679 0, v8::Handle<v8::ObjectTemplate>(), global_object); | 679 0, v8::Handle<v8::ObjectTemplate>(), global_object); |
680 env->Enter(); | 680 env->Enter(); |
681 | 681 |
682 // Compile and run a function that creates other functions. | 682 // Compile and run a function that creates other functions. |
683 CompileAndRunScript( | 683 CompileAndRunScript( |
684 "(function f(obj) {\n" | 684 "(function f(obj) {\n" |
685 " obj.test =\n" | 685 " obj.test =\n" |
686 " (function a(j) { return function b() { return j; } })(100);\n" | 686 " (function a(j) { return function b() { return j; } })(100);\n" |
687 "})(this);"); | 687 "})(this);"); |
688 i::Heap::CollectAllGarbage(); | 688 i::Heap::CollectAllGarbage(false); |
689 | 689 |
690 EmbeddedVector<char, 204800> buffer; | 690 EmbeddedVector<char, 204800> buffer; |
691 int log_size; | 691 int log_size; |
692 ParseLogResult ref_result; | 692 ParseLogResult ref_result; |
693 | 693 |
694 // Retrieve the log. | 694 // Retrieve the log. |
695 { | 695 { |
696 // Make sure that no GCs occur prior to LogCompiledFunctions call. | 696 // Make sure that no GCs occur prior to LogCompiledFunctions call. |
697 i::AssertNoAllocation no_alloc; | 697 i::AssertNoAllocation no_alloc; |
698 | 698 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 // Make sure that all log data is written prior crash due to CHECK failure. | 739 // Make sure that all log data is written prior crash due to CHECK failure. |
740 fflush(stdout); | 740 fflush(stdout); |
741 CHECK(results_equal); | 741 CHECK(results_equal); |
742 | 742 |
743 env->Exit(); | 743 env->Exit(); |
744 Logger::TearDown(); | 744 Logger::TearDown(); |
745 i::FLAG_always_compact = saved_always_compact; | 745 i::FLAG_always_compact = saved_always_compact; |
746 } | 746 } |
747 | 747 |
748 #endif // ENABLE_LOGGING_AND_PROFILING | 748 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |