| 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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 HANDLE file_mapping_; | 940 HANDLE file_mapping_; |
| 941 void* memory_; | 941 void* memory_; |
| 942 int size_; | 942 int size_; |
| 943 }; | 943 }; |
| 944 | 944 |
| 945 | 945 |
| 946 OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) { | 946 OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) { |
| 947 // Open a physical file | 947 // Open a physical file |
| 948 HANDLE file = CreateFileA(name, GENERIC_READ | GENERIC_WRITE, | 948 HANDLE file = CreateFileA(name, GENERIC_READ | GENERIC_WRITE, |
| 949 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); | 949 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); |
| 950 if (file == NULL) return NULL; | 950 if (file == INVALID_HANDLE_VALUE) return NULL; |
| 951 | 951 |
| 952 int size = static_cast<int>(GetFileSize(file, NULL)); | 952 int size = static_cast<int>(GetFileSize(file, NULL)); |
| 953 | 953 |
| 954 // Create a file mapping for the physical file | 954 // Create a file mapping for the physical file |
| 955 HANDLE file_mapping = CreateFileMapping(file, NULL, | 955 HANDLE file_mapping = CreateFileMapping(file, NULL, |
| 956 PAGE_READWRITE, 0, static_cast<DWORD>(size), NULL); | 956 PAGE_READWRITE, 0, static_cast<DWORD>(size), NULL); |
| 957 if (file_mapping == NULL) return NULL; | 957 if (file_mapping == NULL) return NULL; |
| 958 | 958 |
| 959 // Map a view of the file into memory | 959 // Map a view of the file into memory |
| 960 void* memory = MapViewOfFile(file_mapping, FILE_MAP_ALL_ACCESS, 0, 0, size); | 960 void* memory = MapViewOfFile(file_mapping, FILE_MAP_ALL_ACCESS, 0, 0, size); |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2018 | 2018 |
| 2019 void Sampler::Stop() { | 2019 void Sampler::Stop() { |
| 2020 ASSERT(IsActive()); | 2020 ASSERT(IsActive()); |
| 2021 SamplerThread::RemoveActiveSampler(this); | 2021 SamplerThread::RemoveActiveSampler(this); |
| 2022 SetActive(false); | 2022 SetActive(false); |
| 2023 } | 2023 } |
| 2024 | 2024 |
| 2025 #endif // ENABLE_LOGGING_AND_PROFILING | 2025 #endif // ENABLE_LOGGING_AND_PROFILING |
| 2026 | 2026 |
| 2027 } } // namespace v8::internal | 2027 } } // namespace v8::internal |
| OLD | NEW |