OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 | 2 |
3 #include <stdlib.h> | 3 #include <stdlib.h> |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "execution.h" | 7 #include "execution.h" |
8 #include "factory.h" | 8 #include "factory.h" |
9 #include "macro-assembler.h" | 9 #include "macro-assembler.h" |
10 #include "global-handles.h" | 10 #include "global-handles.h" |
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 CHECK(root->map()->IsMap()); | 1895 CHECK(root->map()->IsMap()); |
1896 } | 1896 } |
1897 | 1897 |
1898 | 1898 |
1899 // Implemented in the test-alloc.cc test suite. | 1899 // Implemented in the test-alloc.cc test suite. |
1900 void SimulateFullSpace(PagedSpace* space); | 1900 void SimulateFullSpace(PagedSpace* space); |
1901 | 1901 |
1902 | 1902 |
1903 TEST(ReleaseOverReservedPages) { | 1903 TEST(ReleaseOverReservedPages) { |
1904 i::FLAG_trace_gc = true; | 1904 i::FLAG_trace_gc = true; |
| 1905 // The optimizer can allocate stuff, messing up the test. |
| 1906 i::FLAG_crankshaft = false; |
| 1907 i::FLAG_always_opt = false; |
1905 InitializeVM(); | 1908 InitializeVM(); |
1906 v8::HandleScope scope; | 1909 v8::HandleScope scope; |
1907 static const int number_of_test_pages = 20; | 1910 static const int number_of_test_pages = 20; |
1908 | 1911 |
1909 // Prepare many pages with low live-bytes count. | 1912 // Prepare many pages with low live-bytes count. |
1910 PagedSpace* old_pointer_space = HEAP->old_pointer_space(); | 1913 PagedSpace* old_pointer_space = HEAP->old_pointer_space(); |
1911 CHECK_EQ(1, old_pointer_space->CountTotalPages()); | 1914 CHECK_EQ(1, old_pointer_space->CountTotalPages()); |
1912 for (int i = 0; i < number_of_test_pages; i++) { | 1915 for (int i = 0; i < number_of_test_pages; i++) { |
1913 AlwaysAllocateScope always_allocate; | 1916 AlwaysAllocateScope always_allocate; |
1914 SimulateFullSpace(old_pointer_space); | 1917 SimulateFullSpace(old_pointer_space); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 CHECK(value->Equals(obj->GetHiddenValue(v8_str("key string")))); | 2018 CHECK(value->Equals(obj->GetHiddenValue(v8_str("key string")))); |
2016 | 2019 |
2017 // Check size. | 2020 // Check size. |
2018 DescriptorArray* descriptors = internal_obj->map()->instance_descriptors(); | 2021 DescriptorArray* descriptors = internal_obj->map()->instance_descriptors(); |
2019 ObjectHashTable* hashtable = ObjectHashTable::cast( | 2022 ObjectHashTable* hashtable = ObjectHashTable::cast( |
2020 internal_obj->FastPropertyAt(descriptors->GetFieldIndex(0))); | 2023 internal_obj->FastPropertyAt(descriptors->GetFieldIndex(0))); |
2021 // HashTable header (5) and 4 initial entries (8). | 2024 // HashTable header (5) and 4 initial entries (8). |
2022 CHECK_LE(hashtable->SizeFor(hashtable->length()), 13 * kPointerSize); | 2025 CHECK_LE(hashtable->SizeFor(hashtable->length()), 13 * kPointerSize); |
2023 } | 2026 } |
2024 } | 2027 } |
OLD | NEW |