| 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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 count++; | 1003 count++; |
| 1004 object = JSFunction::cast(object)->next_function_link(); | 1004 object = JSFunction::cast(object)->next_function_link(); |
| 1005 } | 1005 } |
| 1006 return count; | 1006 return count; |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 | 1009 |
| 1010 TEST(TestInternalWeakLists) { | 1010 TEST(TestInternalWeakLists) { |
| 1011 v8::V8::Initialize(); | 1011 v8::V8::Initialize(); |
| 1012 | 1012 |
| 1013 // Be deterministic. |
| 1014 i::FLAG_optimize_in_parallel = false; |
| 1015 |
| 1013 static const int kNumTestContexts = 10; | 1016 static const int kNumTestContexts = 10; |
| 1014 | 1017 |
| 1015 v8::HandleScope scope; | 1018 v8::HandleScope scope; |
| 1016 v8::Persistent<v8::Context> ctx[kNumTestContexts]; | 1019 v8::Persistent<v8::Context> ctx[kNumTestContexts]; |
| 1017 | 1020 |
| 1018 CHECK_EQ(0, CountGlobalContexts()); | 1021 CHECK_EQ(0, CountGlobalContexts()); |
| 1019 | 1022 |
| 1020 // Create a number of global contests which gets linked together. | 1023 // Create a number of global contests which gets linked together. |
| 1021 for (int i = 0; i < kNumTestContexts; i++) { | 1024 for (int i = 0; i < kNumTestContexts; i++) { |
| 1022 ctx[i] = v8::Context::New(); | 1025 ctx[i] = v8::Context::New(); |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1785 CHECK(marking->IsComplete()); | 1788 CHECK(marking->IsComplete()); |
| 1786 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 1789 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| 1787 CHECK(marking->IsStopped()); | 1790 CHECK(marking->IsStopped()); |
| 1788 | 1791 |
| 1789 // Count number of live transitions after marking. Note that one transition | 1792 // Count number of live transitions after marking. Note that one transition |
| 1790 // is left, because 'o' still holds an instance of one transition target. | 1793 // is left, because 'o' still holds an instance of one transition target. |
| 1791 int transitions_after = CountMapTransitions(root->map()); | 1794 int transitions_after = CountMapTransitions(root->map()); |
| 1792 CompileRun("%DebugPrint(root);"); | 1795 CompileRun("%DebugPrint(root);"); |
| 1793 CHECK_EQ(1, transitions_after); | 1796 CHECK_EQ(1, transitions_after); |
| 1794 } | 1797 } |
| OLD | NEW |