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

Side by Side Diff: src/objects-debug.cc

Issue 1780001: Clean JS function results cache on each major GC. (Closed)
Patch Set: Reoworking the test Created 10 years, 7 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 | « src/objects.h ('k') | src/objects-inl.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 if (hash < current) { 1321 if (hash < current) {
1322 PrintDescriptors(); 1322 PrintDescriptors();
1323 return false; 1323 return false;
1324 } 1324 }
1325 current = hash; 1325 current = hash;
1326 } 1326 }
1327 return true; 1327 return true;
1328 } 1328 }
1329 1329
1330 1330
1331 void JSFunctionResultCache::JSFunctionResultCacheVerify() {
1332 JSFunction::cast(get(kFactoryIndex))->Verify();
1333
1334 int size = Smi::cast(get(kCacheSizeIndex))->value();
1335 ASSERT(kEntriesIndex <= size);
1336 ASSERT(size <= length());
1337 ASSERT_EQ(0, size % kEntrySize);
1338
1339 int finger = Smi::cast(get(kFingerIndex))->value();
1340 ASSERT(kEntriesIndex <= finger);
1341 ASSERT(finger < size || finger == kEntriesIndex);
1342 ASSERT_EQ(0, finger % kEntrySize);
1343
1344 if (FLAG_enable_slow_asserts) {
1345 for (int i = kEntriesIndex; i < size; i++) {
1346 ASSERT(!get(i)->IsTheHole());
1347 get(i)->Verify();
1348 }
1349 for (int i = size; i < length(); i++) {
1350 ASSERT(get(i)->IsTheHole());
1351 get(i)->Verify();
1352 }
1353 }
1354 }
1355
1356
1331 #endif // DEBUG 1357 #endif // DEBUG
1332 1358
1333 } } // namespace v8::internal 1359 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698