| 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 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 v8::HandleScope scope(CcTest::isolate()); | 1157 v8::HandleScope scope(CcTest::isolate()); |
| 1158 | 1158 |
| 1159 // Array of objects to scan haep for. | 1159 // Array of objects to scan haep for. |
| 1160 const int objs_count = 6; | 1160 const int objs_count = 6; |
| 1161 Handle<Object> objs[objs_count]; | 1161 Handle<Object> objs[objs_count]; |
| 1162 int next_objs_index = 0; | 1162 int next_objs_index = 0; |
| 1163 | 1163 |
| 1164 // Allocate a JS array to OLD_SPACE and NEW_SPACE | 1164 // Allocate a JS array to OLD_SPACE and NEW_SPACE |
| 1165 objs[next_objs_index++] = factory->NewJSArray(10); | 1165 objs[next_objs_index++] = factory->NewJSArray(10); |
| 1166 objs[next_objs_index++] = | 1166 objs[next_objs_index++] = |
| 1167 factory->NewJSArray(10, FAST_HOLEY_ELEMENTS, Strength::WEAK, TENURED); | 1167 factory->NewJSArray(10, FAST_HOLEY_ELEMENTS, TENURED); |
| 1168 | 1168 |
| 1169 // Allocate a small string to OLD_DATA_SPACE and NEW_SPACE | 1169 // Allocate a small string to OLD_DATA_SPACE and NEW_SPACE |
| 1170 objs[next_objs_index++] = factory->NewStringFromStaticChars("abcdefghij"); | 1170 objs[next_objs_index++] = factory->NewStringFromStaticChars("abcdefghij"); |
| 1171 objs[next_objs_index++] = | 1171 objs[next_objs_index++] = |
| 1172 factory->NewStringFromStaticChars("abcdefghij", TENURED); | 1172 factory->NewStringFromStaticChars("abcdefghij", TENURED); |
| 1173 | 1173 |
| 1174 // Allocate a large string (for large object space). | 1174 // Allocate a large string (for large object space). |
| 1175 int large_size = Page::kMaxRegularHeapObjectSize + 1; | 1175 int large_size = Page::kMaxRegularHeapObjectSize + 1; |
| 1176 char* str = new char[large_size]; | 1176 char* str = new char[large_size]; |
| 1177 for (int i = 0; i < large_size - 1; ++i) str[i] = 'a'; | 1177 for (int i = 0; i < large_size - 1; ++i) str[i] = 'a'; |
| (...skipping 5425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6603 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1); | 6603 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1); |
| 6604 } | 6604 } |
| 6605 } | 6605 } |
| 6606 // Force allocation from the free list. | 6606 // Force allocation from the free list. |
| 6607 heap->set_force_oom(true); | 6607 heap->set_force_oom(true); |
| 6608 heap->CollectGarbage(OLD_SPACE); | 6608 heap->CollectGarbage(OLD_SPACE); |
| 6609 } | 6609 } |
| 6610 | 6610 |
| 6611 } // namespace internal | 6611 } // namespace internal |
| 6612 } // namespace v8 | 6612 } // namespace v8 |
| OLD | NEW |