OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 CHECK_EQ(length, ascii_str->length()); | 870 CHECK_EQ(length, ascii_str->length()); |
871 DeleteArray(non_ascii); | 871 DeleteArray(non_ascii); |
872 DeleteArray(ascii); | 872 DeleteArray(ascii); |
873 } | 873 } |
874 } | 874 } |
875 | 875 |
876 | 876 |
877 static int ObjectsFoundInHeap(Heap* heap, Handle<Object> objs[], int size) { | 877 static int ObjectsFoundInHeap(Heap* heap, Handle<Object> objs[], int size) { |
878 // Count the number of objects found in the heap. | 878 // Count the number of objects found in the heap. |
879 int found_count = 0; | 879 int found_count = 0; |
| 880 heap->EnsureHeapIsIterable(); |
880 HeapIterator iterator(heap); | 881 HeapIterator iterator(heap); |
881 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 882 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
882 for (int i = 0; i < size; i++) { | 883 for (int i = 0; i < size; i++) { |
883 if (*objs[i] == obj) { | 884 if (*objs[i] == obj) { |
884 found_count++; | 885 found_count++; |
885 } | 886 } |
886 } | 887 } |
887 } | 888 } |
888 return found_count; | 889 return found_count; |
889 } | 890 } |
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 " var a = new Array(n);" | 3173 " var a = new Array(n);" |
3173 " for (var i = 0; i < n; i += 100) a[i] = i;" | 3174 " for (var i = 0; i < n; i += 100) a[i] = i;" |
3174 "};" | 3175 "};" |
3175 "f(10 * 1024 * 1024);"); | 3176 "f(10 * 1024 * 1024);"); |
3176 IncrementalMarking* marking = HEAP->incremental_marking(); | 3177 IncrementalMarking* marking = HEAP->incremental_marking(); |
3177 if (marking->IsStopped()) marking->Start(); | 3178 if (marking->IsStopped()) marking->Start(); |
3178 // This big step should be sufficient to mark the whole array. | 3179 // This big step should be sufficient to mark the whole array. |
3179 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 3180 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
3180 ASSERT(marking->IsComplete()); | 3181 ASSERT(marking->IsComplete()); |
3181 } | 3182 } |
OLD | NEW |