| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 LocalContext context2(CcTest::isolate()); | 609 LocalContext context2(CcTest::isolate()); |
| 610 context2->SetSecurityToken(foo); | 610 context2->SetSecurityToken(foo); |
| 611 context2->Global()->Set(String::NewFromUtf8(CcTest::isolate(), "obj"), | 611 context2->Global()->Set(String::NewFromUtf8(CcTest::isolate(), "obj"), |
| 612 instance); | 612 instance); |
| 613 CHECK(CompileRun("Object.getNotifier(obj)")->IsObject()); | 613 CHECK(CompileRun("Object.getNotifier(obj)")->IsObject()); |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 | 617 |
| 618 static int GetGlobalObjectsCount() { | 618 static int GetGlobalObjectsCount() { |
| 619 CcTest::heap()->EnsureHeapIsIterable(); | 619 CcTest::heap()->MakeHeapIterable(); |
| 620 int count = 0; | 620 int count = 0; |
| 621 i::HeapIterator it(CcTest::heap()); | 621 i::HeapIterator it(CcTest::heap()); |
| 622 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) | 622 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) |
| 623 if (object->IsJSGlobalObject()) count++; | 623 if (object->IsJSGlobalObject()) count++; |
| 624 return count; | 624 return count; |
| 625 } | 625 } |
| 626 | 626 |
| 627 | 627 |
| 628 static void CheckSurvivingGlobalObjectsCount(int expected) { | 628 static void CheckSurvivingGlobalObjectsCount(int expected) { |
| 629 // We need to collect all garbage twice to be sure that everything | 629 // We need to collect all garbage twice to be sure that everything |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 notifier); | 703 notifier); |
| 704 CompileRun("var obj2 = {};" | 704 CompileRun("var obj2 = {};" |
| 705 "var notifier2 = Object.getNotifier(obj2);" | 705 "var notifier2 = Object.getNotifier(obj2);" |
| 706 "notifier2.performChange.call(" | 706 "notifier2.performChange.call(" |
| 707 "notifier, 'foo', function(){})"); | 707 "notifier, 'foo', function(){})"); |
| 708 } | 708 } |
| 709 | 709 |
| 710 v8::V8::ContextDisposedNotification(); | 710 v8::V8::ContextDisposedNotification(); |
| 711 CheckSurvivingGlobalObjectsCount(1); | 711 CheckSurvivingGlobalObjectsCount(1); |
| 712 } | 712 } |
| OLD | NEW |