| 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 23 matching lines...) Expand all Loading... |
| 34 #include <stdarg.h> | 34 #include <stdarg.h> |
| 35 #include <strings.h> // index | 35 #include <strings.h> // index |
| 36 #include <sys/time.h> | 36 #include <sys/time.h> |
| 37 #include <sys/mman.h> // mmap & munmap | 37 #include <sys/mman.h> // mmap & munmap |
| 38 #include <unistd.h> // sysconf | 38 #include <unistd.h> // sysconf |
| 39 | 39 |
| 40 #undef MAP_TYPE | 40 #undef MAP_TYPE |
| 41 | 41 |
| 42 #include "v8.h" | 42 #include "v8.h" |
| 43 | 43 |
| 44 #include "platform-posix.h" | |
| 45 #include "platform.h" | 44 #include "platform.h" |
| 46 #include "simulator.h" | 45 #include "simulator.h" |
| 47 #include "v8threads.h" | 46 #include "v8threads.h" |
| 48 #include "vm-state-inl.h" | 47 #include "vm-state-inl.h" |
| 49 #include "win32-headers.h" | 48 #include "win32-headers.h" |
| 50 | 49 |
| 51 namespace v8 { | 50 namespace v8 { |
| 52 namespace internal { | 51 namespace internal { |
| 53 | 52 |
| 54 | 53 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 81 void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); | 80 void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); |
| 82 if (mbase == MAP_FAILED) { | 81 if (mbase == MAP_FAILED) { |
| 83 LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed")); | 82 LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed")); |
| 84 return NULL; | 83 return NULL; |
| 85 } | 84 } |
| 86 *allocated = msize; | 85 *allocated = msize; |
| 87 return mbase; | 86 return mbase; |
| 88 } | 87 } |
| 89 | 88 |
| 90 | 89 |
| 91 void OS::DumpBacktrace() { | |
| 92 // Currently unsupported. | |
| 93 } | |
| 94 | |
| 95 | |
| 96 class PosixMemoryMappedFile : public OS::MemoryMappedFile { | 90 class PosixMemoryMappedFile : public OS::MemoryMappedFile { |
| 97 public: | 91 public: |
| 98 PosixMemoryMappedFile(FILE* file, void* memory, int size) | 92 PosixMemoryMappedFile(FILE* file, void* memory, int size) |
| 99 : file_(file), memory_(memory), size_(size) { } | 93 : file_(file), memory_(memory), size_(size) { } |
| 100 virtual ~PosixMemoryMappedFile(); | 94 virtual ~PosixMemoryMappedFile(); |
| 101 virtual void* memory() { return memory_; } | 95 virtual void* memory() { return memory_; } |
| 102 virtual int size() { return size_; } | 96 virtual int size() { return size_; } |
| 103 private: | 97 private: |
| 104 FILE* file_; | 98 FILE* file_; |
| 105 void* memory_; | 99 void* memory_; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 return VirtualFree(base, 0, MEM_RELEASE) != 0; | 348 return VirtualFree(base, 0, MEM_RELEASE) != 0; |
| 355 } | 349 } |
| 356 | 350 |
| 357 | 351 |
| 358 bool VirtualMemory::HasLazyCommits() { | 352 bool VirtualMemory::HasLazyCommits() { |
| 359 // TODO(alph): implement for the platform. | 353 // TODO(alph): implement for the platform. |
| 360 return false; | 354 return false; |
| 361 } | 355 } |
| 362 | 356 |
| 363 } } // namespace v8::internal | 357 } } // namespace v8::internal |
| OLD | NEW |