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

Unified Diff: src/heap/spaces.cc

Issue 1460063006: [heap] report allocated object to the inline-allocation-observers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix comments Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/spaces.h ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 52ebde844f8af97ce6b578381d47569fe0fcc909..5a1ac65a2c7d4948ea426c7afd9afeafef603ac2 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1499,7 +1499,7 @@ void NewSpace::ResetAllocationInfo() {
while (it.has_next()) {
Bitmap::Clear(it.next());
}
- InlineAllocationStep(old_top, allocation_info_.top());
+ InlineAllocationStep(old_top, allocation_info_.top(), nullptr, 0);
}
@@ -1579,7 +1579,7 @@ bool NewSpace::EnsureAllocation(int size_in_bytes,
return false;
}
- InlineAllocationStep(old_top, allocation_info_.top());
+ InlineAllocationStep(old_top, allocation_info_.top(), nullptr, 0);
old_top = allocation_info_.top();
high = to_space_.page_high();
@@ -1595,7 +1595,8 @@ bool NewSpace::EnsureAllocation(int size_in_bytes,
// or because idle scavenge job wants to get a chance to post a task.
// Set the new limit accordingly.
Address new_top = old_top + aligned_size_in_bytes;
- InlineAllocationStep(new_top, new_top);
+ Address soon_object = old_top + filler_size;
+ InlineAllocationStep(new_top, new_top, soon_object, size_in_bytes);
UpdateInlineAllocationLimit(aligned_size_in_bytes);
}
return true;
@@ -1640,7 +1641,7 @@ void NewSpace::RemoveInlineAllocationObserver(
void NewSpace::PauseInlineAllocationObservers() {
// Do a step to account for memory allocated so far.
- InlineAllocationStep(top(), top());
+ InlineAllocationStep(top(), top(), nullptr, 0);
inline_allocation_observers_paused_ = true;
top_on_previous_step_ = 0;
UpdateInlineAllocationLimit(0);
@@ -1654,11 +1655,13 @@ void NewSpace::ResumeInlineAllocationObservers() {
}
-void NewSpace::InlineAllocationStep(Address top, Address new_top) {
+void NewSpace::InlineAllocationStep(Address top, Address new_top,
+ Address soon_object, size_t size) {
if (top_on_previous_step_) {
int bytes_allocated = static_cast<int>(top - top_on_previous_step_);
for (int i = 0; i < inline_allocation_observers_.length(); ++i) {
- inline_allocation_observers_[i]->InlineAllocationStep(bytes_allocated);
+ inline_allocation_observers_[i]->InlineAllocationStep(bytes_allocated,
+ soon_object, size);
}
top_on_previous_step_ = new_top;
}
« no previous file with comments | « src/heap/spaces.h ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698