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

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

Issue 236203010: Don't run tests that rely on compaction when compaction is turned off. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-weaksets.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 32, ObjectHashTable::cast(weakmap->table())->NumberOfDeletedElements()); 173 32, ObjectHashTable::cast(weakmap->table())->NumberOfDeletedElements());
174 174
175 // Check shrunk capacity. 175 // Check shrunk capacity.
176 CHECK_EQ(32, ObjectHashTable::cast(weakmap->table())->Capacity()); 176 CHECK_EQ(32, ObjectHashTable::cast(weakmap->table())->Capacity());
177 } 177 }
178 178
179 179
180 // Test that weak map values on an evacuation candidate which are not reachable 180 // Test that weak map values on an evacuation candidate which are not reachable
181 // by other paths are correctly recorded in the slots buffer. 181 // by other paths are correctly recorded in the slots buffer.
182 TEST(Regress2060a) { 182 TEST(Regress2060a) {
183 if (i::FLAG_never_compact) return;
183 FLAG_always_compact = true; 184 FLAG_always_compact = true;
184 LocalContext context; 185 LocalContext context;
185 Isolate* isolate = GetIsolateFrom(&context); 186 Isolate* isolate = GetIsolateFrom(&context);
186 Factory* factory = isolate->factory(); 187 Factory* factory = isolate->factory();
187 Heap* heap = isolate->heap(); 188 Heap* heap = isolate->heap();
188 HandleScope scope(isolate); 189 HandleScope scope(isolate);
189 Handle<JSFunction> function = 190 Handle<JSFunction> function =
190 factory->NewFunction(factory->function_string(), factory->null_value()); 191 factory->NewFunction(factory->function_string(), factory->null_value());
191 Handle<JSObject> key = factory->NewJSObject(function); 192 Handle<JSObject> key = factory->NewJSObject(function);
192 Handle<JSWeakMap> weakmap = AllocateJSWeakMap(isolate); 193 Handle<JSWeakMap> weakmap = AllocateJSWeakMap(isolate);
(...skipping 15 matching lines...) Expand all
208 209
209 // Force compacting garbage collection. 210 // Force compacting garbage collection.
210 CHECK(FLAG_always_compact); 211 CHECK(FLAG_always_compact);
211 heap->CollectAllGarbage(Heap::kNoGCFlags); 212 heap->CollectAllGarbage(Heap::kNoGCFlags);
212 } 213 }
213 214
214 215
215 // Test that weak map keys on an evacuation candidate which are reachable by 216 // Test that weak map keys on an evacuation candidate which are reachable by
216 // other strong paths are correctly recorded in the slots buffer. 217 // other strong paths are correctly recorded in the slots buffer.
217 TEST(Regress2060b) { 218 TEST(Regress2060b) {
219 if (i::FLAG_never_compact) return;
218 FLAG_always_compact = true; 220 FLAG_always_compact = true;
219 #ifdef VERIFY_HEAP 221 #ifdef VERIFY_HEAP
220 FLAG_verify_heap = true; 222 FLAG_verify_heap = true;
221 #endif 223 #endif
222 224
223 LocalContext context; 225 LocalContext context;
224 Isolate* isolate = GetIsolateFrom(&context); 226 Isolate* isolate = GetIsolateFrom(&context);
225 Factory* factory = isolate->factory(); 227 Factory* factory = isolate->factory();
226 Heap* heap = isolate->heap(); 228 Heap* heap = isolate->heap();
227 HandleScope scope(isolate); 229 HandleScope scope(isolate);
(...skipping 18 matching lines...) Expand all
246 Handle<Smi>(Smi::FromInt(i), isolate)); 248 Handle<Smi>(Smi::FromInt(i), isolate));
247 } 249 }
248 250
249 // Force compacting garbage collection. The subsequent collections are used 251 // Force compacting garbage collection. The subsequent collections are used
250 // to verify that key references were actually updated. 252 // to verify that key references were actually updated.
251 CHECK(FLAG_always_compact); 253 CHECK(FLAG_always_compact);
252 heap->CollectAllGarbage(Heap::kNoGCFlags); 254 heap->CollectAllGarbage(Heap::kNoGCFlags);
253 heap->CollectAllGarbage(Heap::kNoGCFlags); 255 heap->CollectAllGarbage(Heap::kNoGCFlags);
254 heap->CollectAllGarbage(Heap::kNoGCFlags); 256 heap->CollectAllGarbage(Heap::kNoGCFlags);
255 } 257 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698