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

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

Issue 6788007: Fix multi-isolate build: (Closed)
Patch Set: Created 9 years, 8 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
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | src/platform-win32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 #if defined(V8_TARGET_ARCH_IA32) 208 #if defined(V8_TARGET_ARCH_IA32)
209 static OS::MemCopyFunction memcopy_function = NULL; 209 static OS::MemCopyFunction memcopy_function = NULL;
210 static Mutex* memcopy_function_mutex = OS::CreateMutex(); 210 static Mutex* memcopy_function_mutex = OS::CreateMutex();
211 // Defined in codegen-ia32.cc. 211 // Defined in codegen-ia32.cc.
212 OS::MemCopyFunction CreateMemCopyFunction(); 212 OS::MemCopyFunction CreateMemCopyFunction();
213 213
214 // Copy memory area to disjoint memory area. 214 // Copy memory area to disjoint memory area.
215 void OS::MemCopy(void* dest, const void* src, size_t size) { 215 void OS::MemCopy(void* dest, const void* src, size_t size) {
216 if (memcopy_function == NULL) { 216 if (memcopy_function == NULL) {
217 ScopedLock lock(memcopy_function_mutex); 217 ScopedLock lock(memcopy_function_mutex);
218 Isolate::EnsureDefaultIsolate();
219 if (memcopy_function == NULL) { 218 if (memcopy_function == NULL) {
220 OS::MemCopyFunction temp = CreateMemCopyFunction(); 219 OS::MemCopyFunction temp = CreateMemCopyFunction();
221 MemoryBarrier(); 220 MemoryBarrier();
222 memcopy_function = temp; 221 memcopy_function = temp;
223 } 222 }
224 } 223 }
224 // Note: here we rely on dependent reads being ordered. This is true
225 // on all architectures we currently support.
225 (*memcopy_function)(dest, src, size); 226 (*memcopy_function)(dest, src, size);
226 #ifdef DEBUG 227 #ifdef DEBUG
227 CHECK_EQ(0, memcmp(dest, src, size)); 228 CHECK_EQ(0, memcmp(dest, src, size));
228 #endif 229 #endif
229 } 230 }
230 #endif // V8_TARGET_ARCH_IA32 231 #endif // V8_TARGET_ARCH_IA32
231 232
232 // ---------------------------------------------------------------------------- 233 // ----------------------------------------------------------------------------
233 // POSIX string support. 234 // POSIX string support.
234 // 235 //
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 return ntohl(value); 415 return ntohl(value);
415 } 416 }
416 417
417 418
418 Socket* OS::CreateSocket() { 419 Socket* OS::CreateSocket() {
419 return new POSIXSocket(); 420 return new POSIXSocket();
420 } 421 }
421 422
422 423
423 } } // namespace v8::internal 424 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698