| 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 __linux__ | 5 #ifdef __linux__ |
| 6 #include <math.h> | 6 #include <math.h> |
| 7 #include <pthread.h> | 7 #include <pthread.h> |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 #endif // __linux__ | 10 #endif // __linux__ |
| 11 | 11 |
| 12 #include "v8.h" | 12 #include "v8.h" |
| 13 #include "log.h" | 13 #include "log.h" |
| 14 #include "cpu-profiler.h" | 14 #include "cpu-profiler.h" |
| 15 #include "natives.h" | 15 #include "natives.h" |
| 16 #include "v8threads.h" | 16 #include "v8threads.h" |
| 17 #include "v8utils.h" | 17 #include "v8utils.h" |
| 18 #include "cctest.h" | 18 #include "cctest.h" |
| 19 #include "vm-state-inl.h" | 19 #include "vm-state-inl.h" |
| 20 | 20 |
| 21 using v8::internal::Address; | 21 using v8::internal::Address; |
| 22 using v8::internal::EmbeddedVector; | 22 using v8::internal::EmbeddedVector; |
| 23 using v8::internal::Logger; | 23 using v8::internal::Logger; |
| 24 using v8::internal::StrLength; | 24 using v8::internal::StrLength; |
| 25 | 25 |
| 26 namespace i = v8::internal; | |
| 27 | |
| 28 namespace { | 26 namespace { |
| 29 | 27 |
| 30 class ScopedLoggerInitializer { | 28 class ScopedLoggerInitializer { |
| 31 public: | 29 public: |
| 32 explicit ScopedLoggerInitializer(bool prof_lazy) | 30 explicit ScopedLoggerInitializer(bool prof_lazy) |
| 33 : saved_log_(i::FLAG_log), | 31 : saved_log_(i::FLAG_log), |
| 34 saved_prof_lazy_(i::FLAG_prof_lazy), | 32 saved_prof_lazy_(i::FLAG_prof_lazy), |
| 35 saved_prof_(i::FLAG_prof), | 33 saved_prof_(i::FLAG_prof), |
| 36 saved_prof_auto_(i::FLAG_prof_auto), | 34 saved_prof_auto_(i::FLAG_prof_auto), |
| 37 temp_file_(NULL), | 35 temp_file_(NULL), |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 v8::Local<v8::String> s = result->ToString(); | 527 v8::Local<v8::String> s = result->ToString(); |
| 530 i::ScopedVector<char> data(s->Length() + 1); | 528 i::ScopedVector<char> data(s->Length() + 1); |
| 531 CHECK_NE(NULL, data.start()); | 529 CHECK_NE(NULL, data.start()); |
| 532 s->WriteAscii(data.start()); | 530 s->WriteAscii(data.start()); |
| 533 printf("%s\n", data.start()); | 531 printf("%s\n", data.start()); |
| 534 // Make sure that our output is written prior crash due to CHECK failure. | 532 // Make sure that our output is written prior crash due to CHECK failure. |
| 535 fflush(stdout); | 533 fflush(stdout); |
| 536 CHECK(false); | 534 CHECK(false); |
| 537 } | 535 } |
| 538 } | 536 } |
| OLD | NEW |