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

Side by Side Diff: test/cctest/test-mementos.cc

Issue 1314863003: [heap] More flag cleanup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added more comments 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-log.cc ('k') | test/cctest/test-object-observe.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 TEST(Regress340063) { 56 TEST(Regress340063) {
57 CcTest::InitializeVM(); 57 CcTest::InitializeVM();
58 if (!i::FLAG_allocation_site_pretenuring) return; 58 if (!i::FLAG_allocation_site_pretenuring) return;
59 v8::HandleScope scope(CcTest::isolate()); 59 v8::HandleScope scope(CcTest::isolate());
60 60
61 SetUpNewSpaceWithPoisonedMementoAtTop(); 61 SetUpNewSpaceWithPoisonedMementoAtTop();
62 62
63 // Call GC to see if we can handle a poisonous memento right after the 63 // Call GC to see if we can handle a poisonous memento right after the
64 // current new space top pointer. 64 // current new space top pointer.
65 CcTest::i_isolate()->heap()->CollectAllGarbage( 65 CcTest::i_isolate()->heap()->CollectAllGarbage(
66 Heap::kAbortIncrementalMarkingMask); 66 "Regress340063", Heap::kAbortIncrementalMarkingMask);
67 } 67 }
68 68
69 69
70 TEST(Regress470390) { 70 TEST(Regress470390) {
71 CcTest::InitializeVM(); 71 CcTest::InitializeVM();
72 if (!i::FLAG_allocation_site_pretenuring) return; 72 if (!i::FLAG_allocation_site_pretenuring) return;
73 v8::HandleScope scope(CcTest::isolate()); 73 v8::HandleScope scope(CcTest::isolate());
74 74
75 SetUpNewSpaceWithPoisonedMementoAtTop(); 75 SetUpNewSpaceWithPoisonedMementoAtTop();
76 76
77 // Set the new space limit to be equal to the top. 77 // Set the new space limit to be equal to the top.
78 Address top = CcTest::i_isolate()->heap()->new_space()->top(); 78 Address top = CcTest::i_isolate()->heap()->new_space()->top();
79 *(CcTest::i_isolate()->heap()->new_space()->allocation_limit_address()) = top; 79 *(CcTest::i_isolate()->heap()->new_space()->allocation_limit_address()) = top;
80 80
81 // Call GC to see if we can handle a poisonous memento right after the 81 // Call GC to see if we can handle a poisonous memento right after the
82 // current new space top pointer. 82 // current new space top pointer.
83 CcTest::i_isolate()->heap()->CollectAllGarbage( 83 CcTest::i_isolate()->heap()->CollectAllGarbage(
84 Heap::kAbortIncrementalMarkingMask); 84 "Regress470390", Heap::kAbortIncrementalMarkingMask);
85 } 85 }
86 86
87 87
88 TEST(BadMementoAfterTopForceScavenge) { 88 TEST(BadMementoAfterTopForceScavenge) {
89 CcTest::InitializeVM(); 89 CcTest::InitializeVM();
90 if (!i::FLAG_allocation_site_pretenuring) return; 90 if (!i::FLAG_allocation_site_pretenuring) return;
91 v8::HandleScope scope(CcTest::isolate()); 91 v8::HandleScope scope(CcTest::isolate());
92 92
93 SetUpNewSpaceWithPoisonedMementoAtTop(); 93 SetUpNewSpaceWithPoisonedMementoAtTop();
94 94
95 // Force GC to test the poisoned memento handling 95 // Force GC to test the poisoned memento handling
96 CcTest::i_isolate()->heap()->CollectGarbage(i::NEW_SPACE); 96 CcTest::i_isolate()->heap()->CollectGarbageNewSpace();
97 } 97 }
98 98
99 99
100 TEST(PretenuringCallNew) { 100 TEST(PretenuringCallNew) {
101 CcTest::InitializeVM(); 101 CcTest::InitializeVM();
102 if (!i::FLAG_allocation_site_pretenuring) return; 102 if (!i::FLAG_allocation_site_pretenuring) return;
103 if (!i::FLAG_pretenuring_call_new) return; 103 if (!i::FLAG_pretenuring_call_new) return;
104 if (i::FLAG_always_opt) return; 104 if (i::FLAG_always_opt) return;
105 105
106 v8::HandleScope scope(CcTest::isolate()); 106 v8::HandleScope scope(CcTest::isolate());
(...skipping 23 matching lines...) Expand all
130 AllocationMemento* memento = 130 AllocationMemento* memento =
131 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag); 131 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag);
132 CHECK_EQ(memento->map(), heap->allocation_memento_map()); 132 CHECK_EQ(memento->map(), heap->allocation_memento_map());
133 133
134 // Furthermore, how many mementos did we create? The count should match 134 // Furthermore, how many mementos did we create? The count should match
135 // call_count. Note, that mementos are allocated during the inobject slack 135 // call_count. Note, that mementos are allocated during the inobject slack
136 // tracking phase. 136 // tracking phase.
137 AllocationSite* site = memento->GetAllocationSite(); 137 AllocationSite* site = memento->GetAllocationSite();
138 CHECK_EQ(call_count, site->pretenure_create_count()->value()); 138 CHECK_EQ(call_count, site->pretenure_create_count()->value());
139 } 139 }
OLDNEW
« no previous file with comments | « test/cctest/test-log.cc ('k') | test/cctest/test-object-observe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698