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

Unified Diff: src/platform-win32.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/regexp-macro-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-win32.cc
===================================================================
--- src/platform-win32.cc (revision 3427)
+++ src/platform-win32.cc (working copy)
@@ -393,11 +393,13 @@
}
}
+static MutexLockAdapter time_lock(OS::CreateMutex());
// Initialize timezone information. The timezone information is obtained from
// windows. If we cannot get the timezone information we fall back to CET.
// Please notice that this code is not thread-safe.
void Time::TzSet() {
+ V8SharedStateLocker time_locker(&time_lock);
// Just return if timezone information has already been initialized.
if (tz_initialized_) return;
@@ -506,7 +508,6 @@
this->time_.t_ = init_time.t_ + (static_cast<int64_t>(elapsed) * 10000);
}
-
// Return the local timezone offset in milliseconds east of UTC. This
// takes into account whether daylight saving is in effect at the time.
// Only times in the 32-bit Unix range may be passed to this function.
@@ -789,16 +790,19 @@
static void* lowest_ever_allocated = reinterpret_cast<void*>(-1);
static void* highest_ever_allocated = reinterpret_cast<void*>(0);
+static MutexLockAdapter heap_limits_lock(OS::CreateMutex());
static void UpdateAllocatedSpaceLimits(void* address, int size) {
- lowest_ever_allocated = Min(lowest_ever_allocated, address);
- highest_ever_allocated =
- Max(highest_ever_allocated,
- reinterpret_cast<void*>(reinterpret_cast<char*>(address) + size));
+ V8SharedStateLocker heap_limits_locker(&heap_limits_lock);
+ lowest_ever_allocated = Min(
+ lowest_ever_allocated, reinterpret_cast<void*>(address));
+ highest_ever_allocated = Max(highest_ever_allocated,
+ reinterpret_cast<void*>(reinterpret_cast<char*>(address) + size));
}
bool OS::IsOutsideAllocatedSpace(void* pointer) {
+ V8SharedStateLocker heap_limits_locker(&heap_limits_lock);
if (pointer < lowest_ever_allocated || pointer >= highest_ever_allocated)
return true;
// Ask the Windows API
@@ -812,7 +816,7 @@
// of two. The reason for always returning a power of two is that the
// rounding up in OS::Allocate expects that.
static size_t GetPageSize() {
- static size_t page_size = 0;
+ static volatile size_t page_size = 0;
if (page_size == 0) {
SYSTEM_INFO info;
GetSystemInfo(&info);
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/regexp-macro-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698