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 <math.h> | 8 #include <math.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <signal.h> | 10 #include <signal.h> |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 v8::Handle<v8::Context> env = v8::Context::New( | 1136 v8::Handle<v8::Context> env = v8::Context::New( |
1137 0, v8::Handle<v8::ObjectTemplate>(), global_object); | 1137 0, v8::Handle<v8::ObjectTemplate>(), global_object); |
1138 env->Enter(); | 1138 env->Enter(); |
1139 | 1139 |
1140 // Compile and run a function that creates other functions. | 1140 // Compile and run a function that creates other functions. |
1141 CompileAndRunScript( | 1141 CompileAndRunScript( |
1142 "(function f(obj) {\n" | 1142 "(function f(obj) {\n" |
1143 " obj.test =\n" | 1143 " obj.test =\n" |
1144 " (function a(j) { return function b() { return j; } })(100);\n" | 1144 " (function a(j) { return function b() { return j; } })(100);\n" |
1145 "})(this);"); | 1145 "})(this);"); |
1146 i::Heap::CollectAllGarbage(false); | 1146 i::Heap::CollectAllGarbage(i::Heap::kSweepPreciselyMask); |
1147 | 1147 |
1148 EmbeddedVector<char, 204800> buffer; | 1148 EmbeddedVector<char, 204800> buffer; |
1149 int log_size; | 1149 int log_size; |
1150 ParseLogResult ref_result; | 1150 ParseLogResult ref_result; |
1151 | 1151 |
1152 // Retrieve the log. | 1152 // Retrieve the log. |
1153 { | 1153 { |
1154 // Make sure that no GCs occur prior to LogCompiledFunctions call. | 1154 // Make sure that no GCs occur prior to LogCompiledFunctions call. |
1155 i::AssertNoAllocation no_alloc; | 1155 i::AssertNoAllocation no_alloc; |
1156 | 1156 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 // Make sure that all log data is written prior crash due to CHECK failure. | 1197 // Make sure that all log data is written prior crash due to CHECK failure. |
1198 fflush(stdout); | 1198 fflush(stdout); |
1199 CHECK(results_equal); | 1199 CHECK(results_equal); |
1200 | 1200 |
1201 env->Exit(); | 1201 env->Exit(); |
1202 Logger::TearDown(); | 1202 Logger::TearDown(); |
1203 i::FLAG_always_compact = saved_always_compact; | 1203 i::FLAG_always_compact = saved_always_compact; |
1204 } | 1204 } |
1205 | 1205 |
1206 #endif // ENABLE_LOGGING_AND_PROFILING | 1206 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |