Commit bf521632 authored by hpayer's avatar hpayer Committed by Commit bot

Tenure long-living descriptor arrays.

BUG=chromium:580971
LOG=n

Review URL: https://codereview.chromium.org/1681533003

Cr-Commit-Position: refs/heads/master@{#33840}
parent b881c908
......@@ -5710,7 +5710,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
// Allocate the instance descriptor.
Handle<DescriptorArray> descriptors = DescriptorArray::Allocate(
isolate, instance_descriptor_length);
isolate, instance_descriptor_length, 0, TENURED);
int number_of_allocated_fields =
number_of_fields + unused_property_fields - inobject_props;
......@@ -10914,17 +10914,18 @@ Handle<ArrayList> ArrayList::EnsureSpace(Handle<ArrayList> array, int length) {
return array;
}
Handle<DescriptorArray> DescriptorArray::Allocate(Isolate* isolate,
int number_of_descriptors,
int slack) {
int slack,
PretenureFlag pretenure) {
DCHECK(0 <= number_of_descriptors);
Factory* factory = isolate->factory();
// Do not use DescriptorArray::cast on incomplete object.
int size = number_of_descriptors + slack;
if (size == 0) return factory->empty_descriptor_array();
// Allocate the array of keys.
Handle<FixedArray> result = factory->NewFixedArray(LengthFor(size));
Handle<FixedArray> result =
factory->NewFixedArray(LengthFor(size), pretenure);
result->set(kDescriptorLengthIndex, Smi::FromInt(number_of_descriptors));
result->set(kEnumCacheIndex, Smi::FromInt(0));
......
......@@ -2983,9 +2983,9 @@ class DescriptorArray: public FixedArray {
// Allocates a DescriptorArray, but returns the singleton
// empty descriptor array object if number_of_descriptors is 0.
static Handle<DescriptorArray> Allocate(Isolate* isolate,
int number_of_descriptors,
int slack = 0);
static Handle<DescriptorArray> Allocate(
Isolate* isolate, int number_of_descriptors, int slack,
PretenureFlag pretenure = NOT_TENURED);
DECLARE_CAST(DescriptorArray)
......
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