Reviewers: Michael Starzinger,

Description:
Remove gc greedy mode.

BUG=

Please review this at https://codereview.chromium.org/227553005/

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

Affected files (+0, -84 lines):
  M src/flag-definitions.h
  M src/heap.h
  M src/heap.cc
  M src/heap-inl.h
  D test/mjsunit/greedy.js


Index: test/mjsunit/greedy.js
diff --git a/test/mjsunit/greedy.js b/test/mjsunit/greedy.js
deleted file mode 100644
index 8c49e41b9c6d43cb1c8ca1987f9d92899a6cb059..0000000000000000000000000000000000000000
--- a/test/mjsunit/greedy.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-//       copyright notice, this list of conditions and the following
-//       disclaimer in the documentation and/or other materials provided
-//       with the distribution.
-//     * Neither the name of Google Inc. nor the names of its
-//       contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Flags: --gc-greedy --noverify-heap
-
-function IterativeFib(n) {
-  var f0 = 0, f1 = 1;
-  for (; n > 0; --n) {
-    var f2 = f0 + f1;
-    f0 = f1; f1 = f2;
-  }
-  return f0;
-}
-
-function RecursiveFib(n) {
-  if (n <= 1) return n;
-  return RecursiveFib(n - 1) + RecursiveFib(n - 2);
-}
-
-function Check(n, expected) {
-  var i = IterativeFib(n);
-  var r = RecursiveFib(n);
-  assertEquals(i, expected);
-  assertEquals(r, expected);
-}
-
-Check(0, 0);
-Check(1, 1);
-Check(2, 1);
-Check(3, 1 + 1);
-Check(4, 2 + 1);
-Check(5, 3 + 2);
-Check(10, 55);
-Check(15, 610);
-Check(20, 6765);
-assertEquals(IterativeFib(75), 2111485077978050);
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index f3eaac8377b2ab59fc758040e3f4ce3d5336a628..0cb3f90d2bf583e2f7ee517bbb2d5dcdc725cfcb 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -743,7 +743,6 @@ DEFINE_bool(print_scopes, false, "print scopes")
 DEFINE_bool(trace_contexts, false, "trace contexts operations")

 // heap.cc
-DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations")
 DEFINE_bool(gc_verbose, false, "print stuff during garbage collection")
DEFINE_bool(heap_stats, false, "report heap statistics before and after GC")
 DEFINE_bool(code_stats, false, "report code statistics after GC")
Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 277f9c448dc911bedd9d7ee7d26c5f887bab5357..ea7dcda3b0acd8aee62f2507a5ab5852bd7196d1 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -627,13 +627,6 @@ Isolate* Heap::isolate() {
 }


-#ifdef DEBUG
-#define GC_GREEDY_CHECK(ISOLATE) \
-  if (FLAG_gc_greedy) (ISOLATE)->heap()->GarbageCollectionGreedyCheck()
-#else
-#define GC_GREEDY_CHECK(ISOLATE) { }
-#endif
-
 // Calls the FUNCTION_CALL function and retries it up to three times
 // to guarantee that any allocations performed during the call will
 // succeed if there's enough memory.
@@ -643,7 +636,6 @@ Isolate* Heap::isolate() {

#define CALL_AND_RETRY(ISOLATE, FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY) \ do { \ - GC_GREEDY_CHECK(ISOLATE); \ MaybeObject* __maybe_object__ = FUNCTION_CALL; \ Object* __object__ = NULL; \ if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index f06b8be1d98246d3ea9b5f3237b7a96ae211572c..2cb5b20b0f24481789b06e54e91d81f06e23366e 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -7674,16 +7674,6 @@ void DescriptorLookupCache::Clear() {
 }


-#ifdef DEBUG
-void Heap::GarbageCollectionGreedyCheck() {
-  ASSERT(FLAG_gc_greedy);
-  if (isolate_->bootstrapper()->IsActive()) return;
-  if (!AllowAllocationFailure::IsAllowed(isolate_)) return;
-  CollectGarbage(NEW_SPACE);
-}
-#endif
-
-
 void ExternalStringTable::CleanUp() {
   int last = 0;
   for (int i = 0; i < new_space_strings_.length(); ++i) {
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index b8110920b22de919ee7968ec22e7461d45c8e6d4..4b0b142568f568b6c5e3ca529f8f562bdbbf1eb6 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1297,11 +1297,6 @@ class Heap {

   PromotionQueue* promotion_queue() { return &promotion_queue_; }

-#ifdef DEBUG
-  // Utility used with flag gc-greedy.
-  void GarbageCollectionGreedyCheck();
-#endif
-
   void AddGCPrologueCallback(v8::Isolate::GCPrologueCallback callback,
                              GCType gc_type_filter,
                              bool pass_isolate = true);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to