Reviewers: Yang,

Message:
LGTM. Landing.

Description:
Fix building with GCC 3.x


[email protected]
BUG=v8:2016, v8:2017
TEST=


Please review this at http://codereview.chromium.org/10823034/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M AUTHORS
  M include/v8-preparser.h
  M include/v8-profiler.h
  M include/v8-testing.h
  M include/v8.h
  M src/assembler.h
  M src/heap.h
  M src/mark-compact.cc


Index: AUTHORS
diff --git a/AUTHORS b/AUTHORS
index e7b08f2d3bc807a0530cccfd9c59a49cddb72156..bb33925060ee8b65e6d98deb23039aa800e7bef3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -28,6 +28,7 @@ Haitao Feng <[email protected]>
 Ioseb Dzmanashvili <[email protected]>
 Jan de Mooij <[email protected]>
 Jay Freeman <[email protected]>
+James Pike <[email protected]>
 Joel Stanley <[email protected]>
 John Jozwiak <[email protected]>
 Jonathan Liu <[email protected]>
Index: include/v8-preparser.h
diff --git a/include/v8-preparser.h b/include/v8-preparser.h
index f11d05ef793c1f869af26c733bffee8921c1e14a..389949d2004de9d409e8343cc8f54e85e8d2f144 100644
--- a/include/v8-preparser.h
+++ b/include/v8-preparser.h
@@ -55,11 +55,12 @@
 // Setup for Linux shared library export. There is no need to distinguish
 // between building or using the V8 shared library, but we should not
 // export symbols when we are building a static library.
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
+#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
+    (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
 #define V8EXPORT __attribute__ ((visibility("default")))
-#else  // defined(__GNUC__) && (__GNUC__ >= 4)
+#else
 #define V8EXPORT
-#endif  // defined(__GNUC__) && (__GNUC__ >= 4)
+#endif

 #endif  // _WIN32

Index: include/v8-profiler.h
diff --git a/include/v8-profiler.h b/include/v8-profiler.h
index cda2463362e199dc855240412dd251026eaaee44..2dcbb68d905ab67dcb7cb19b20b1697e77e7e16b 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -50,11 +50,12 @@

 // Setup for Linux shared library export. See v8.h in this directory for
 // information on how to build/use V8 as shared library.
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
+#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
+    (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
 #define V8EXPORT __attribute__ ((visibility("default")))
-#else  // defined(__GNUC__) && (__GNUC__ >= 4)
+#else
 #define V8EXPORT
-#endif  // defined(__GNUC__) && (__GNUC__ >= 4)
+#endif

 #endif  // _WIN32

Index: include/v8-testing.h
diff --git a/include/v8-testing.h b/include/v8-testing.h
index 245f74d878d9464708f9c890407e388dd2e6ddb3..59eebf9db47774b5a83b208f91badcf282b80f90 100644
--- a/include/v8-testing.h
+++ b/include/v8-testing.h
@@ -50,11 +50,12 @@

 // Setup for Linux shared library export. See v8.h in this directory for
 // information on how to build/use V8 as shared library.
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
+#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
+    (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
 #define V8EXPORT __attribute__ ((visibility("default")))
-#else  // defined(__GNUC__) && (__GNUC__ >= 4)
+#else
 #define V8EXPORT
-#endif  // defined(__GNUC__) && (__GNUC__ >= 4)
+#endif

 #endif  // _WIN32

Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 5c2c8b6671827f56ddddb6ef4a71182b6d54c164..480cbaa9553f295f6ad844f789e54fa128059402 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -63,15 +63,16 @@
 #else  // _WIN32

 // Setup for Linux shared library export.
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
+#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
+    (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
 #ifdef BUILDING_V8_SHARED
 #define V8EXPORT __attribute__ ((visibility("default")))
 #else
 #define V8EXPORT
 #endif
-#else  // defined(__GNUC__) && (__GNUC__ >= 4)
+#else
 #define V8EXPORT
-#endif  // defined(__GNUC__) && (__GNUC__ >= 4)
+#endif

 #endif  // _WIN32

Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index fb5ac1f007955a2c3c32610b5736dec0c53ab407..11e29979d2334dad63cddc463488c9a485d04c3d 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -51,7 +51,7 @@ class ApiFunction;
 namespace internal {

 struct StatsCounter;
-const unsigned kNoASTId = -1;
+const unsigned kNoASTId = UINT_MAX;
// -----------------------------------------------------------------------------
 // Platform independent assembler base class.

Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 85a64ec77c082ce2cc5ddfda636ae1f1d808f71d..99b97f303130a4037a7e4d3079953dabdbfc5efc 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1154,7 +1154,7 @@ class Heap {
   Object* global_contexts_list() { return global_contexts_list_; }

   // Number of mark-sweeps.
-  int ms_count() { return ms_count_; }
+  unsigned int ms_count() { return ms_count_; }

   // Iterates over all roots in the heap.
   void IterateRoots(ObjectVisitor* v, VisitMode mode);
@@ -1698,7 +1698,7 @@ class Heap {
   // Returns the amount of external memory registered since last global gc.
   intptr_t PromotedExternalMemorySize();

-  int ms_count_;  // how many mark-sweep collections happened
+  unsigned int ms_count_;  // how many mark-sweep collections happened
   unsigned int gc_count_;  // how many gc happened

   // For post mortem debugging.
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 6c16f61d25f0f1c80f5a62af7121230698b5835c..ba7fcf0b32fde861d6bf94fc0e7d176aa98f19a2 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -577,7 +577,7 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
     p->ClearEvacuationCandidate();

     if (FLAG_stress_compaction) {
-      int counter = space->heap()->ms_count();
+      unsigned int counter = space->heap()->ms_count();
uintptr_t page_number = reinterpret_cast<uintptr_t>(p) >> kPageSizeBits;
       if ((counter & 1) == (page_number & 1)) fragmentation = 1;
     } else if (mode == REDUCE_MEMORY_FOOTPRINT) {


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

Reply via email to