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 4860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4871 CHECK(heap->InOldPointerSpace(o->elements())); | 4871 CHECK(heap->InOldPointerSpace(o->elements())); |
4872 CHECK(heap->InOldPointerSpace(*o)); | 4872 CHECK(heap->InOldPointerSpace(*o)); |
4873 Page* page = Page::FromAddress(o->elements()->address()); | 4873 Page* page = Page::FromAddress(o->elements()->address()); |
4874 CHECK(page->parallel_sweeping() <= MemoryChunk::SWEEPING_FINALIZE || | 4874 CHECK(page->parallel_sweeping() <= MemoryChunk::SWEEPING_FINALIZE || |
4875 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); | 4875 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); |
4876 } | 4876 } |
4877 | 4877 |
4878 | 4878 |
4879 UNINITIALIZED_TEST(PromotionQueue) { | 4879 UNINITIALIZED_TEST(PromotionQueue) { |
4880 i::FLAG_expose_gc = true; | 4880 i::FLAG_expose_gc = true; |
4881 i::FLAG_max_semi_space_size = 2; | 4881 i::FLAG_max_semi_space_size = 2 * (Page::kPageSize / MB); |
4882 v8::Isolate* isolate = v8::Isolate::New(); | 4882 v8::Isolate* isolate = v8::Isolate::New(); |
4883 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 4883 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
4884 { | 4884 { |
4885 v8::Isolate::Scope isolate_scope(isolate); | 4885 v8::Isolate::Scope isolate_scope(isolate); |
4886 v8::HandleScope handle_scope(isolate); | 4886 v8::HandleScope handle_scope(isolate); |
4887 v8::Context::New(isolate)->Enter(); | 4887 v8::Context::New(isolate)->Enter(); |
4888 Heap* heap = i_isolate->heap(); | 4888 Heap* heap = i_isolate->heap(); |
4889 NewSpace* new_space = heap->new_space(); | 4889 NewSpace* new_space = heap->new_space(); |
4890 | 4890 |
4891 // In this test we will try to overwrite the promotion queue which is at the | 4891 // In this test we will try to overwrite the promotion queue which is at the |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5108 uint32_t default_size = s->AreaSize(); | 5108 uint32_t default_size = s->AreaSize(); |
5109 uint32_t reduced_size = Snapshot::SizeOfFirstPage(s->identity()); | 5109 uint32_t reduced_size = Snapshot::SizeOfFirstPage(s->identity()); |
5110 if (reduced_size == default_size) continue; | 5110 if (reduced_size == default_size) continue; |
5111 int counter = 0; | 5111 int counter = 0; |
5112 Page* page = NULL; | 5112 Page* page = NULL; |
5113 for (PageIterator it(s); it.has_next(); page = it.next()) counter++; | 5113 for (PageIterator it(s); it.has_next(); page = it.next()) counter++; |
5114 CHECK_LE(counter, 1); | 5114 CHECK_LE(counter, 1); |
5115 CHECK(static_cast<uint32_t>(page->area_size()) == reduced_size); | 5115 CHECK(static_cast<uint32_t>(page->area_size()) == reduced_size); |
5116 } | 5116 } |
5117 } | 5117 } |
OLD | NEW |