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