Commit 492a3294 authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

[heap] Pretenure allocations during isolate initialization

A couple of allocation were still going to new space. Since objects
allocated during isolate initialization are long living anyway, we
should pretenure them.

This also untangles preallocating pages in the paged new space.

Bug: v8:12612
Change-Id: Ib63ff4445930afa5969464e6adaef85b314e95ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3782802Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81903}
parent 11de0762
......@@ -1496,8 +1496,9 @@ Handle<ErrorStackData> Factory::NewErrorStackData(
void Factory::AddToScriptList(Handle<Script> script) {
Handle<WeakArrayList> scripts = script_list();
scripts = WeakArrayList::Append(isolate(), scripts,
MaybeObjectHandle::Weak(script));
scripts =
WeakArrayList::Append(isolate(), scripts, MaybeObjectHandle::Weak(script),
AllocationType::kOld);
isolate()->heap()->set_script_list(*scripts);
}
......
......@@ -1327,8 +1327,8 @@ bool Object::ToInt32(int32_t* value) {
// static
Handle<TemplateList> TemplateList::New(Isolate* isolate, int size) {
Handle<FixedArray> list =
isolate->factory()->NewFixedArray(kLengthIndex + size);
Handle<FixedArray> list = isolate->factory()->NewFixedArray(
kLengthIndex + size, AllocationType::kOld);
list->set(kLengthIndex, Smi::zero());
return Handle<TemplateList>::cast(list);
}
......
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