Commit 799dfad5 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Prepare bottleneck for setting instance descriptors.

This refactors Map operations to update the instance descriptors and
the number of own descriptors via the SetInstanceDescriptors bottleneck.
This will allow us to add a special marking barrier for these updates.

Bug: v8:8486
Change-Id: Ie9c746d4bcdd6166d38402622734693fa59faf21
Reviewed-on: https://chromium-review.googlesource.com/c/1354883Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57934}
parent 11e45684
This diff is collapsed.
......@@ -1974,7 +1974,7 @@ Map Factory::InitializeMap(Map map, InstanceType type, int instance_size,
SKIP_WRITE_BARRIER);
map->set_raw_transitions(MaybeObject::FromSmi(Smi::zero()));
map->SetInObjectUnusedPropertyFields(inobject_properties);
map->set_instance_descriptors(*empty_descriptor_array());
map->SetInstanceDescriptors(isolate(), *empty_descriptor_array(), 0);
if (FLAG_unbox_double_fields) {
map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
}
......@@ -4056,7 +4056,7 @@ Handle<Map> Factory::CreateSloppyFunctionMap(
{ // Add length accessor.
Descriptor d = Descriptor::AccessorConstant(
length_string(), function_length_accessor(), roc_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
STATIC_ASSERT(JSFunction::kNameDescriptorIndex == 1);
......@@ -4065,23 +4065,23 @@ Handle<Map> Factory::CreateSloppyFunctionMap(
Handle<Name> name = isolate()->factory()->name_string();
Descriptor d = Descriptor::DataField(isolate(), name, field_index++,
roc_attribs, Representation::Tagged());
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
} else {
// Add name accessor.
Descriptor d = Descriptor::AccessorConstant(
name_string(), function_name_accessor(), roc_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
{ // Add arguments accessor.
Descriptor d = Descriptor::AccessorConstant(
arguments_string(), function_arguments_accessor(), ro_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
{ // Add caller accessor.
Descriptor d = Descriptor::AccessorConstant(
caller_string(), function_caller_accessor(), ro_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
if (IsFunctionModeWithPrototype(function_mode)) {
// Add prototype accessor.
......@@ -4090,7 +4090,7 @@ Handle<Map> Factory::CreateSloppyFunctionMap(
: ro_attribs;
Descriptor d = Descriptor::AccessorConstant(
prototype_string(), function_prototype_accessor(), attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
DCHECK_EQ(inobject_properties_count, field_index);
LOG(isolate(), MapDetails(*map));
......@@ -4133,7 +4133,7 @@ Handle<Map> Factory::CreateStrictFunctionMap(
{ // Add length accessor.
Descriptor d = Descriptor::AccessorConstant(
length_string(), function_length_accessor(), roc_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
STATIC_ASSERT(JSFunction::kNameDescriptorIndex == 1);
......@@ -4142,13 +4142,13 @@ Handle<Map> Factory::CreateStrictFunctionMap(
Handle<Name> name = isolate()->factory()->name_string();
Descriptor d = Descriptor::DataField(isolate(), name, field_index++,
roc_attribs, Representation::Tagged());
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
} else {
// Add name accessor.
Descriptor d = Descriptor::AccessorConstant(
name_string(), function_name_accessor(), roc_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
STATIC_ASSERT(JSFunction::kMaybeHomeObjectDescriptorIndex == 2);
......@@ -4157,7 +4157,7 @@ Handle<Map> Factory::CreateStrictFunctionMap(
Handle<Name> name = isolate()->factory()->home_object_symbol();
Descriptor d = Descriptor::DataField(isolate(), name, field_index++,
DONT_ENUM, Representation::Tagged());
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
if (IsFunctionModeWithPrototype(function_mode)) {
......@@ -4167,7 +4167,7 @@ Handle<Map> Factory::CreateStrictFunctionMap(
: ro_attribs;
Descriptor d = Descriptor::AccessorConstant(
prototype_string(), function_prototype_accessor(), attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
DCHECK_EQ(inobject_properties_count, field_index);
LOG(isolate(), MapDetails(*map));
......@@ -4196,14 +4196,14 @@ Handle<Map> Factory::CreateClassFunctionMap(Handle<JSFunction> empty_function) {
{ // Add length accessor.
Descriptor d = Descriptor::AccessorConstant(
length_string(), function_length_accessor(), roc_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
{
// Add prototype accessor.
Descriptor d = Descriptor::AccessorConstant(
prototype_string(), function_prototype_accessor(), ro_attribs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate(), &d);
}
LOG(isolate(), MapDetails(*map));
return map;
......
......@@ -154,7 +154,7 @@ void Heap::FinalizePartialMap(Map map) {
ReadOnlyRoots roots(this);
map->set_dependent_code(DependentCode::cast(roots.empty_weak_fixed_array()));
map->set_raw_transitions(MaybeObject::FromSmi(Smi::zero()));
map->set_instance_descriptors(roots.empty_descriptor_array());
map->SetInstanceDescriptors(isolate(), roots.empty_descriptor_array(), 0);
if (FLAG_unbox_double_fields) {
map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
}
......
......@@ -2523,7 +2523,7 @@ static Handle<Map> FastCloneObjectMap(Isolate* isolate,
isolate, source_descriptors, size, slack);
Handle<LayoutDescriptor> layout =
LayoutDescriptor::New(isolate, map, descriptors, size);
map->InitializeDescriptors(*descriptors, *layout);
map->InitializeDescriptors(isolate, *descriptors, *layout);
map->CopyUnusedPropertyFieldsAdjustedForInstanceSize(*source_map);
// Update bitfields
......
......@@ -4788,7 +4788,8 @@ void Map::ReplaceDescriptors(Isolate* isolate, DescriptorArray new_descriptors,
Object* next = current->GetBackPointer();
if (next->IsUndefined(isolate)) break; // Stop overwriting at initial map.
current->SetEnumLength(kInvalidEnumCacheSentinel);
current->UpdateDescriptors(new_descriptors, new_layout_descriptor);
current->UpdateDescriptors(isolate, new_descriptors, new_layout_descriptor,
current->NumberOfOwnDescriptors());
current = Map::cast(next);
}
set_owns_descriptors(false);
......@@ -5597,7 +5598,8 @@ void Map::EnsureDescriptorSlack(Isolate* isolate, Handle<Map> map, int slack) {
LayoutDescriptor layout_descriptor = map->GetLayoutDescriptor();
if (old_size == 0) {
map->UpdateDescriptors(*new_descriptors, layout_descriptor);
map->UpdateDescriptors(isolate, *new_descriptors, layout_descriptor,
map->NumberOfOwnDescriptors());
return;
}
......@@ -5617,10 +5619,12 @@ void Map::EnsureDescriptorSlack(Isolate* isolate, Handle<Map> map, int slack) {
while (current->instance_descriptors() == *descriptors) {
Object* next = current->GetBackPointer();
if (next->IsUndefined(isolate)) break; // Stop overwriting at initial map.
current->UpdateDescriptors(*new_descriptors, layout_descriptor);
current->UpdateDescriptors(isolate, *new_descriptors, layout_descriptor,
current->NumberOfOwnDescriptors());
current = Map::cast(next);
}
map->UpdateDescriptors(*new_descriptors, layout_descriptor);
map->UpdateDescriptors(isolate, *new_descriptors, layout_descriptor,
map->NumberOfOwnDescriptors());
}
// static
......@@ -6777,7 +6781,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
isolate, new_map, descriptors, descriptors->number_of_descriptors());
DisallowHeapAllocation no_gc;
new_map->InitializeDescriptors(*descriptors, *layout_descriptor);
new_map->InitializeDescriptors(isolate, *descriptors, *layout_descriptor);
if (number_of_allocated_fields == 0) {
new_map->SetInObjectUnusedPropertyFields(unused_property_fields);
} else {
......@@ -9509,9 +9513,9 @@ Handle<Map> Map::CopyInitialMap(Isolate* isolate, Handle<Map> map,
int number_of_own_descriptors = map->NumberOfOwnDescriptors();
if (number_of_own_descriptors > 0) {
// The copy will use the same descriptors array.
result->UpdateDescriptors(map->instance_descriptors(),
map->GetLayoutDescriptor());
result->SetNumberOfOwnDescriptors(number_of_own_descriptors);
result->UpdateDescriptors(isolate, map->instance_descriptors(),
map->GetLayoutDescriptor(),
number_of_own_descriptors);
DCHECK_EQ(result->NumberOfFields(),
result->GetInObjectProperties() - result->UnusedPropertyFields());
......@@ -9571,7 +9575,7 @@ Handle<Map> Map::ShareDescriptor(Isolate* isolate, Handle<Map> map,
{
DisallowHeapAllocation no_gc;
descriptors->Append(descriptor);
result->InitializeDescriptors(*descriptors, *layout_descriptor);
result->InitializeDescriptors(isolate, *descriptors, *layout_descriptor);
}
DCHECK(result->NumberOfOwnDescriptors() == map->NumberOfOwnDescriptors() + 1);
......@@ -9637,17 +9641,17 @@ Handle<Map> Map::CopyReplaceDescriptors(
if (!map->is_prototype_map()) {
if (flag == INSERT_TRANSITION &&
TransitionsAccessor(isolate, map).CanHaveMoreTransitions()) {
result->InitializeDescriptors(*descriptors, *layout_descriptor);
result->InitializeDescriptors(isolate, *descriptors, *layout_descriptor);
DCHECK(!maybe_name.is_null());
ConnectTransition(isolate, map, result, name, simple_flag);
} else {
descriptors->GeneralizeAllFields();
result->InitializeDescriptors(*descriptors,
result->InitializeDescriptors(isolate, *descriptors,
LayoutDescriptor::FastPointerLayout());
}
} else {
result->InitializeDescriptors(*descriptors, *layout_descriptor);
result->InitializeDescriptors(isolate, *descriptors, *layout_descriptor);
}
if (FLAG_trace_maps &&
// Mirror conditions above that did not call ConnectTransition().
......@@ -9684,7 +9688,8 @@ Handle<Map> Map::AddMissingTransitions(
// the flag and clear it right before the descriptors are installed. This
// makes heap verification happy and ensures the flag ends up accurate.
Handle<Map> last_map = CopyDropDescriptors(isolate, split_map);
last_map->InitializeDescriptors(*descriptors, *full_layout_descriptor);
last_map->InitializeDescriptors(isolate, *descriptors,
*full_layout_descriptor);
last_map->SetInObjectUnusedPropertyFields(0);
last_map->set_may_have_interesting_symbols(true);
......@@ -9717,8 +9722,7 @@ void Map::InstallDescriptors(Isolate* isolate, Handle<Map> parent,
Handle<LayoutDescriptor> full_layout_descriptor) {
DCHECK(descriptors->IsSortedNoDuplicates());
child->set_instance_descriptors(*descriptors);
child->SetNumberOfOwnDescriptors(new_descriptor + 1);
child->SetInstanceDescriptors(isolate, *descriptors, new_descriptor + 1);
child->CopyUnusedPropertyFields(*parent);
PropertyDetails details = descriptors->GetDetails(new_descriptor);
if (details.location() == kField) {
......@@ -9841,7 +9845,7 @@ Handle<Map> Map::CopyForElementsTransition(Isolate* isolate, Handle<Map> map) {
// In case the map owned its own descriptors, share the descriptors and
// transfer ownership to the new map.
// The properties did not change, so reuse descriptors.
new_map->InitializeDescriptors(map->instance_descriptors(),
new_map->InitializeDescriptors(isolate, map->instance_descriptors(),
map->GetLayoutDescriptor());
} else {
// In case the map did not own its own descriptors, a split is forced by
......@@ -9852,7 +9856,8 @@ Handle<Map> Map::CopyForElementsTransition(Isolate* isolate, Handle<Map> map) {
isolate, descriptors, number_of_own_descriptors);
Handle<LayoutDescriptor> new_layout_descriptor(map->GetLayoutDescriptor(),
isolate);
new_map->InitializeDescriptors(*new_descriptors, *new_layout_descriptor);
new_map->InitializeDescriptors(isolate, *new_descriptors,
*new_layout_descriptor);
}
return new_map;
}
......@@ -12748,6 +12753,12 @@ void Map::CompleteInobjectSlackTracking(Isolate* isolate) {
}
}
void Map::SetInstanceDescriptors(Isolate* isolate, DescriptorArray descriptors,
int number_of_own_descriptors) {
set_raw_instance_descriptors(descriptors);
SetNumberOfOwnDescriptors(number_of_own_descriptors);
// TODO(ulan): Add marking write barrier.
}
static bool PrototypeBenefitsFromNormalization(Handle<JSObject> object) {
DisallowHeapAllocation no_gc;
......
......@@ -29,7 +29,7 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(Map, HeapObjectPtr)
CAST_ACCESSOR2(Map)
ACCESSORS2(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset)
ACCESSORS2(Map, raw_instance_descriptors, DescriptorArray, kDescriptorsOffset)
// A freshly allocated layout descriptor can be set on an existing map.
// We need to use release-store and acquire-load accessor pairs to ensure
// that the concurrent marking thread observes initializing stores of the
......@@ -76,6 +76,10 @@ BIT_FIELD_ACCESSORS(Map, bit_field3, may_have_interesting_symbols,
BIT_FIELD_ACCESSORS(Map, bit_field3, construction_counter,
Map::ConstructionCounterBits)
DescriptorArray Map::instance_descriptors() const {
return raw_instance_descriptors();
}
InterceptorInfo* Map::GetNamedInterceptor() {
DCHECK(has_named_interceptor());
FunctionTemplateInfo* info = GetFunctionTemplateInfo();
......@@ -576,9 +580,10 @@ bool Map::HasFastPointerLayout() const {
return LayoutDescriptor::IsFastPointerLayout(layout_desc);
}
void Map::UpdateDescriptors(DescriptorArray descriptors,
LayoutDescriptor layout_desc) {
set_instance_descriptors(descriptors);
void Map::UpdateDescriptors(Isolate* isolate, DescriptorArray descriptors,
LayoutDescriptor layout_desc,
int number_of_own_descriptors) {
SetInstanceDescriptors(isolate, descriptors, number_of_own_descriptors);
if (FLAG_unbox_double_fields) {
if (layout_descriptor()->IsSlowLayout()) {
set_layout_descriptor(layout_desc);
......@@ -596,11 +601,10 @@ void Map::UpdateDescriptors(DescriptorArray descriptors,
}
}
void Map::InitializeDescriptors(DescriptorArray descriptors,
void Map::InitializeDescriptors(Isolate* isolate, DescriptorArray descriptors,
LayoutDescriptor layout_desc) {
int len = descriptors->number_of_descriptors();
set_instance_descriptors(descriptors);
SetNumberOfOwnDescriptors(len);
SetInstanceDescriptors(isolate, descriptors,
descriptors->number_of_descriptors());
if (FLAG_unbox_double_fields) {
set_layout_descriptor(layout_desc);
......@@ -632,7 +636,7 @@ LayoutDescriptor Map::GetLayoutDescriptor() const {
: LayoutDescriptor::FastPointerLayout();
}
void Map::AppendDescriptor(Descriptor* desc) {
void Map::AppendDescriptor(Isolate* isolate, Descriptor* desc) {
DescriptorArray descriptors = instance_descriptors();
int number_of_own_descriptors = NumberOfOwnDescriptors();
DCHECK(descriptors->number_of_descriptors() == number_of_own_descriptors);
......
......@@ -573,7 +573,9 @@ class Map : public HeapObjectPtr {
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
// [instance descriptors]: describes the object.
DECL_ACCESSORS2(instance_descriptors, DescriptorArray)
inline DescriptorArray instance_descriptors() const;
void SetInstanceDescriptors(Isolate* isolate, DescriptorArray descriptors,
int number_of_own_descriptors);
// [layout descriptor]: describes the object layout.
DECL_ACCESSORS2(layout_descriptor, LayoutDescriptor)
......@@ -586,9 +588,11 @@ class Map : public HeapObjectPtr {
// |layout_descriptor| field at all).
inline LayoutDescriptor GetLayoutDescriptor() const;
inline void UpdateDescriptors(DescriptorArray descriptors,
LayoutDescriptor layout_descriptor);
inline void InitializeDescriptors(DescriptorArray descriptors,
inline void UpdateDescriptors(Isolate* isolate, DescriptorArray descriptors,
LayoutDescriptor layout_descriptor,
int number_of_own_descriptors);
inline void InitializeDescriptors(Isolate* isolate,
DescriptorArray descriptors,
LayoutDescriptor layout_descriptor);
// [dependent code]: list of optimized codes that weakly embed this map.
......@@ -730,7 +734,7 @@ class Map : public HeapObjectPtr {
PropertyKind kind,
PropertyAttributes attributes);
inline void AppendDescriptor(Descriptor* desc);
inline void AppendDescriptor(Isolate* isolate, Descriptor* desc);
// Returns a copy of the map, prepared for inserting into the transition
// tree (if the |map| owns descriptors then the new one will share
......@@ -964,6 +968,10 @@ class Map : public HeapObjectPtr {
Representation old_representation, Representation new_representation,
MaybeHandle<FieldType> old_field_type, MaybeHandle<Object> old_value,
MaybeHandle<FieldType> new_field_type, MaybeHandle<Object> new_value);
// Use the high-level instance_descriptors/SetInstanceDescriptors instead.
DECL_ACCESSORS2(raw_instance_descriptors, DescriptorArray)
static const int kFastPropertiesSoftLimit = 12;
static const int kMaxFastProperties = 128;
......
......@@ -370,7 +370,7 @@ bool AddDescriptorsByTemplate(
}
}
map->InitializeDescriptors(*descriptors,
map->InitializeDescriptors(isolate, *descriptors,
LayoutDescriptor::FastPointerLayout());
if (elements_dictionary->NumberOfElements() > 0) {
if (!SubstituteValues<NumberDictionary>(isolate, elements_dictionary,
......@@ -565,7 +565,8 @@ bool InitClassConstructor(Isolate* isolate,
Handle<NameDictionary>::cast(properties_template);
map->set_is_dictionary_map(true);
map->InitializeDescriptors(ReadOnlyRoots(isolate).empty_descriptor_array(),
map->InitializeDescriptors(isolate,
ReadOnlyRoots(isolate).empty_descriptor_array(),
LayoutDescriptor::FastPointerLayout());
map->set_is_migration_target(false);
map->set_may_have_interesting_symbols(true);
......
......@@ -150,7 +150,7 @@ TEST(StressJS) {
Descriptor d = Descriptor::AccessorConstant(
Handle<Name>(Name::cast(foreign->name()), isolate), foreign, attrs);
map->AppendDescriptor(&d);
map->AppendDescriptor(isolate, &d);
// Add the Foo constructor the global object.
CHECK(env->Global()
......
......@@ -36,8 +36,9 @@ namespace test_unboxed_doubles {
//
static void InitializeVerifiedMapDescriptors(
Map map, DescriptorArray descriptors, LayoutDescriptor layout_descriptor) {
map->InitializeDescriptors(descriptors, layout_descriptor);
Isolate* isolate, Map map, DescriptorArray descriptors,
LayoutDescriptor layout_descriptor) {
map->InitializeDescriptors(isolate, descriptors, layout_descriptor);
CHECK(layout_descriptor->IsConsistentWithMap(map, true));
}
......@@ -192,7 +193,8 @@ TEST(LayoutDescriptorBasicSlow) {
LayoutDescriptor::New(isolate, map, descriptors, kPropsCount);
CHECK_EQ(LayoutDescriptor::FastPointerLayout(), *layout_descriptor);
CHECK_EQ(kBitsInSmiLayout, layout_descriptor->capacity());
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
props[0] = PROP_DOUBLE;
......@@ -216,7 +218,8 @@ TEST(LayoutDescriptorBasicSlow) {
for (int i = 1; i < kPropsCount; i++) {
CHECK(layout_descriptor->IsTagged(i));
}
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
{
......@@ -236,7 +239,8 @@ TEST(LayoutDescriptorBasicSlow) {
CHECK(layout_descriptor->IsTagged(i));
}
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
// Here we have truly slow layout descriptor, so play with the bits.
CHECK(layout_descriptor->IsTagged(-1));
......@@ -516,7 +520,8 @@ TEST(LayoutDescriptorCreateNewFast) {
layout_descriptor =
LayoutDescriptor::New(isolate, map, descriptors, kPropsCount);
CHECK_EQ(LayoutDescriptor::FastPointerLayout(), *layout_descriptor);
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
{
......@@ -524,7 +529,8 @@ TEST(LayoutDescriptorCreateNewFast) {
layout_descriptor =
LayoutDescriptor::New(isolate, map, descriptors, kPropsCount);
CHECK_EQ(LayoutDescriptor::FastPointerLayout(), *layout_descriptor);
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
{
......@@ -537,7 +543,8 @@ TEST(LayoutDescriptorCreateNewFast) {
CHECK(!layout_descriptor->IsTagged(1));
CHECK(layout_descriptor->IsTagged(2));
CHECK(layout_descriptor->IsTagged(125));
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
}
......@@ -562,7 +569,8 @@ TEST(LayoutDescriptorCreateNewSlow) {
layout_descriptor =
LayoutDescriptor::New(isolate, map, descriptors, kPropsCount);
CHECK_EQ(LayoutDescriptor::FastPointerLayout(), *layout_descriptor);
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
{
......@@ -570,7 +578,8 @@ TEST(LayoutDescriptorCreateNewSlow) {
layout_descriptor =
LayoutDescriptor::New(isolate, map, descriptors, kPropsCount);
CHECK_EQ(LayoutDescriptor::FastPointerLayout(), *layout_descriptor);
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
{
......@@ -583,7 +592,8 @@ TEST(LayoutDescriptorCreateNewSlow) {
CHECK(!layout_descriptor->IsTagged(1));
CHECK(layout_descriptor->IsTagged(2));
CHECK(layout_descriptor->IsTagged(125));
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
}
{
......@@ -602,7 +612,8 @@ TEST(LayoutDescriptorCreateNewSlow) {
for (int i = inobject_properties; i < kPropsCount; i++) {
CHECK(layout_descriptor->IsTagged(i));
}
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
// Now test LayoutDescriptor::cast_gc_safe().
Handle<LayoutDescriptor> layout_descriptor_copy =
......@@ -636,7 +647,7 @@ static Handle<LayoutDescriptor> TestLayoutDescriptorAppend(
DescriptorArray::Allocate(isolate, 0, kPropsCount);
Handle<Map> map = Map::Create(isolate, inobject_properties);
map->InitializeDescriptors(*descriptors,
map->InitializeDescriptors(isolate, *descriptors,
LayoutDescriptor::FastPointerLayout());
int next_field_offset = 0;
......@@ -672,7 +683,7 @@ static Handle<LayoutDescriptor> TestLayoutDescriptorAppend(
}
CHECK(layout_descriptor->IsTagged(next_field_offset));
}
map->InitializeDescriptors(*descriptors, *layout_descriptor);
map->InitializeDescriptors(isolate, *descriptors, *layout_descriptor);
}
Handle<LayoutDescriptor> layout_descriptor(map->layout_descriptor(), isolate);
CHECK(layout_descriptor->IsConsistentWithMap(*map, true));
......@@ -940,7 +951,7 @@ TEST(Regress436816) {
Handle<Map> map = Map::Create(isolate, kPropsCount);
Handle<LayoutDescriptor> layout_descriptor =
LayoutDescriptor::New(isolate, map, descriptors, kPropsCount);
map->InitializeDescriptors(*descriptors, *layout_descriptor);
map->InitializeDescriptors(isolate, *descriptors, *layout_descriptor);
Handle<JSObject> object = factory->NewJSObjectFromMap(map, TENURED);
......@@ -1222,7 +1233,8 @@ static void TestLayoutDescriptorHelper(Isolate* isolate,
Handle<LayoutDescriptor> layout_descriptor = LayoutDescriptor::New(
isolate, map, descriptors, descriptors->number_of_descriptors());
InitializeVerifiedMapDescriptors(*map, *descriptors, *layout_descriptor);
InitializeVerifiedMapDescriptors(isolate, *map, *descriptors,
*layout_descriptor);
LayoutDescriptorHelper helper(*map);
bool all_fields_tagged = true;
......
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