OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 FILE* OS::FOpen(const char* path, const char* mode) { | 676 FILE* OS::FOpen(const char* path, const char* mode) { |
677 FILE* result; | 677 FILE* result; |
678 if (fopen_s(&result, path, mode) == 0) { | 678 if (fopen_s(&result, path, mode) == 0) { |
679 return result; | 679 return result; |
680 } else { | 680 } else { |
681 return NULL; | 681 return NULL; |
682 } | 682 } |
683 } | 683 } |
684 | 684 |
685 | 685 |
| 686 // Open log file in binary mode to avoid /n -> /r/n conversion. |
| 687 const char* OS::LogFileOpenMode = "wb"; |
| 688 |
| 689 |
686 // Print (debug) message to console. | 690 // Print (debug) message to console. |
687 void OS::Print(const char* format, ...) { | 691 void OS::Print(const char* format, ...) { |
688 va_list args; | 692 va_list args; |
689 va_start(args, format); | 693 va_start(args, format); |
690 VPrint(format, args); | 694 VPrint(format, args); |
691 va_end(args); | 695 va_end(args); |
692 } | 696 } |
693 | 697 |
694 | 698 |
695 void OS::VPrint(const char* format, va_list args) { | 699 void OS::VPrint(const char* format, va_list args) { |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 | 1855 |
1852 // Release the thread handles | 1856 // Release the thread handles |
1853 CloseHandle(data_->sampler_thread_); | 1857 CloseHandle(data_->sampler_thread_); |
1854 CloseHandle(data_->profiled_thread_); | 1858 CloseHandle(data_->profiled_thread_); |
1855 } | 1859 } |
1856 | 1860 |
1857 | 1861 |
1858 #endif // ENABLE_LOGGING_AND_PROFILING | 1862 #endif // ENABLE_LOGGING_AND_PROFILING |
1859 | 1863 |
1860 } } // namespace v8::internal | 1864 } } // namespace v8::internal |
OLD | NEW |