OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 static void PrintError(const char* format, ...); | 199 static void PrintError(const char* format, ...); |
200 static void VPrintError(const char* format, va_list args); | 200 static void VPrintError(const char* format, va_list args); |
201 | 201 |
202 // Allocate/Free memory used by JS heap. Pages are readable/writable, but | 202 // Allocate/Free memory used by JS heap. Pages are readable/writable, but |
203 // they are not guaranteed to be executable unless 'executable' is true. | 203 // they are not guaranteed to be executable unless 'executable' is true. |
204 // Returns the address of allocated memory, or NULL if failed. | 204 // Returns the address of allocated memory, or NULL if failed. |
205 static void* Allocate(const size_t requested, | 205 static void* Allocate(const size_t requested, |
206 size_t* allocated, | 206 size_t* allocated, |
207 bool is_executable); | 207 bool is_executable); |
208 static void Free(void* address, const size_t size); | 208 static void Free(void* address, const size_t size); |
| 209 |
| 210 // Assign memory as a guard page so that access will cause an exception. |
| 211 static void Guard(void* address, const size_t size); |
| 212 |
209 // Get the Alignment guaranteed by Allocate(). | 213 // Get the Alignment guaranteed by Allocate(). |
210 static size_t AllocateAlignment(); | 214 static size_t AllocateAlignment(); |
211 | 215 |
212 // Returns an indication of whether a pointer is in a space that | 216 // Returns an indication of whether a pointer is in a space that |
213 // has been allocated by Allocate(). This method may conservatively | 217 // has been allocated by Allocate(). This method may conservatively |
214 // always return false, but giving more accurate information may | 218 // always return false, but giving more accurate information may |
215 // improve the robustness of the stack dump code in the presence of | 219 // improve the robustness of the stack dump code in the presence of |
216 // heap corruption. | 220 // heap corruption. |
217 static bool IsOutsideAllocatedSpace(void* pointer); | 221 static bool IsOutsideAllocatedSpace(void* pointer); |
218 | 222 |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 Atomic32 active_; | 658 Atomic32 active_; |
655 PlatformData* data_; // Platform specific data. | 659 PlatformData* data_; // Platform specific data. |
656 int samples_taken_; // Counts stack samples taken. | 660 int samples_taken_; // Counts stack samples taken. |
657 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 661 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
658 }; | 662 }; |
659 | 663 |
660 | 664 |
661 } } // namespace v8::internal | 665 } } // namespace v8::internal |
662 | 666 |
663 #endif // V8_PLATFORM_H_ | 667 #endif // V8_PLATFORM_H_ |
OLD | NEW |