| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 | 878 |
| 879 return base; | 879 return base; |
| 880 } | 880 } |
| 881 | 881 |
| 882 | 882 |
| 883 void* OS::Allocate(const size_t requested, | 883 void* OS::Allocate(const size_t requested, |
| 884 size_t* allocated, | 884 size_t* allocated, |
| 885 bool is_executable) { | 885 bool is_executable) { |
| 886 // VirtualAlloc rounds allocated size to page size automatically. | 886 // VirtualAlloc rounds allocated size to page size automatically. |
| 887 size_t msize = RoundUp(requested, static_cast<int>(GetPageSize())); | 887 size_t msize = RoundUp(requested, static_cast<int>(GetPageSize())); |
| 888 void* address = 0; | |
| 889 | 888 |
| 890 // Windows XP SP2 allows Data Excution Prevention (DEP). | 889 // Windows XP SP2 allows Data Excution Prevention (DEP). |
| 891 int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; | 890 int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; |
| 892 | 891 |
| 893 LPVOID mbase = RandomizedVirtualAlloc(msize, | 892 LPVOID mbase = RandomizedVirtualAlloc(msize, |
| 894 MEM_COMMIT | MEM_RESERVE, | 893 MEM_COMMIT | MEM_RESERVE, |
| 895 prot); | 894 prot); |
| 896 | 895 |
| 897 if (mbase == NULL) { | 896 if (mbase == NULL) { |
| 898 LOG(ISOLATE, StringEvent("OS::Allocate", "VirtualAlloc failed")); | 897 LOG(ISOLATE, StringEvent("OS::Allocate", "VirtualAlloc failed")); |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2069 | 2068 |
| 2070 | 2069 |
| 2071 void Sampler::Stop() { | 2070 void Sampler::Stop() { |
| 2072 ASSERT(IsActive()); | 2071 ASSERT(IsActive()); |
| 2073 SamplerThread::RemoveActiveSampler(this); | 2072 SamplerThread::RemoveActiveSampler(this); |
| 2074 SetActive(false); | 2073 SetActive(false); |
| 2075 } | 2074 } |
| 2076 | 2075 |
| 2077 | 2076 |
| 2078 } } // namespace v8::internal | 2077 } } // namespace v8::internal |
| OLD | NEW |