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 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 v8::Handle<v8::Context> env = v8::Context::New( | 1121 v8::Handle<v8::Context> env = v8::Context::New( |
1122 0, v8::Handle<v8::ObjectTemplate>(), global_object); | 1122 0, v8::Handle<v8::ObjectTemplate>(), global_object); |
1123 env->Enter(); | 1123 env->Enter(); |
1124 | 1124 |
1125 // Compile and run a function that creates other functions. | 1125 // Compile and run a function that creates other functions. |
1126 CompileAndRunScript( | 1126 CompileAndRunScript( |
1127 "(function f(obj) {\n" | 1127 "(function f(obj) {\n" |
1128 " obj.test =\n" | 1128 " obj.test =\n" |
1129 " (function a(j) { return function b() { return j; } })(100);\n" | 1129 " (function a(j) { return function b() { return j; } })(100);\n" |
1130 "})(this);"); | 1130 "})(this);"); |
1131 i::Heap::CollectAllGarbage(false); | 1131 i::Heap::CollectAllGarbage(i::Heap::kMakeHeapIterableMask); |
1132 | 1132 |
1133 EmbeddedVector<char, 204800> buffer; | 1133 EmbeddedVector<char, 204800> buffer; |
1134 int log_size; | 1134 int log_size; |
1135 ParseLogResult ref_result; | 1135 ParseLogResult ref_result; |
1136 | 1136 |
1137 // Retrieve the log. | 1137 // Retrieve the log. |
1138 { | 1138 { |
1139 // Make sure that no GCs occur prior to LogCompiledFunctions call. | 1139 // Make sure that no GCs occur prior to LogCompiledFunctions call. |
1140 i::AssertNoAllocation no_alloc; | 1140 i::AssertNoAllocation no_alloc; |
1141 | 1141 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 // Make sure that all log data is written prior crash due to CHECK failure. | 1182 // Make sure that all log data is written prior crash due to CHECK failure. |
1183 fflush(stdout); | 1183 fflush(stdout); |
1184 CHECK(results_equal); | 1184 CHECK(results_equal); |
1185 | 1185 |
1186 env->Exit(); | 1186 env->Exit(); |
1187 Logger::TearDown(); | 1187 Logger::TearDown(); |
1188 i::FLAG_always_compact = saved_always_compact; | 1188 i::FLAG_always_compact = saved_always_compact; |
1189 } | 1189 } |
1190 | 1190 |
1191 #endif // ENABLE_LOGGING_AND_PROFILING | 1191 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |