Commit 19d89456 authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[baseline] Remove UndoLastAllocationAt

It seems like SP on heap does not produce too much memory fragmentation,
therefore we do not need UndoLastAllocationAt.

Bug: v8:11872
Change-Id: Id2e44405329b52c1dcd6cd81bfc72ffba00035ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3129428
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76581}
parent ae7aa0ad
......@@ -313,7 +313,8 @@ void Factory::CodeBuilder::FinalizeOnHeapCode(Handle<Code> code,
Code::SizeFor(code_desc_.instruction_size() + code_desc_.metadata_size());
int size_to_trim = old_object_size - new_object_size;
DCHECK_GE(size_to_trim, 0);
heap->UndoLastAllocationAt(code->address() + new_object_size, size_to_trim);
heap->CreateFillerObjectAt(code->address() + new_object_size, size_to_trim,
ClearRecordedSlots::kNo);
}
MaybeHandle<Code> Factory::NewEmptyCode(CodeKind kind, int buffer_size) {
......
......@@ -3469,15 +3469,6 @@ void Heap::RightTrimWeakFixedArray(WeakFixedArray object,
elements_to_trim * kTaggedSize);
}
void Heap::UndoLastAllocationAt(Address addr, int size) {
DCHECK_LE(0, size);
if (size == 0) return;
if (code_space_->TryFreeLast(addr, size)) {
return;
}
CreateFillerObjectAt(addr, size, ClearRecordedSlots::kNo);
}
template <typename T>
void Heap::CreateFillerForArray(T object, int elements_to_trim,
int bytes_to_trim) {
......
......@@ -579,8 +579,6 @@ class Heap {
int elements_to_trim);
void RightTrimWeakFixedArray(WeakFixedArray obj, int elements_to_trim);
void UndoLastAllocationAt(Address addr, int size);
// Converts the given boolean condition to JavaScript boolean value.
inline Oddball ToBoolean(bool condition);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment