| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // __GNUC_PREREQ is not defined in GCC for Mac OS X, so we define our own macro | 107 // __GNUC_PREREQ is not defined in GCC for Mac OS X, so we define our own macro |
| 108 #if __GNUC_VERSION__ >= 29600 && __GNUC_VERSION__ < 40100 | 108 #if __GNUC_VERSION__ >= 29600 && __GNUC_VERSION__ < 40100 |
| 109 #include <limits> | 109 #include <limits> |
| 110 #undef V8_INFINITY | 110 #undef V8_INFINITY |
| 111 #define V8_INFINITY std::numeric_limits<double>::infinity() | 111 #define V8_INFINITY std::numeric_limits<double>::infinity() |
| 112 #endif | 112 #endif |
| 113 | 113 |
| 114 #endif // __GNUC__ | 114 #endif // __GNUC__ |
| 115 | 115 |
| 116 #include "atomicops.h" | 116 #include "atomicops.h" |
| 117 #include "utils.h" |
| 118 #include "v8globals.h" |
| 117 | 119 |
| 118 namespace v8 { | 120 namespace v8 { |
| 119 namespace internal { | 121 namespace internal { |
| 120 | 122 |
| 121 // Use AtomicWord for a machine-sized pointer. It is assumed that | 123 // Use AtomicWord for a machine-sized pointer. It is assumed that |
| 122 // reads and writes of naturally aligned values of this type are atomic. | 124 // reads and writes of naturally aligned values of this type are atomic. |
| 123 typedef intptr_t AtomicWord; | 125 typedef intptr_t AtomicWord; |
| 124 | 126 |
| 125 class Semaphore; | 127 class Semaphore; |
| 128 class Mutex; |
| 126 | 129 |
| 127 double ceiling(double x); | 130 double ceiling(double x); |
| 128 double modulo(double x, double y); | 131 double modulo(double x, double y); |
| 129 | 132 |
| 130 // Forward declarations. | 133 // Forward declarations. |
| 131 class Socket; | 134 class Socket; |
| 132 | 135 |
| 133 // ---------------------------------------------------------------------------- | 136 // ---------------------------------------------------------------------------- |
| 134 // OS | 137 // OS |
| 135 // | 138 // |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 177 |
| 175 // Log file open mode is platform-dependent due to line ends issues. | 178 // Log file open mode is platform-dependent due to line ends issues. |
| 176 static const char* const LogFileOpenMode; | 179 static const char* const LogFileOpenMode; |
| 177 | 180 |
| 178 // Print output to console. This is mostly used for debugging output. | 181 // Print output to console. This is mostly used for debugging output. |
| 179 // On platforms that has standard terminal output, the output | 182 // On platforms that has standard terminal output, the output |
| 180 // should go to stdout. | 183 // should go to stdout. |
| 181 static void Print(const char* format, ...); | 184 static void Print(const char* format, ...); |
| 182 static void VPrint(const char* format, va_list args); | 185 static void VPrint(const char* format, va_list args); |
| 183 | 186 |
| 187 // Print output to a file. This is mostly used for debugging output. |
| 188 static void FPrint(FILE* out, const char* format, ...); |
| 189 static void VFPrint(FILE* out, const char* format, va_list args); |
| 190 |
| 184 // Print error output to console. This is mostly used for error message | 191 // Print error output to console. This is mostly used for error message |
| 185 // output. On platforms that has standard terminal output, the output | 192 // output. On platforms that has standard terminal output, the output |
| 186 // should go to stderr. | 193 // should go to stderr. |
| 187 static void PrintError(const char* format, ...); | 194 static void PrintError(const char* format, ...); |
| 188 static void VPrintError(const char* format, va_list args); | 195 static void VPrintError(const char* format, va_list args); |
| 189 | 196 |
| 190 // Allocate/Free memory used by JS heap. Pages are readable/writable, but | 197 // Allocate/Free memory used by JS heap. Pages are readable/writable, but |
| 191 // they are not guaranteed to be executable unless 'executable' is true. | 198 // they are not guaranteed to be executable unless 'executable' is true. |
| 192 // Returns the address of allocated memory, or NULL if failed. | 199 // Returns the address of allocated memory, or NULL if failed. |
| 193 static void* Allocate(const size_t requested, | 200 static void* Allocate(const size_t requested, |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 int samples_taken_; // Counts stack samples taken. | 623 int samples_taken_; // Counts stack samples taken. |
| 617 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 624 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 618 }; | 625 }; |
| 619 | 626 |
| 620 | 627 |
| 621 #endif // ENABLE_LOGGING_AND_PROFILING | 628 #endif // ENABLE_LOGGING_AND_PROFILING |
| 622 | 629 |
| 623 } } // namespace v8::internal | 630 } } // namespace v8::internal |
| 624 | 631 |
| 625 #endif // V8_PLATFORM_H_ | 632 #endif // V8_PLATFORM_H_ |
| OLD | NEW |