From 7b45ab9501190447d9963487cd034e184667572f Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Mon, 11 Feb 2013 13:02:20 +0000 Subject: [PATCH] Don't use TLS for space iterators. This is not only inherently slow, but it also forces the caller to enter an Isolate before. Both is bad, so we have to do some heap plumbing. BUG=v8:2531 Review URL: https://codereview.chromium.org/12217106 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13638 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/debug.cc | 20 ++++----- src/heap-profiler.cc | 11 ++--- src/heap-profiler.h | 4 +- src/heap.cc | 89 +++++++++++++++++++++------------------ src/heap.h | 33 +++++++++------ src/liveedit.cc | 11 ++--- src/log.cc | 22 ++++++---- src/mark-compact.cc | 2 +- src/profile-generator.cc | 28 ++++++------ src/profile-generator.h | 13 ++++-- src/runtime.cc | 37 ++++++++-------- test/cctest/test-api.cc | 2 +- test/cctest/test-debug.cc | 2 +- test/cctest/test-heap.cc | 10 ++--- 14 files changed, 159 insertions(+), 125 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index 866839d4f5..05050d1aa2 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -2005,14 +2005,15 @@ void Debug::PrepareForBreakPoints() { { // We are going to iterate heap to find all functions without // debug break slots. - isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, - "preparing for breakpoints"); + Heap* heap = isolate_->heap(); + heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, + "preparing for breakpoints"); // Ensure no GC in this scope as we are going to use gc_metadata // field in the Code object to mark active functions. AssertNoAllocation no_allocation; - Object* active_code_marker = isolate_->heap()->the_hole_value(); + Object* active_code_marker = heap->the_hole_value(); CollectActiveFunctionsFromThread(isolate_, isolate_->thread_local_top(), @@ -2026,7 +2027,7 @@ void Debug::PrepareForBreakPoints() { // Scan the heap for all non-optimized functions which have no // debug break slots and are not active or inlined into an active // function and mark them for lazy compilation. - HeapIterator iterator; + HeapIterator iterator(heap); HeapObject* obj = NULL; while (((obj = iterator.next()) != NULL)) { if (obj->IsJSFunction()) { @@ -2121,11 +2122,12 @@ Object* Debug::FindSharedFunctionInfoInScript(Handle