| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 TestHeap* heap = CcTest::test_heap(); | 132 TestHeap* heap = CcTest::test_heap(); |
| 133 Factory* factory = isolate->factory(); | 133 Factory* factory = isolate->factory(); |
| 134 | 134 |
| 135 v8::HandleScope sc(CcTest::isolate()); | 135 v8::HandleScope sc(CcTest::isolate()); |
| 136 Handle<GlobalObject> global(isolate->context()->global_object()); | 136 Handle<GlobalObject> global(isolate->context()->global_object()); |
| 137 | 137 |
| 138 // call mark-compact when heap is empty | 138 // call mark-compact when heap is empty |
| 139 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 1"); | 139 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 1"); |
| 140 | 140 |
| 141 // keep allocating garbage in new space until it fails | 141 // keep allocating garbage in new space until it fails |
| 142 const int ARRAY_SIZE = 100; | 142 const int arraysize = 100; |
| 143 AllocationResult allocation; | 143 AllocationResult allocation; |
| 144 do { | 144 do { |
| 145 allocation = heap->AllocateFixedArray(ARRAY_SIZE); | 145 allocation = heap->AllocateFixedArray(arraysize); |
| 146 } while (!allocation.IsRetry()); | 146 } while (!allocation.IsRetry()); |
| 147 heap->CollectGarbage(NEW_SPACE, "trigger 2"); | 147 heap->CollectGarbage(NEW_SPACE, "trigger 2"); |
| 148 heap->AllocateFixedArray(ARRAY_SIZE).ToObjectChecked(); | 148 heap->AllocateFixedArray(arraysize).ToObjectChecked(); |
| 149 | 149 |
| 150 // keep allocating maps until it fails | 150 // keep allocating maps until it fails |
| 151 do { | 151 do { |
| 152 allocation = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 152 allocation = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 153 } while (!allocation.IsRetry()); | 153 } while (!allocation.IsRetry()); |
| 154 heap->CollectGarbage(MAP_SPACE, "trigger 3"); | 154 heap->CollectGarbage(MAP_SPACE, "trigger 3"); |
| 155 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize).ToObjectChecked(); | 155 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize).ToObjectChecked(); |
| 156 | 156 |
| 157 { HandleScope scope(isolate); | 157 { HandleScope scope(isolate); |
| 158 // allocate a garbage | 158 // allocate a garbage |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 496 |
| 497 | 497 |
| 498 TEST(RegressJoinThreadsOnIsolateDeinit) { | 498 TEST(RegressJoinThreadsOnIsolateDeinit) { |
| 499 intptr_t size_limit = ShortLivingIsolate() * 2; | 499 intptr_t size_limit = ShortLivingIsolate() * 2; |
| 500 for (int i = 0; i < 10; i++) { | 500 for (int i = 0; i < 10; i++) { |
| 501 CHECK_GT(size_limit, ShortLivingIsolate()); | 501 CHECK_GT(size_limit, ShortLivingIsolate()); |
| 502 } | 502 } |
| 503 } | 503 } |
| 504 | 504 |
| 505 #endif // __linux__ and !USE_SIMULATOR | 505 #endif // __linux__ and !USE_SIMULATOR |
| OLD | NEW |