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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 TEST(ObjectHashTableCausesGC) { | 222 TEST(ObjectHashTableCausesGC) { |
223 i::FLAG_stress_compaction = false; | 223 i::FLAG_stress_compaction = false; |
224 LocalContext context; | 224 LocalContext context; |
225 v8::HandleScope scope(context->GetIsolate()); | 225 v8::HandleScope scope(context->GetIsolate()); |
226 Isolate* isolate = CcTest::i_isolate(); | 226 Isolate* isolate = CcTest::i_isolate(); |
227 TestHashMapCausesGC(ObjectHashTable::New(isolate, 1)); | 227 TestHashMapCausesGC(ObjectHashTable::New(isolate, 1)); |
228 } | 228 } |
229 #endif | 229 #endif |
230 | 230 |
| 231 TEST(SetRequiresCopyOnCapacityChange) { |
| 232 LocalContext context; |
| 233 v8::HandleScope scope(context->GetIsolate()); |
| 234 Isolate* isolate = CcTest::i_isolate(); |
| 235 Handle<NameDictionary> dict = NameDictionary::New(isolate, 0, TENURED); |
| 236 dict->SetRequiresCopyOnCapacityChange(); |
| 237 Handle<Name> key = isolate->factory()->InternalizeString( |
| 238 v8::Utils::OpenHandle(*v8_str("key"))); |
| 239 Handle<Object> value = handle(Smi::FromInt(0), isolate); |
| 240 Handle<NameDictionary> new_dict = |
| 241 NameDictionary::Add(dict, key, value, PropertyDetails::Empty()); |
| 242 CHECK_NE(*dict, *new_dict); |
| 243 } |
| 244 |
231 } // namespace | 245 } // namespace |
OLD | NEW |