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 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3476 while (data->next < data->limit) { | 3476 while (data->next < data->limit) { |
3477 Handle<Object> obj(heap->empty_string(), isolate); | 3477 Handle<Object> obj(heap->empty_string(), isolate); |
3478 } | 3478 } |
3479 // An entire block of handles has been filled. | 3479 // An entire block of handles has been filled. |
3480 // Next handle would require a new block. | 3480 // Next handle would require a new block. |
3481 ASSERT(data->next == data->limit); | 3481 ASSERT(data->next == data->limit); |
3482 | 3482 |
3483 DeferredHandleScope deferred(isolate); | 3483 DeferredHandleScope deferred(isolate); |
3484 DummyVisitor visitor; | 3484 DummyVisitor visitor; |
3485 isolate->handle_scope_implementer()->Iterate(&visitor); | 3485 isolate->handle_scope_implementer()->Iterate(&visitor); |
3486 deferred.Detach(); | 3486 delete deferred.Detach(); |
3487 } | 3487 } |
3488 | 3488 |
3489 | 3489 |
3490 TEST(IncrementalMarkingStepMakesBigProgressWithLargeObjects) { | 3490 TEST(IncrementalMarkingStepMakesBigProgressWithLargeObjects) { |
3491 CcTest::InitializeVM(); | 3491 CcTest::InitializeVM(); |
3492 v8::HandleScope scope(CcTest::isolate()); | 3492 v8::HandleScope scope(CcTest::isolate()); |
3493 CompileRun("function f(n) {" | 3493 CompileRun("function f(n) {" |
3494 " var a = new Array(n);" | 3494 " var a = new Array(n);" |
3495 " for (var i = 0; i < n; i += 100) a[i] = i;" | 3495 " for (var i = 0; i < n; i += 100) a[i] = i;" |
3496 "};" | 3496 "};" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3679 code = scope.CloseAndEscape(Handle<Code>(bar->code())); | 3679 code = scope.CloseAndEscape(Handle<Code>(bar->code())); |
3680 } | 3680 } |
3681 | 3681 |
3682 // Now make sure that a gc should get rid of the function | 3682 // Now make sure that a gc should get rid of the function |
3683 for (int i = 0; i < 4; i++) { | 3683 for (int i = 0; i < 4; i++) { |
3684 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); | 3684 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
3685 } | 3685 } |
3686 | 3686 |
3687 ASSERT(code->marked_for_deoptimization()); | 3687 ASSERT(code->marked_for_deoptimization()); |
3688 } | 3688 } |
OLD | NEW |