Commit 63670bea authored by bak@chromium.org's avatar bak@chromium.org

- Changed gc-greedy to ignore boostrapping.

  This change reduces the running time of tests without snapshotting.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9276b48a
......@@ -58,7 +58,7 @@ class Bootstrapper : public AllStatic {
// Append code that needs fixup at the end of boot strapping.
static void AddFixup(Code* code, MacroAssembler* masm);
// Tells wheter boostrapping is active.
// Tells whether boostrapping is active.
static bool IsActive();
// Encoding/decoding support for fixup flags.
......
......@@ -147,10 +147,7 @@ OldSpace* Heap::TargetSpace(HeapObject* object) {
#define GC_GREEDY_CHECK() \
ASSERT(!FLAG_gc_greedy \
|| v8::internal::Heap::disallow_allocation_failure() \
|| v8::internal::Heap::CollectGarbage(0, NEW_SPACE))
ASSERT(!FLAG_gc_greedy || v8::internal::Heap::GarbageCollectionGreedyCheck())
// Do not use the identifier __object__ in a call to this macro.
//
......
......@@ -3106,4 +3106,12 @@ const char* GCTracer::CollectorString() {
}
bool Heap::GarbageCollectionGreedyCheck() {
ASSERT(FLAG_gc_greedy);
if (Bootstrapper::IsActive()) return true;
if (disallow_allocation_failure()) return true;
return CollectGarbage(0, NEW_SPACE);
}
} } // namespace v8::internal
......@@ -565,6 +565,9 @@ class Heap : public AllStatic {
// ensure correct callback for weak global handles.
static void PerformScavenge();
// Utility used with flag gc-greedy.
static bool GarbageCollectionGreedyCheck();
static void SetGlobalGCPrologueCallback(GCCallback callback) {
global_gc_prologue_callback_ = callback;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment