Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: src/platform-posix.cc

Issue 20283002: Don't duplicate OS::ActivationFrameAlignment() for every POSIX platform. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // limit. 94 // limit.
95 95
96 intptr_t OS::MaxVirtualMemory() { 96 intptr_t OS::MaxVirtualMemory() {
97 struct rlimit limit; 97 struct rlimit limit;
98 int result = getrlimit(RLIMIT_DATA, &limit); 98 int result = getrlimit(RLIMIT_DATA, &limit);
99 if (result != 0) return 0; 99 if (result != 0) return 0;
100 return limit.rlim_cur; 100 return limit.rlim_cur;
101 } 101 }
102 102
103 103
104 int OS::ActivationFrameAlignment() {
105 #if V8_TARGET_ARCH_ARM
106 // On EABI ARM targets this is required for fp correctness in the
107 // runtime system.
108 return 8;
109 #elif V8_TARGET_ARCH_MIPS
110 return 8;
111 #else
112 // Otherwise we just assume 16 byte alignment, i.e.:
113 // - With gcc 4.4 the tree vectorization optimizer can generate code
114 // that requires 16 byte alignment such as movdqa on x86.
115 // - Mac OS X and Solaris (64-bit) activation frames must be 16 byte-aligned;
116 // see "Mac OS X ABI Function Call Guide"
117 return 16;
118 #endif
119 }
120
121
104 intptr_t OS::CommitPageSize() { 122 intptr_t OS::CommitPageSize() {
105 static intptr_t page_size = getpagesize(); 123 static intptr_t page_size = getpagesize();
106 return page_size; 124 return page_size;
107 } 125 }
108 126
109 127
110 void OS::Free(void* address, const size_t size) { 128 void OS::Free(void* address, const size_t size) {
111 // TODO(1240712): munmap has a return value which is ignored here. 129 // TODO(1240712): munmap has a return value which is ignored here.
112 int result = munmap(address, size); 130 int result = munmap(address, size);
113 USE(result); 131 USE(result);
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 return ntohl(value); 990 return ntohl(value);
973 } 991 }
974 992
975 993
976 Socket* OS::CreateSocket() { 994 Socket* OS::CreateSocket() {
977 return new POSIXSocket(); 995 return new POSIXSocket();
978 } 996 }
979 997
980 998
981 } } // namespace v8::internal 999 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698