OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |