| 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 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include <stdlib.h> | 28 #include <stdlib.h> |
| 29 | 29 |
| 30 #include "v8.h" | 30 #include "v8.h" |
| 31 | 31 |
| 32 #include "global-handles.h" | 32 #include "global-handles.h" |
| 33 #include "snapshot.h" | 33 #include "snapshot.h" |
| 34 #include "top.h" | 34 #include "top.h" |
| 35 #include "cctest.h" | 35 #include "cctest.h" |
| 36 | 36 |
| 37 namespace v8 { namespace internal { | |
| 38 DECLARE_bool(gc_global); | |
| 39 DECLARE_bool(always_compact); | |
| 40 } } | |
| 41 | |
| 42 using namespace v8::internal; | 37 using namespace v8::internal; |
| 43 | 38 |
| 44 static v8::Persistent<v8::Context> env; | 39 static v8::Persistent<v8::Context> env; |
| 45 | 40 |
| 46 static void InitializeVM() { | 41 static void InitializeVM() { |
| 47 if (env.IsEmpty()) env = v8::Context::New(); | 42 if (env.IsEmpty()) env = v8::Context::New(); |
| 48 v8::HandleScope scope; | 43 v8::HandleScope scope; |
| 49 env->Enter(); | 44 env->Enter(); |
| 50 } | 45 } |
| 51 | 46 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 GlobalHandles::AddToGroup(reinterpret_cast<void*>(1), g1s1.location()); | 301 GlobalHandles::AddToGroup(reinterpret_cast<void*>(1), g1s1.location()); |
| 307 GlobalHandles::AddToGroup(reinterpret_cast<void*>(1), g1s2.location()); | 302 GlobalHandles::AddToGroup(reinterpret_cast<void*>(1), g1s2.location()); |
| 308 GlobalHandles::AddToGroup(reinterpret_cast<void*>(2), g2s1.location()); | 303 GlobalHandles::AddToGroup(reinterpret_cast<void*>(2), g2s1.location()); |
| 309 GlobalHandles::AddToGroup(reinterpret_cast<void*>(2), g2s2.location()); | 304 GlobalHandles::AddToGroup(reinterpret_cast<void*>(2), g2s2.location()); |
| 310 | 305 |
| 311 CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE)); | 306 CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE)); |
| 312 | 307 |
| 313 // All objects should be gone. 5 global handles in total. | 308 // All objects should be gone. 5 global handles in total. |
| 314 CHECK_EQ(5, NumberOfWeakCalls); | 309 CHECK_EQ(5, NumberOfWeakCalls); |
| 315 } | 310 } |
| OLD | NEW |