| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 virtual void* memory() { return memory_; } | 326 virtual void* memory() { return memory_; } |
| 327 virtual int size() { return size_; } | 327 virtual int size() { return size_; } |
| 328 private: | 328 private: |
| 329 FILE* file_; | 329 FILE* file_; |
| 330 void* memory_; | 330 void* memory_; |
| 331 int size_; | 331 int size_; |
| 332 }; | 332 }; |
| 333 | 333 |
| 334 | 334 |
| 335 OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) { | 335 OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) { |
| 336 FILE* file = fopen(name, "w+"); | 336 FILE* file = fopen(name, "r+"); |
| 337 if (file == NULL) return NULL; | 337 if (file == NULL) return NULL; |
| 338 | 338 |
| 339 fseek(file, 0, SEEK_END); | 339 fseek(file, 0, SEEK_END); |
| 340 int size = ftell(file); | 340 int size = ftell(file); |
| 341 | 341 |
| 342 void* memory = | 342 void* memory = |
| 343 mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0); | 343 mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0); |
| 344 return new PosixMemoryMappedFile(file, memory, size); | 344 return new PosixMemoryMappedFile(file, memory, size); |
| 345 } | 345 } |
| 346 | 346 |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 | 1025 |
| 1026 void Sampler::Stop() { | 1026 void Sampler::Stop() { |
| 1027 ASSERT(IsActive()); | 1027 ASSERT(IsActive()); |
| 1028 SignalSender::RemoveActiveSampler(this); | 1028 SignalSender::RemoveActiveSampler(this); |
| 1029 SetActive(false); | 1029 SetActive(false); |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 #endif // ENABLE_LOGGING_AND_PROFILING | 1032 #endif // ENABLE_LOGGING_AND_PROFILING |
| 1033 | 1033 |
| 1034 } } // namespace v8::internal | 1034 } } // namespace v8::internal |
| OLD | NEW |