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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 | 953 |
954 // Step 5: verify validity of region dirty marks. | 954 // Step 5: verify validity of region dirty marks. |
955 Address clone_addr = clone->address(); | 955 Address clone_addr = clone->address(); |
956 Page* page = Page::FromAddress(clone_addr); | 956 Page* page = Page::FromAddress(clone_addr); |
957 // Check that region covering inobject property 1 is marked dirty. | 957 // Check that region covering inobject property 1 is marked dirty. |
958 CHECK(page->IsRegionDirty(clone_addr + (object_size - kPointerSize))); | 958 CHECK(page->IsRegionDirty(clone_addr + (object_size - kPointerSize))); |
959 } | 959 } |
960 | 960 |
961 TEST(TestCodeFlushing) { | 961 TEST(TestCodeFlushing) { |
962 i::FLAG_allow_natives_syntax = true; | 962 i::FLAG_allow_natives_syntax = true; |
| 963 // If we do not flush code this test is invalid. |
| 964 if (!FLAG_flush_code) return; |
963 InitializeVM(); | 965 InitializeVM(); |
964 v8::HandleScope scope; | 966 v8::HandleScope scope; |
965 const char* source = "function foo() {" | 967 const char* source = "function foo() {" |
966 " var x = 42;" | 968 " var x = 42;" |
967 " var y = 42;" | 969 " var y = 42;" |
968 " var z = x + y;" | 970 " var z = x + y;" |
969 "};" | 971 "};" |
970 "foo()"; | 972 "foo()"; |
971 Handle<String> foo_name = Factory::LookupAsciiSymbol("foo"); | 973 Handle<String> foo_name = Factory::LookupAsciiSymbol("foo"); |
972 | 974 |
(...skipping 16 matching lines...) Expand all Loading... |
989 Heap::CollectAllGarbage(true); | 991 Heap::CollectAllGarbage(true); |
990 Heap::CollectAllGarbage(true); | 992 Heap::CollectAllGarbage(true); |
991 Heap::CollectAllGarbage(true); | 993 Heap::CollectAllGarbage(true); |
992 | 994 |
993 // foo should no longer be in the compilation cache | 995 // foo should no longer be in the compilation cache |
994 CHECK(!function->shared()->is_compiled()); | 996 CHECK(!function->shared()->is_compiled()); |
995 // Call foo to get it recompiled. | 997 // Call foo to get it recompiled. |
996 CompileRun("foo()"); | 998 CompileRun("foo()"); |
997 CHECK(function->shared()->is_compiled()); | 999 CHECK(function->shared()->is_compiled()); |
998 } | 1000 } |
OLD | NEW |