OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 | 966 |
967 // Check function is compiled. | 967 // Check function is compiled. |
968 Object* func_value = Top::context()->global()->GetProperty(*foo_name); | 968 Object* func_value = Top::context()->global()->GetProperty(*foo_name); |
969 CHECK(func_value->IsJSFunction()); | 969 CHECK(func_value->IsJSFunction()); |
970 Handle<JSFunction> function(JSFunction::cast(func_value)); | 970 Handle<JSFunction> function(JSFunction::cast(func_value)); |
971 CHECK(function->shared()->is_compiled()); | 971 CHECK(function->shared()->is_compiled()); |
972 | 972 |
973 Heap::CollectAllGarbage(true); | 973 Heap::CollectAllGarbage(true); |
974 Heap::CollectAllGarbage(true); | 974 Heap::CollectAllGarbage(true); |
975 | 975 |
976 // foo should still be in the compilation cache and therefore not | |
977 // have been removed. | |
978 CHECK(function->shared()->is_compiled()); | 976 CHECK(function->shared()->is_compiled()); |
| 977 |
979 Heap::CollectAllGarbage(true); | 978 Heap::CollectAllGarbage(true); |
980 Heap::CollectAllGarbage(true); | 979 Heap::CollectAllGarbage(true); |
981 Heap::CollectAllGarbage(true); | 980 Heap::CollectAllGarbage(true); |
| 981 Heap::CollectAllGarbage(true); |
982 Heap::CollectAllGarbage(true); | 982 Heap::CollectAllGarbage(true); |
983 | 983 |
984 // foo should no longer be in the compilation cache | 984 // foo should no longer be in the compilation cache |
985 CHECK(!function->shared()->is_compiled()); | 985 CHECK(!function->shared()->is_compiled()); |
| 986 CHECK(!function->is_compiled()); |
986 // Call foo to get it recompiled. | 987 // Call foo to get it recompiled. |
987 CompileRun("foo()"); | 988 CompileRun("foo()"); |
988 CHECK(function->shared()->is_compiled()); | 989 CHECK(function->shared()->is_compiled()); |
| 990 CHECK(function->is_compiled()); |
989 } | 991 } |
OLD | NEW |