OLD | NEW |
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 table = HashSet::Add(table, key); | 194 table = HashSet::Add(table, key); |
195 CHECK(gc_count < isolate->heap()->gc_count()); | 195 CHECK(gc_count < isolate->heap()->gc_count()); |
196 } | 196 } |
197 | 197 |
198 | 198 |
199 TEST(ObjectHashSetCausesGC) { | 199 TEST(ObjectHashSetCausesGC) { |
200 i::FLAG_stress_compaction = false; | 200 i::FLAG_stress_compaction = false; |
201 LocalContext context; | 201 LocalContext context; |
202 v8::HandleScope scope(context->GetIsolate()); | 202 v8::HandleScope scope(context->GetIsolate()); |
203 Isolate* isolate = CcTest::i_isolate(); | 203 Isolate* isolate = CcTest::i_isolate(); |
204 TestHashSetCausesGC(isolate->factory()->NewObjectHashSet(1)); | |
205 TestHashSetCausesGC(isolate->factory()->NewOrderedHashSet()); | 204 TestHashSetCausesGC(isolate->factory()->NewOrderedHashSet()); |
206 } | 205 } |
207 #endif | 206 #endif |
208 | 207 |
209 | 208 |
210 #ifdef DEBUG | 209 #ifdef DEBUG |
211 template<class HashMap> | 210 template<class HashMap> |
212 static void TestHashMapCausesGC(Handle<HashMap> table) { | 211 static void TestHashMapCausesGC(Handle<HashMap> table) { |
213 Isolate* isolate = CcTest::i_isolate(); | 212 Isolate* isolate = CcTest::i_isolate(); |
214 Factory* factory = isolate->factory(); | 213 Factory* factory = isolate->factory(); |
(...skipping 26 matching lines...) Expand all Loading... |
241 LocalContext context; | 240 LocalContext context; |
242 v8::HandleScope scope(context->GetIsolate()); | 241 v8::HandleScope scope(context->GetIsolate()); |
243 Isolate* isolate = CcTest::i_isolate(); | 242 Isolate* isolate = CcTest::i_isolate(); |
244 TestHashMapCausesGC(isolate->factory()->NewObjectHashTable(1)); | 243 TestHashMapCausesGC(isolate->factory()->NewObjectHashTable(1)); |
245 TestHashMapCausesGC(isolate->factory()->NewOrderedHashMap()); | 244 TestHashMapCausesGC(isolate->factory()->NewOrderedHashMap()); |
246 } | 245 } |
247 #endif | 246 #endif |
248 | 247 |
249 | 248 |
250 } | 249 } |
OLD | NEW |