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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 v8::HandleScope scope; | 397 v8::HandleScope scope; |
398 v8::Persistent<v8::Context> context = v8::Context::New(); | 398 v8::Persistent<v8::Context> context = v8::Context::New(); |
399 CHECK(!context.IsEmpty()); | 399 CHECK(!context.IsEmpty()); |
400 { | 400 { |
401 v8::Context::Scope context_scope(context); | 401 v8::Context::Scope context_scope(context); |
402 SignalRunning(); | 402 SignalRunning(); |
403 CompileAndRunScript( | 403 CompileAndRunScript( |
404 "var j; for (var i=0; i<10000; ++i) { j = Math.sin(i); }"); | 404 "var j; for (var i=0; i<10000; ++i) { j = Math.sin(i); }"); |
405 } | 405 } |
406 context.Dispose(); | 406 context.Dispose(); |
407 { | 407 i::OS::Sleep(1); |
408 v8::Unlocker unlocker; | |
409 i::OS::Sleep(1); | |
410 } | |
411 } | 408 } |
412 } | 409 } |
413 }; | 410 }; |
414 | 411 |
415 | 412 |
416 class LoopingNonJsThread : public LoopingThread { | 413 class LoopingNonJsThread : public LoopingThread { |
417 public: | 414 public: |
418 void RunLoop() { | 415 void RunLoop() { |
419 v8::Locker locker; | 416 v8::Locker locker; |
420 v8::Unlocker unlocker; | 417 v8::Unlocker unlocker; |
(...skipping 776 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. | 1194 // Make sure that all log data is written prior crash due to CHECK failure. |
1198 fflush(stdout); | 1195 fflush(stdout); |
1199 CHECK(results_equal); | 1196 CHECK(results_equal); |
1200 | 1197 |
1201 env->Exit(); | 1198 env->Exit(); |
1202 Logger::TearDown(); | 1199 Logger::TearDown(); |
1203 i::FLAG_always_compact = saved_always_compact; | 1200 i::FLAG_always_compact = saved_always_compact; |
1204 } | 1201 } |
1205 | 1202 |
1206 #endif // ENABLE_LOGGING_AND_PROFILING | 1203 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |