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 24 matching lines...) Expand all Loading... |
35 #include <sys/resource.h> | 35 #include <sys/resource.h> |
36 #include <sys/syscall.h> | 36 #include <sys/syscall.h> |
37 #include <sys/types.h> | 37 #include <sys/types.h> |
38 #include <stdlib.h> | 38 #include <stdlib.h> |
39 | 39 |
40 #include <sys/types.h> // mmap & munmap | 40 #include <sys/types.h> // mmap & munmap |
41 #include <sys/mman.h> // mmap & munmap | 41 #include <sys/mman.h> // mmap & munmap |
42 #include <sys/stat.h> // open | 42 #include <sys/stat.h> // open |
43 #include <fcntl.h> // open | 43 #include <fcntl.h> // open |
44 #include <unistd.h> // sysconf | 44 #include <unistd.h> // sysconf |
45 #include <execinfo.h> // backtrace, backtrace_symbols | |
46 #include <strings.h> // index | 45 #include <strings.h> // index |
47 #include <errno.h> | 46 #include <errno.h> |
48 #include <stdarg.h> | 47 #include <stdarg.h> |
49 | 48 |
50 #undef MAP_TYPE | 49 #undef MAP_TYPE |
51 | 50 |
52 #include "v8.h" | 51 #include "v8.h" |
53 | 52 |
54 #include "platform-posix.h" | |
55 #include "platform.h" | 53 #include "platform.h" |
56 #include "v8threads.h" | 54 #include "v8threads.h" |
57 #include "vm-state-inl.h" | 55 #include "vm-state-inl.h" |
58 | 56 |
59 | 57 |
60 namespace v8 { | 58 namespace v8 { |
61 namespace internal { | 59 namespace internal { |
62 | 60 |
63 | 61 |
64 const char* OS::LocalTimezone(double time) { | 62 const char* OS::LocalTimezone(double time) { |
(...skipping 24 matching lines...) Expand all Loading... |
89 if (mbase == MAP_FAILED) { | 87 if (mbase == MAP_FAILED) { |
90 LOG(i::Isolate::Current(), | 88 LOG(i::Isolate::Current(), |
91 StringEvent("OS::Allocate", "mmap failed")); | 89 StringEvent("OS::Allocate", "mmap failed")); |
92 return NULL; | 90 return NULL; |
93 } | 91 } |
94 *allocated = msize; | 92 *allocated = msize; |
95 return mbase; | 93 return mbase; |
96 } | 94 } |
97 | 95 |
98 | 96 |
99 void OS::DumpBacktrace() { | |
100 // Currently unsupported. | |
101 } | |
102 | |
103 | |
104 class PosixMemoryMappedFile : public OS::MemoryMappedFile { | 97 class PosixMemoryMappedFile : public OS::MemoryMappedFile { |
105 public: | 98 public: |
106 PosixMemoryMappedFile(FILE* file, void* memory, int size) | 99 PosixMemoryMappedFile(FILE* file, void* memory, int size) |
107 : file_(file), memory_(memory), size_(size) { } | 100 : file_(file), memory_(memory), size_(size) { } |
108 virtual ~PosixMemoryMappedFile(); | 101 virtual ~PosixMemoryMappedFile(); |
109 virtual void* memory() { return memory_; } | 102 virtual void* memory() { return memory_; } |
110 virtual int size() { return size_; } | 103 virtual int size() { return size_; } |
111 private: | 104 private: |
112 FILE* file_; | 105 FILE* file_; |
113 void* memory_; | 106 void* memory_; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 return munmap(base, size) == 0; | 355 return munmap(base, size) == 0; |
363 } | 356 } |
364 | 357 |
365 | 358 |
366 bool VirtualMemory::HasLazyCommits() { | 359 bool VirtualMemory::HasLazyCommits() { |
367 // TODO(alph): implement for the platform. | 360 // TODO(alph): implement for the platform. |
368 return false; | 361 return false; |
369 } | 362 } |
370 | 363 |
371 } } // namespace v8::internal | 364 } } // namespace v8::internal |
OLD | NEW |