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 5573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5584 | 5584 |
5585 for (HeapObject* obj = it.next(); obj != NULL; obj = it.next()) { | 5585 for (HeapObject* obj = it.next(); obj != NULL; obj = it.next()) { |
5586 // Let's not optimize the loop away. | 5586 // Let's not optimize the loop away. |
5587 CHECK(obj->address() != nullptr); | 5587 CHECK(obj->address() != nullptr); |
5588 } | 5588 } |
5589 } | 5589 } |
5590 | 5590 |
5591 | 5591 |
5592 UNINITIALIZED_TEST(PromotionQueue) { | 5592 UNINITIALIZED_TEST(PromotionQueue) { |
5593 i::FLAG_expose_gc = true; | 5593 i::FLAG_expose_gc = true; |
5594 i::FLAG_max_semi_space_size = 2 * (Page::kPageSize / MB); | 5594 i::FLAG_max_semi_space_size = 2 * Page::kPageSize / MB; |
5595 i::FLAG_min_semi_space_size = i::FLAG_max_semi_space_size; | 5595 i::FLAG_min_semi_space_size = i::FLAG_max_semi_space_size; |
5596 v8::Isolate::CreateParams create_params; | 5596 v8::Isolate::CreateParams create_params; |
5597 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); | 5597 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); |
5598 v8::Isolate* isolate = v8::Isolate::New(create_params); | 5598 v8::Isolate* isolate = v8::Isolate::New(create_params); |
5599 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 5599 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
5600 { | 5600 { |
5601 v8::Isolate::Scope isolate_scope(isolate); | 5601 v8::Isolate::Scope isolate_scope(isolate); |
5602 v8::HandleScope handle_scope(isolate); | 5602 v8::HandleScope handle_scope(isolate); |
5603 v8::Context::New(isolate)->Enter(); | 5603 v8::Context::New(isolate)->Enter(); |
5604 Heap* heap = i_isolate->heap(); | 5604 Heap* heap = i_isolate->heap(); |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6761 | 6761 |
6762 intptr_t size_before = heap->SizeOfObjects(); | 6762 intptr_t size_before = heap->SizeOfObjects(); |
6763 Handle<FixedArray> array = isolate->factory()->NewFixedArray(200000); | 6763 Handle<FixedArray> array = isolate->factory()->NewFixedArray(200000); |
6764 array->Shrink(1); | 6764 array->Shrink(1); |
6765 intptr_t size_after = heap->SizeOfObjects(); | 6765 intptr_t size_after = heap->SizeOfObjects(); |
6766 CHECK_EQ(size_after, size_before + array->Size()); | 6766 CHECK_EQ(size_after, size_before + array->Size()); |
6767 } | 6767 } |
6768 | 6768 |
6769 } // namespace internal | 6769 } // namespace internal |
6770 } // namespace v8 | 6770 } // namespace v8 |
OLD | NEW |