| 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 mprotect(address, size, PROT_READ); | 199 mprotect(address, size, PROT_READ); |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 void OS::Unprotect(void* address, size_t size, bool is_executable) { | 203 void OS::Unprotect(void* address, size_t size, bool is_executable) { |
| 204 // TODO(1240712): mprotect has a return value which is ignored here. | 204 // TODO(1240712): mprotect has a return value which is ignored here. |
| 205 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); | 205 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); |
| 206 mprotect(address, size, prot); | 206 mprotect(address, size, prot); |
| 207 } | 207 } |
| 208 | 208 |
| 209 #endif | 209 void OS::Guard(void* address, const size_t size) { |
| 210 mprotect(address, size, PROT_NONE); |
| 211 } |
| 212 |
| 213 #endif // ENABLE_HEAP_PROTECTION |
| 210 | 214 |
| 211 | 215 |
| 212 void OS::Sleep(int milliseconds) { | 216 void OS::Sleep(int milliseconds) { |
| 213 useconds_t ms = static_cast<useconds_t>(milliseconds); | 217 useconds_t ms = static_cast<useconds_t>(milliseconds); |
| 214 usleep(1000 * ms); | 218 usleep(1000 * ms); |
| 215 } | 219 } |
| 216 | 220 |
| 217 | 221 |
| 218 void OS::Abort() { | 222 void OS::Abort() { |
| 219 // Redirect to std abort to signal abnormal program termination. | 223 // Redirect to std abort to signal abnormal program termination. |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 | 817 |
| 814 void Sampler::Stop() { | 818 void Sampler::Stop() { |
| 815 ASSERT(IsActive()); | 819 ASSERT(IsActive()); |
| 816 SignalSender::RemoveActiveSampler(this); | 820 SignalSender::RemoveActiveSampler(this); |
| 817 SetActive(false); | 821 SetActive(false); |
| 818 } | 822 } |
| 819 | 823 |
| 820 #endif // ENABLE_LOGGING_AND_PROFILING | 824 #endif // ENABLE_LOGGING_AND_PROFILING |
| 821 | 825 |
| 822 } } // namespace v8::internal | 826 } } // namespace v8::internal |
| OLD | NEW |