Revision: 5913
Author: [email protected]
Date: Thu Dec  2 07:37:45 2010
Log: nGW build
- add missing functions SignalCodeMovingGC() and MemoryBarrier()
- avoid pointer conversion/comparison warnings
- don't attempt to hide symbols with -fvisibility, MinGW doesn't support it

BUG=http://code.google.com/p/v8/issues/detail?id=949

Patch by Bert Belder <[email protected]>

Review URL: http://codereview.chromium.org/5471001

http://code.google.com/p/v8/source/detail?r=5913

Modified:
 /branches/bleeding_edge/AUTHORS
 /branches/bleeding_edge/SConstruct
 /branches/bleeding_edge/src/platform-win32.cc

=======================================
--- /branches/bleeding_edge/AUTHORS     Wed Nov 24 01:40:58 2010
+++ /branches/bleeding_edge/AUTHORS     Thu Dec  2 07:37:45 2010
@@ -11,6 +11,7 @@
 Alexander Botero-Lowry <[email protected]>
 Alexandre Vassalotti <[email protected]>
 Andreas Anyuru <[email protected]>
+Bert Belder <[email protected]>
 Burcu Dogan <[email protected]>
 Craig Schlenter <[email protected]>
 Daniel Andersson <[email protected]>
=======================================
--- /branches/bleeding_edge/SConstruct  Mon Oct 25 09:40:41 2010
+++ /branches/bleeding_edge/SConstruct  Thu Dec  2 07:37:45 2010
@@ -654,9 +654,18 @@
     return None


+def GuessVisibility(os, toolchain):
+  if os == 'win32' and toolchain == 'gcc':
+    # MinGW can't do it.
+    return 'default'
+  else:
+    return 'hidden'
+
+
 OS_GUESS = utils.GuessOS()
 TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
 ARCH_GUESS = utils.GuessArchitecture()
+VISIBILITY_GUESS = GuessVisibility(OS_GUESS, TOOLCHAIN_GUESS)


 SIMPLE_OPTIONS = {
@@ -762,8 +771,8 @@
   },
   'visibility': {
     'values': ['default', 'hidden'],
-    'default': 'hidden',
-    'help': 'shared library symbol visibility'
+    'default': VISIBILITY_GUESS,
+    'help': 'shared library symbol visibility (%s)' % VISIBILITY_GUESS
   },
   'pgo': {
     'values': ['off', 'instrument', 'optimize'],
=======================================
--- /branches/bleeding_edge/src/platform-win32.cc       Mon Nov 29 06:28:06 2010
+++ /branches/bleeding_edge/src/platform-win32.cc       Thu Dec  2 07:37:45 2010
@@ -206,6 +206,12 @@
   strncpy(strDest, strSource, count);
   return 0;
 }
+
+
+inline void MemoryBarrier() {
+  int barrier = 0;
+  __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
+}

 #endif  // __MINGW32__

@@ -858,13 +864,14 @@

   // VirtualAlloc rounds allocated size to page size automatically.
   size_t msize = RoundUp(requested, static_cast<int>(GetPageSize()));
-  intptr_t address = NULL;
+  intptr_t address = 0;

   // Windows XP SP2 allows Data Excution Prevention (DEP).
   int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;

   // For exectutable pages try and randomize the allocation address
-  if (prot == PAGE_EXECUTE_READWRITE && msize >= Page::kPageSize) {
+  if (prot == PAGE_EXECUTE_READWRITE &&
+      msize >= static_cast<size_t>(Page::kPageSize)) {
     address = (V8::RandomPrivate() << kPageSizeBits)
       | kAllocationRandomAddressMin;
     address &= kAllocationRandomAddressMax;
@@ -874,7 +881,7 @@
                               msize,
                               MEM_COMMIT | MEM_RESERVE,
                               prot);
-  if (mbase == NULL && address != NULL)
+  if (mbase == NULL && address != 0)
     mbase = VirtualAlloc(NULL, msize, MEM_COMMIT | MEM_RESERVE, prot);

   if (mbase == NULL) {
@@ -1347,6 +1354,7 @@

 #else  // __MINGW32__
 void OS::LogSharedLibraryAddresses() { }
+void OS::SignalCodeMovingGC() { }
 int OS::StackWalk(Vector<OS::StackFrame> frames) { return 0; }
 #endif  // __MINGW32__

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to