Chromium Code Reviews| Index: src/runtime.cc |
| =================================================================== |
| --- src/runtime.cc (revision 7102) |
| +++ src/runtime.cc (working copy) |
| @@ -9739,14 +9739,15 @@ |
| // again as the compilation might create inner functions from the newly |
| // compiled function and the actual requested break point might be in one of |
| // these functions. |
| + Heap::EnsureHeapIsIterable(); |
| bool done = false; |
| // The current candidate for the source position: |
| int target_start_position = RelocInfo::kNoPosition; |
| Handle<SharedFunctionInfo> target; |
| while (!done) { |
| HeapIterator iterator; |
| - for (HeapObject* obj = iterator.next(); |
| - obj != NULL; obj = iterator.next()) { |
| + for (HeapObject* obj = iterator.Next(); |
| + obj != NULL; obj = iterator.Next()) { |
| if (obj->IsSharedFunctionInfo()) { |
| Handle<SharedFunctionInfo> shared(SharedFunctionInfo::cast(obj)); |
| if (shared->script() == *script) { |
| @@ -10242,7 +10243,7 @@ |
| JSObject* last = NULL; |
| HeapIterator iterator; |
| HeapObject* heap_obj = NULL; |
| - while (((heap_obj = iterator.next()) != NULL) && |
| + while (((heap_obj = iterator.Next()) != NULL) && |
| (max_references == 0 || count < max_references)) { |
| // Only look at all JSObjects. |
| if (heap_obj->IsJSObject()) { |
| @@ -10307,7 +10308,7 @@ |
| ASSERT(args.length() == 3); |
| // First perform a full GC in order to avoid references from dead objects. |
| - Heap::CollectAllGarbage(false); |
| + Heap::CollectAllGarbage(Heap::kSweepPreciselyMask); |
| // Check parameters. |
| CONVERT_CHECKED(JSObject, target, args[0]); |
| @@ -10359,7 +10360,7 @@ |
| int count = 0; |
| HeapIterator iterator; |
| HeapObject* heap_obj = NULL; |
| - while (((heap_obj = iterator.next()) != NULL) && |
| + while (((heap_obj = iterator.Next()) != NULL) && |
| (max_references == 0 || count < max_references)) { |
| // Only look at all JSObjects. |
| if (heap_obj->IsJSObject()) { |
| @@ -10387,7 +10388,7 @@ |
| ASSERT(args.length() == 2); |
| // First perform a full GC in order to avoid dead objects. |
| - Heap::CollectAllGarbage(false); |
| + Heap::CollectAllGarbage(Heap::kSweepPreciselyMask); |
| // Check parameters. |
| CONVERT_CHECKED(JSFunction, constructor, args[0]); |
| @@ -10486,7 +10487,7 @@ |
| int counter = 0; |
| int buffer_size = buffer->length(); |
| HeapIterator iterator; |
| - for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
| + for (HeapObject* obj = iterator.Next(); obj != NULL; obj = iterator.Next()) { |
| ASSERT(obj != NULL); |
| if (!obj->IsSharedFunctionInfo()) { |
| continue; |
| @@ -10512,15 +10513,18 @@ |
| HandleScope scope; |
| CONVERT_CHECKED(JSValue, script_value, args[0]); |
| + |
| Handle<Script> script = Handle<Script>(Script::cast(script_value->value())); |
| const int kBufferSize = 32; |
| Handle<FixedArray> array; |
| array = Factory::NewFixedArray(kBufferSize); |
| + Heap::EnsureHeapIsIterable(); |
| int number = FindSharedFunctionInfosForScript(*script, *array); |
| if (number > kBufferSize) { |
| array = Factory::NewFixedArray(number); |
| + Heap::EnsureHeapIsIterable(); |
|
Vyacheslav Egorov (Chromium)
2011/03/15 09:20:09
This is very fragile. We definitely should encapsu
Erik Corry
2011/03/17 13:39:17
Done.
|
| FindSharedFunctionInfosForScript(*script, *array); |
| } |
| @@ -10761,7 +10765,7 @@ |
| // Performs a GC. |
| // Presently, it only does a full GC. |
| static MaybeObject* Runtime_CollectGarbage(Arguments args) { |
| - Heap::CollectAllGarbage(true); |
| + Heap::CollectAllGarbage(Heap::kForceCompactionMask); |
| return Heap::undefined_value(); |
| } |
| @@ -10809,12 +10813,13 @@ |
| // some kind of user interaction the performance is not crucial. |
| static Handle<Object> Runtime_GetScriptFromScriptName( |
| Handle<String> script_name) { |
| + Heap::EnsureHeapIsIterable(); |
| // Scan the heap for Script objects to find the script with the requested |
| // script data. |
| Handle<Script> script; |
| HeapIterator iterator; |
| HeapObject* obj = NULL; |
| - while (script.is_null() && ((obj = iterator.next()) != NULL)) { |
| + while (script.is_null() && ((obj = iterator.Next()) != NULL)) { |
| // If a script is found check if it has the script data requested. |
| if (obj->IsScript()) { |
| if (Script::cast(obj)->name()->IsString()) { |
| @@ -11208,7 +11213,7 @@ |
| // Handle last resort GC and make sure to allow future allocations |
| // to grow the heap without causing GCs (if possible). |
| Counters::gc_last_resort_from_js.Increment(); |
| - Heap::CollectAllGarbage(false); |
| + Heap::CollectAllGarbage(Heap::kNoGCFlags); |
| } |
| } |