Make sure that heap is iterable prior to iterating it in Logger:: methods.

R=vegorov@chromium.org
BUG=v8:1700
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5ed752de
...@@ -1519,6 +1519,7 @@ void Logger::LowLevelLogWriteBytes(const char* bytes, int size) { ...@@ -1519,6 +1519,7 @@ void Logger::LowLevelLogWriteBytes(const char* bytes, int size) {
void Logger::LogCodeObjects() { void Logger::LogCodeObjects() {
HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask);
HeapIterator iterator; HeapIterator iterator;
AssertNoAllocation no_alloc; AssertNoAllocation no_alloc;
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
...@@ -1573,6 +1574,7 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, ...@@ -1573,6 +1574,7 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared,
void Logger::LogCompiledFunctions() { void Logger::LogCompiledFunctions() {
HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask);
HandleScope scope; HandleScope scope;
const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL);
ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count);
...@@ -1591,6 +1593,7 @@ void Logger::LogCompiledFunctions() { ...@@ -1591,6 +1593,7 @@ void Logger::LogCompiledFunctions() {
void Logger::LogAccessorCallbacks() { void Logger::LogAccessorCallbacks() {
HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask);
HeapIterator iterator; HeapIterator iterator;
AssertNoAllocation no_alloc; AssertNoAllocation no_alloc;
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
......
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