Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: test/cctest/test-object-observe.cc

Issue 1303393004: Revert of [heap] More flag cleanup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-mementos.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 } 676 }
677 677
678 678
679 static void CheckSurvivingGlobalObjectsCount(int expected) { 679 static void CheckSurvivingGlobalObjectsCount(int expected) {
680 // We need to collect all garbage twice to be sure that everything 680 // We need to collect all garbage twice to be sure that everything
681 // has been collected. This is because inline caches are cleared in 681 // has been collected. This is because inline caches are cleared in
682 // the first garbage collection but some of the maps have already 682 // the first garbage collection but some of the maps have already
683 // been marked at that point. Therefore some of the maps are not 683 // been marked at that point. Therefore some of the maps are not
684 // collected until the second garbage collection. 684 // collected until the second garbage collection.
685 CcTest::heap()->CollectAllGarbage(); 685 CcTest::heap()->CollectAllGarbage();
686 CcTest::heap()->CollectAllGarbage("CheckSurvivingGlobalObjectsCount", 686 CcTest::heap()->CollectAllGarbage(i::Heap::kMakeHeapIterableMask);
687 i::Heap::kMakeHeapIterableMask);
688 int count = GetGlobalObjectsCount(); 687 int count = GetGlobalObjectsCount();
689 #ifdef DEBUG 688 #ifdef DEBUG
690 if (count != expected) CcTest::heap()->TracePathToGlobal(); 689 if (count != expected) CcTest::heap()->TracePathToGlobal();
691 #endif 690 #endif
692 CHECK_EQ(expected, count); 691 CHECK_EQ(expected, count);
693 } 692 }
694 693
695 694
696 TEST(DontLeakContextOnObserve) { 695 TEST(DontLeakContextOnObserve) {
697 HandleScope scope(CcTest::isolate()); 696 HandleScope scope(CcTest::isolate());
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 i::Isolate* isolate = CcTest::i_isolate(); 878 i::Isolate* isolate = CcTest::i_isolate();
880 i::HandleScope scope(isolate); 879 i::HandleScope scope(isolate);
881 LocalContext env; 880 LocalContext env;
882 int use_counts[v8::Isolate::kUseCounterFeatureCount] = {}; 881 int use_counts[v8::Isolate::kUseCounterFeatureCount] = {};
883 global_use_counts = use_counts; 882 global_use_counts = use_counts;
884 CcTest::isolate()->SetUseCounterCallback(MockUseCounterCallback); 883 CcTest::isolate()->SetUseCounterCallback(MockUseCounterCallback);
885 CompileRun("var obj = {}"); 884 CompileRun("var obj = {}");
886 CompileRun("Object.getNotifier(obj)"); 885 CompileRun("Object.getNotifier(obj)");
887 CHECK_EQ(1, use_counts[v8::Isolate::kObjectObserve]); 886 CHECK_EQ(1, use_counts[v8::Isolate::kObjectObserve]);
888 } 887 }
OLDNEW
« no previous file with comments | « test/cctest/test-mementos.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698