Chromium Code Reviews| Index: src/heap/spaces.h |
| diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
| index 1aaa36baf6715bcf6f8ddab532e515f7680eca5b..6690c03d4e21da8b548da4b691866f02ce236568 100644 |
| --- a/src/heap/spaces.h |
| +++ b/src/heap/spaces.h |
| @@ -2523,16 +2523,28 @@ class InlineAllocationObserver { |
| intptr_t bytes_to_next_step() const { return bytes_to_next_step_; } |
| // Pure virtual method provided by the subclasses that gets called when at |
| - // least step_size bytes have been allocated. |
| - virtual void Step(int bytes_allocated) = 0; |
| + // least step_size bytes have been allocated. soon_object is the address just |
| + // allocated (but not yet initialized.) size is the size of the object as |
| + // requested (i.e. w/o the alignment fillers). Some complexities to be aware |
| + // of: |
| + // 1) soon_object will be nullptr in cases where we end up observing an |
|
Hannes Payer (out of office)
2015/11/24 10:56:09
-an
ofrobots
2015/11/24 13:04:29
Done.
|
| + // an allocation that happens to be filler space (e.g. page boundaries.) |
|
Hannes Payer (out of office)
2015/11/24 10:56:09
a filler
ofrobots
2015/11/24 13:04:29
Done.
|
| + // 2) size is the requested size at the time of allocation. Right-trimming |
| + // may change the object size dynamically. |
| + // 3) soon_object may actually be the first object in an allocation-folding |
| + // group. In such a case size is the size of the group rather than the |
| + // first object. |
| + virtual void Step(int bytes_allocated, Address soon_object, size_t size) = 0; |
| // Called each time the new space does an inline allocation step. This may be |
| // more frequently than the step_size we are monitoring (e.g. when there are |
| // multiple observers, or when page or space boundary is encountered.) |
| - void InlineAllocationStep(int bytes_allocated) { |
| + void InlineAllocationStep(int bytes_allocated, Address soon_object, |
| + size_t size) { |
| bytes_to_next_step_ -= bytes_allocated; |
| if (bytes_to_next_step_ <= 0) { |
| - Step(static_cast<int>(step_size_ - bytes_to_next_step_)); |
| + Step(static_cast<int>(step_size_ - bytes_to_next_step_), soon_object, |
| + size); |
| bytes_to_next_step_ = step_size_; |
| } |
| } |
| @@ -2863,7 +2875,8 @@ class NewSpace : public Space { |
| // allocated since the last step.) new_top is the address of the bump pointer |
| // where the next byte is going to be allocated from. top and new_top may be |
| // different when we cross a page boundary or reset the space. |
| - void InlineAllocationStep(Address top, Address new_top); |
| + void InlineAllocationStep(Address top, Address new_top, Address soon_object, |
| + size_t size); |
| intptr_t GetNextInlineAllocationStepSize(); |
| void StartNextInlineAllocationStep(); |