OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 CompileRun(source); | 954 CompileRun(source); |
955 } | 955 } |
956 | 956 |
957 // Check function is compiled. | 957 // Check function is compiled. |
958 Object* func_value = Isolate::Current()->context()->global()-> | 958 Object* func_value = Isolate::Current()->context()->global()-> |
959 GetProperty(*foo_name)->ToObjectChecked(); | 959 GetProperty(*foo_name)->ToObjectChecked(); |
960 CHECK(func_value->IsJSFunction()); | 960 CHECK(func_value->IsJSFunction()); |
961 Handle<JSFunction> function(JSFunction::cast(func_value)); | 961 Handle<JSFunction> function(JSFunction::cast(func_value)); |
962 CHECK(function->shared()->is_compiled()); | 962 CHECK(function->shared()->is_compiled()); |
963 | 963 |
964 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 964 // TODO(1609) Currently incremental marker does not support code flushing. |
965 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 965 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
| 966 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
966 | 967 |
967 CHECK(function->shared()->is_compiled()); | 968 CHECK(function->shared()->is_compiled()); |
968 | 969 |
969 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 970 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
970 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 971 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
971 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 972 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
972 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 973 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
973 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 974 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
974 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 975 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
975 | 976 |
976 // foo should no longer be in the compilation cache | 977 // foo should no longer be in the compilation cache |
977 CHECK(!function->shared()->is_compiled() || function->IsOptimized()); | 978 CHECK(!function->shared()->is_compiled() || function->IsOptimized()); |
978 CHECK(!function->is_compiled() || function->IsOptimized()); | 979 CHECK(!function->is_compiled() || function->IsOptimized()); |
979 // Call foo to get it recompiled. | 980 // Call foo to get it recompiled. |
980 CompileRun("foo()"); | 981 CompileRun("foo()"); |
981 CHECK(function->shared()->is_compiled()); | 982 CHECK(function->shared()->is_compiled()); |
982 CHECK(function->is_compiled()); | 983 CHECK(function->is_compiled()); |
983 } | 984 } |
984 | 985 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 CHECK(old_capacity == 2 * new_capacity); | 1266 CHECK(old_capacity == 2 * new_capacity); |
1266 | 1267 |
1267 // Consecutive shrinking should not affect space capacity. | 1268 // Consecutive shrinking should not affect space capacity. |
1268 old_capacity = new_space->Capacity(); | 1269 old_capacity = new_space->Capacity(); |
1269 new_space->Shrink(); | 1270 new_space->Shrink(); |
1270 new_space->Shrink(); | 1271 new_space->Shrink(); |
1271 new_space->Shrink(); | 1272 new_space->Shrink(); |
1272 new_capacity = new_space->Capacity(); | 1273 new_capacity = new_space->Capacity(); |
1273 CHECK(old_capacity == new_capacity); | 1274 CHECK(old_capacity == new_capacity); |
1274 } | 1275 } |
OLD | NEW |