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 3404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3415 class DummyVisitor : public ObjectVisitor { | 3415 class DummyVisitor : public ObjectVisitor { |
3416 public: | 3416 public: |
3417 void VisitPointers(Object** start, Object** end) { } | 3417 void VisitPointers(Object** start, Object** end) { } |
3418 }; | 3418 }; |
3419 | 3419 |
3420 | 3420 |
3421 TEST(DeferredHandles) { | 3421 TEST(DeferredHandles) { |
3422 CcTest::InitializeVM(); | 3422 CcTest::InitializeVM(); |
3423 Isolate* isolate = Isolate::Current(); | 3423 Isolate* isolate = Isolate::Current(); |
3424 Heap* heap = isolate->heap(); | 3424 Heap* heap = isolate->heap(); |
3425 v8::HandleScope scope; | 3425 v8::HandleScope scope(reinterpret_cast<v8::Isolate*>(isolate)); |
3426 v8::ImplementationUtilities::HandleScopeData* data = | 3426 v8::ImplementationUtilities::HandleScopeData* data = |
3427 isolate->handle_scope_data(); | 3427 isolate->handle_scope_data(); |
3428 Handle<Object> init(heap->empty_string(), isolate); | 3428 Handle<Object> init(heap->empty_string(), isolate); |
3429 while (data->next < data->limit) { | 3429 while (data->next < data->limit) { |
3430 Handle<Object> obj(heap->empty_string(), isolate); | 3430 Handle<Object> obj(heap->empty_string(), isolate); |
3431 } | 3431 } |
3432 // An entire block of handles has been filled. | 3432 // An entire block of handles has been filled. |
3433 // Next handle would require a new block. | 3433 // Next handle would require a new block. |
3434 ASSERT(data->next == data->limit); | 3434 ASSERT(data->next == data->limit); |
3435 | 3435 |
(...skipping 11 matching lines...) Expand all Loading... |
3447 " var a = new Array(n);" | 3447 " var a = new Array(n);" |
3448 " for (var i = 0; i < n; i += 100) a[i] = i;" | 3448 " for (var i = 0; i < n; i += 100) a[i] = i;" |
3449 "};" | 3449 "};" |
3450 "f(10 * 1024 * 1024);"); | 3450 "f(10 * 1024 * 1024);"); |
3451 IncrementalMarking* marking = HEAP->incremental_marking(); | 3451 IncrementalMarking* marking = HEAP->incremental_marking(); |
3452 if (marking->IsStopped()) marking->Start(); | 3452 if (marking->IsStopped()) marking->Start(); |
3453 // This big step should be sufficient to mark the whole array. | 3453 // This big step should be sufficient to mark the whole array. |
3454 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 3454 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
3455 ASSERT(marking->IsComplete()); | 3455 ASSERT(marking->IsComplete()); |
3456 } | 3456 } |
OLD | NEW |