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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 CHECK(!function->shared()->is_compiled() || function->IsOptimized()); | 977 CHECK(!function->shared()->is_compiled() || function->IsOptimized()); |
978 CHECK(!function->is_compiled() || function->IsOptimized()); | 978 CHECK(!function->is_compiled() || function->IsOptimized()); |
979 // Call foo to get it recompiled. | 979 // Call foo to get it recompiled. |
980 CompileRun("foo()"); | 980 CompileRun("foo()"); |
981 CHECK(function->shared()->is_compiled()); | 981 CHECK(function->shared()->is_compiled()); |
982 CHECK(function->is_compiled()); | 982 CHECK(function->is_compiled()); |
983 } | 983 } |
984 | 984 |
985 | 985 |
986 // Count the number of global contexts in the weak list of global contexts. | 986 // Count the number of global contexts in the weak list of global contexts. |
987 static int CountGlobalContexts() { | 987 int CountGlobalContexts() { |
988 int count = 0; | 988 int count = 0; |
989 Object* object = HEAP->global_contexts_list(); | 989 Object* object = HEAP->global_contexts_list(); |
990 while (!object->IsUndefined()) { | 990 while (!object->IsUndefined()) { |
991 count++; | 991 count++; |
992 object = Context::cast(object)->get(Context::NEXT_CONTEXT_LINK); | 992 object = Context::cast(object)->get(Context::NEXT_CONTEXT_LINK); |
993 } | 993 } |
994 return count; | 994 return count; |
995 } | 995 } |
996 | 996 |
997 | 997 |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 HEAP->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 1"); | 1925 HEAP->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 1"); |
1926 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); | 1926 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); |
1927 HEAP->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 2"); | 1927 HEAP->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 2"); |
1928 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages() * 2); | 1928 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages() * 2); |
1929 | 1929 |
1930 // Triggering a last-resort GC should cause all pages to be released | 1930 // Triggering a last-resort GC should cause all pages to be released |
1931 // to the OS so that other processes can seize the memory. | 1931 // to the OS so that other processes can seize the memory. |
1932 HEAP->CollectAllAvailableGarbage("triggered really hard"); | 1932 HEAP->CollectAllAvailableGarbage("triggered really hard"); |
1933 CHECK_EQ(1, old_pointer_space->CountTotalPages()); | 1933 CHECK_EQ(1, old_pointer_space->CountTotalPages()); |
1934 } | 1934 } |
OLD | NEW |