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

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

Issue 2060213002: Revert of Replace all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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-api.h ('k') | test/cctest/test-field-type-tracking.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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 Factory* factory = isolate->factory(); 203 Factory* factory = isolate->factory();
204 204
205 Handle<JSObject> key = factory->NewJSArray(0); 205 Handle<JSObject> key = factory->NewJSArray(0);
206 206
207 // Simulate a full heap so that generating an identity hash code 207 // Simulate a full heap so that generating an identity hash code
208 // in subsequent calls will request GC. 208 // in subsequent calls will request GC.
209 heap::SimulateFullSpace(CcTest::heap()->new_space()); 209 heap::SimulateFullSpace(CcTest::heap()->new_space());
210 heap::SimulateFullSpace(CcTest::heap()->old_space()); 210 heap::SimulateFullSpace(CcTest::heap()->old_space());
211 211
212 // Calling Lookup() should not cause GC ever. 212 // Calling Lookup() should not cause GC ever.
213 CHECK(table->Lookup(key)->IsTheHole(isolate)); 213 CHECK(table->Lookup(key)->IsTheHole());
214 214
215 // Calling Put() should request GC by returning a failure. 215 // Calling Put() should request GC by returning a failure.
216 int gc_count = isolate->heap()->gc_count(); 216 int gc_count = isolate->heap()->gc_count();
217 HashMap::Put(table, key, key); 217 HashMap::Put(table, key, key);
218 CHECK(gc_count < isolate->heap()->gc_count()); 218 CHECK(gc_count < isolate->heap()->gc_count());
219 } 219 }
220 220
221 221
222 TEST(ObjectHashTableCausesGC) { 222 TEST(ObjectHashTableCausesGC) {
223 i::FLAG_stress_compaction = false; 223 i::FLAG_stress_compaction = false;
(...skipping 12 matching lines...) Expand all
236 dict->SetRequiresCopyOnCapacityChange(); 236 dict->SetRequiresCopyOnCapacityChange();
237 Handle<Name> key = isolate->factory()->InternalizeString( 237 Handle<Name> key = isolate->factory()->InternalizeString(
238 v8::Utils::OpenHandle(*v8_str("key"))); 238 v8::Utils::OpenHandle(*v8_str("key")));
239 Handle<Object> value = handle(Smi::FromInt(0), isolate); 239 Handle<Object> value = handle(Smi::FromInt(0), isolate);
240 Handle<NameDictionary> new_dict = 240 Handle<NameDictionary> new_dict =
241 NameDictionary::Add(dict, key, value, PropertyDetails::Empty()); 241 NameDictionary::Add(dict, key, value, PropertyDetails::Empty());
242 CHECK_NE(*dict, *new_dict); 242 CHECK_NE(*dict, *new_dict);
243 } 243 }
244 244
245 } // namespace 245 } // namespace
OLDNEW
« no previous file with comments | « test/cctest/test-api.h ('k') | test/cctest/test-field-type-tracking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698