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

Side by Side Diff: Source/platform/heap/Heap.h

Issue 1315603005: Oilpan: Disable sized heap Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // require prompt finalization after a garbage collection. That is, their 395 // require prompt finalization after a garbage collection. That is, their
396 // instances have to be finalized early and cannot be delayed until lazy 396 // instances have to be finalized early and cannot be delayed until lazy
397 // sweeping kicks in for their heap and page. The EAGERLY_FINALIZE() 397 // sweeping kicks in for their heap and page. The EAGERLY_FINALIZE()
398 // macro is used to declare a class (and its derived classes) as being 398 // macro is used to declare a class (and its derived classes) as being
399 // in need of eager finalization. Must be defined with 'public' visibility 399 // in need of eager finalization. Must be defined with 'public' visibility
400 // for a class. 400 // for a class.
401 // 401 //
402 402
403 inline int Heap::heapIndexForObjectSize(size_t size) 403 inline int Heap::heapIndexForObjectSize(size_t size)
404 { 404 {
405 /*
405 if (size < 64) { 406 if (size < 64) {
406 if (size < 32) 407 if (size < 32)
407 return ThreadState::NormalPage1HeapIndex; 408 return ThreadState::NormalPage1HeapIndex;
408 return ThreadState::NormalPage2HeapIndex; 409 return ThreadState::NormalPage2HeapIndex;
409 } 410 }
410 if (size < 128) 411 if (size < 128)
411 return ThreadState::NormalPage3HeapIndex; 412 return ThreadState::NormalPage3HeapIndex;
412 return ThreadState::NormalPage4HeapIndex; 413 return ThreadState::NormalPage4HeapIndex;
414 */
415 return ThreadState::NormalPage1HeapIndex;
413 } 416 }
414 417
415 inline bool Heap::isNormalHeapIndex(int index) 418 inline bool Heap::isNormalHeapIndex(int index)
416 { 419 {
417 return index >= ThreadState::NormalPage1HeapIndex && index <= ThreadState::N ormalPage4HeapIndex; 420 return index >= ThreadState::NormalPage1HeapIndex && index <= ThreadState::N ormalPage4HeapIndex;
418 } 421 }
419 422
420 #define DECLARE_EAGER_FINALIZATION_OPERATOR_NEW() \ 423 #define DECLARE_EAGER_FINALIZATION_OPERATOR_NEW() \
421 public: \ 424 public: \
422 GC_PLUGIN_IGNORE("491488") \ 425 GC_PLUGIN_IGNORE("491488") \
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) 513 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object)
511 { 514 {
512 T** cell = reinterpret_cast<T**>(object); 515 T** cell = reinterpret_cast<T**>(object);
513 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 516 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
514 *cell = nullptr; 517 *cell = nullptr;
515 } 518 }
516 519
517 } // namespace blink 520 } // namespace blink
518 521
519 #endif // Heap_h 522 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698