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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 209 |
| 210 // Mark code segments non-writable. |
| 211 static void ProtectCode(void* address, const size_t size); |
| 212 |
210 // Assign memory as a guard page so that access will cause an exception. | 213 // Assign memory as a guard page so that access will cause an exception. |
211 static void Guard(void* address, const size_t size); | 214 static void Guard(void* address, const size_t size); |
212 | 215 |
213 // Get the Alignment guaranteed by Allocate(). | 216 // Get the Alignment guaranteed by Allocate(). |
214 static size_t AllocateAlignment(); | 217 static size_t AllocateAlignment(); |
215 | 218 |
216 // Returns an indication of whether a pointer is in a space that | 219 // Returns an indication of whether a pointer is in a space that |
217 // has been allocated by Allocate(). This method may conservatively | 220 // has been allocated by Allocate(). This method may conservatively |
218 // always return false, but giving more accurate information may | 221 // always return false, but giving more accurate information may |
219 // improve the robustness of the stack dump code in the presence of | 222 // improve the robustness of the stack dump code in the presence of |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 Atomic32 active_; | 661 Atomic32 active_; |
659 PlatformData* data_; // Platform specific data. | 662 PlatformData* data_; // Platform specific data. |
660 int samples_taken_; // Counts stack samples taken. | 663 int samples_taken_; // Counts stack samples taken. |
661 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 664 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
662 }; | 665 }; |
663 | 666 |
664 | 667 |
665 } } // namespace v8::internal | 668 } } // namespace v8::internal |
666 | 669 |
667 #endif // V8_PLATFORM_H_ | 670 #endif // V8_PLATFORM_H_ |
OLD | NEW |