| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 #endif | 487 #endif |
| 488 size_t size() override { return blinkPageSize; } | 488 size_t size() override { return blinkPageSize; } |
| 489 static size_t pageHeaderSize() | 489 static size_t pageHeaderSize() |
| 490 { | 490 { |
| 491 // Compute the amount of padding we have to add to a header to make | 491 // Compute the amount of padding we have to add to a header to make |
| 492 // the size of the header plus the padding a multiple of 8 bytes. | 492 // the size of the header plus the padding a multiple of 8 bytes. |
| 493 size_t paddingSize = (sizeof(NormalPage) + allocationGranularity - (size
of(HeapObjectHeader) % allocationGranularity)) % allocationGranularity; | 493 size_t paddingSize = (sizeof(NormalPage) + allocationGranularity - (size
of(HeapObjectHeader) % allocationGranularity)) % allocationGranularity; |
| 494 return sizeof(NormalPage) + paddingSize; | 494 return sizeof(NormalPage) + paddingSize; |
| 495 } | 495 } |
| 496 | 496 |
| 497 NormalPageArena* arenaForNormalPage(); | 497 inline NormalPageArena* arenaForNormalPage() const; |
| 498 | 498 |
| 499 private: | 499 private: |
| 500 HeapObjectHeader* findHeaderFromAddress(Address); | 500 HeapObjectHeader* findHeaderFromAddress(Address); |
| 501 void populateObjectStartBitMap(); | 501 void populateObjectStartBitMap(); |
| 502 | 502 |
| 503 bool m_objectStartBitMapComputed; | 503 bool m_objectStartBitMapComputed; |
| 504 uint8_t m_objectStartBitMap[reservedForObjectBitMap]; | 504 uint8_t m_objectStartBitMap[reservedForObjectBitMap]; |
| 505 }; | 505 }; |
| 506 | 506 |
| 507 // Large allocations are allocated as separate objects and linked in a list. | 507 // Large allocations are allocated as separate objects and linked in a list. |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 Address result = headerAddress + sizeof(HeapObjectHeader); | 918 Address result = headerAddress + sizeof(HeapObjectHeader); |
| 919 ASSERT(!(reinterpret_cast<uintptr_t>(result) & allocationMask)); | 919 ASSERT(!(reinterpret_cast<uintptr_t>(result) & allocationMask)); |
| 920 | 920 |
| 921 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader))
; | 921 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader))
; |
| 922 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); | 922 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); |
| 923 return result; | 923 return result; |
| 924 } | 924 } |
| 925 return outOfLineAllocate(allocationSize, gcInfoIndex); | 925 return outOfLineAllocate(allocationSize, gcInfoIndex); |
| 926 } | 926 } |
| 927 | 927 |
| 928 inline NormalPageArena* NormalPage::arenaForNormalPage() const |
| 929 { |
| 930 return static_cast<NormalPageArena*>(arena()); |
| 931 } |
| 932 |
| 928 } // namespace blink | 933 } // namespace blink |
| 929 | 934 |
| 930 #endif // HeapPage_h | 935 #endif // HeapPage_h |
| OLD | NEW |