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

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

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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-freebsd.cc ('k') | src/platform-macos.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 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 161
162 // We keep the lowest and highest addresses mapped as a quick way of 162 // We keep the lowest and highest addresses mapped as a quick way of
163 // determining that pointers are outside the heap (used mostly in assertions 163 // determining that pointers are outside the heap (used mostly in assertions
164 // and verification). The estimate is conservative, ie, not all addresses in 164 // and verification). The estimate is conservative, ie, not all addresses in
165 // 'allocated' space are actually allocated to our heap. The range is 165 // 'allocated' space are actually allocated to our heap. The range is
166 // [lowest, highest), inclusive on the low and and exclusive on the high end. 166 // [lowest, highest), inclusive on the low and and exclusive on the high end.
167 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); 167 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1);
168 static void* highest_ever_allocated = reinterpret_cast<void*>(0); 168 static void* highest_ever_allocated = reinterpret_cast<void*>(0);
169 169
170 static MutexLockAdapter heap_limits_lock(OS::CreateMutex());
170 171
171 static void UpdateAllocatedSpaceLimits(void* address, int size) { 172 static void UpdateAllocatedSpaceLimits(void* address, int size) {
173 V8SharedStateLocker heap_limits_locker(&heap_limits_lock);
172 lowest_ever_allocated = Min(lowest_ever_allocated, address); 174 lowest_ever_allocated = Min(lowest_ever_allocated, address);
173 highest_ever_allocated = 175 highest_ever_allocated =
174 Max(highest_ever_allocated, 176 Max(highest_ever_allocated,
175 reinterpret_cast<void*>(reinterpret_cast<char*>(address) + size)); 177 reinterpret_cast<void*>(reinterpret_cast<char*>(address) + size));
176 } 178 }
177 179
178 180
179 bool OS::IsOutsideAllocatedSpace(void* address) { 181 bool OS::IsOutsideAllocatedSpace(void* address) {
182 V8SharedStateLocker heap_limits_locker(&heap_limits_lock);
180 return address < lowest_ever_allocated || address >= highest_ever_allocated; 183 return address < lowest_ever_allocated || address >= highest_ever_allocated;
181 } 184 }
182 185
183 186
184 size_t OS::AllocateAlignment() { 187 size_t OS::AllocateAlignment() {
185 return sysconf(_SC_PAGESIZE); 188 return sysconf(_SC_PAGESIZE);
186 } 189 }
187 190
188 191
189 void* OS::Allocate(const size_t requested, 192 void* OS::Allocate(const size_t requested,
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 802
800 // This sampler is no longer the active sampler. 803 // This sampler is no longer the active sampler.
801 active_sampler_ = NULL; 804 active_sampler_ = NULL;
802 active_ = false; 805 active_ = false;
803 } 806 }
804 807
805 808
806 #endif // ENABLE_LOGGING_AND_PROFILING 809 #endif // ENABLE_LOGGING_AND_PROFILING
807 810
808 } } // namespace v8::internal 811 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698