Commit be91c6c5 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler][cleanup] Move Make(String|Name) helper methods to cctest.h

Several tests were using them and we can dedup code.

Change-Id: I4ef5ae5772856d1f36e965b6b62ff5895b4e04fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2215173Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67974}
parent a79a9185
...@@ -150,6 +150,18 @@ void CcTest::PreciseCollectAllGarbage(i::Isolate* isolate) { ...@@ -150,6 +150,18 @@ void CcTest::PreciseCollectAllGarbage(i::Isolate* isolate) {
i::GarbageCollectionReason::kTesting); i::GarbageCollectionReason::kTesting);
} }
i::Handle<i::String> CcTest::MakeString(const char* str) {
i::Isolate* isolate = CcTest::i_isolate();
i::Factory* factory = isolate->factory();
return factory->InternalizeUtf8String(str);
}
i::Handle<i::String> CcTest::MakeName(const char* str, int suffix) {
i::EmbeddedVector<char, 128> buffer;
SNPrintF(buffer, "%s%d", str, suffix);
return CcTest::MakeString(buffer.begin());
}
v8::base::RandomNumberGenerator* CcTest::random_number_generator() { v8::base::RandomNumberGenerator* CcTest::random_number_generator() {
return InitIsolateOnce()->random_number_generator(); return InitIsolateOnce()->random_number_generator();
} }
......
...@@ -141,6 +141,9 @@ class CcTest { ...@@ -141,6 +141,9 @@ class CcTest {
static void CollectAllAvailableGarbage(i::Isolate* isolate = nullptr); static void CollectAllAvailableGarbage(i::Isolate* isolate = nullptr);
static void PreciseCollectAllGarbage(i::Isolate* isolate = nullptr); static void PreciseCollectAllGarbage(i::Isolate* isolate = nullptr);
static i::Handle<i::String> MakeString(const char* str);
static i::Handle<i::String> MakeName(const char* str, int suffix);
static v8::base::RandomNumberGenerator* random_number_generator(); static v8::base::RandomNumberGenerator* random_number_generator();
static v8::Local<v8::Object> global(); static v8::Local<v8::Object> global();
......
...@@ -42,18 +42,6 @@ template <class T> ...@@ -42,18 +42,6 @@ template <class T>
using TVariable = TypedCodeAssemblerVariable<T>; using TVariable = TypedCodeAssemblerVariable<T>;
using PromiseResolvingFunctions = TorqueStructPromiseResolvingFunctions; using PromiseResolvingFunctions = TorqueStructPromiseResolvingFunctions;
Handle<String> MakeString(const char* str) {
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
return factory->InternalizeUtf8String(str);
}
Handle<String> MakeName(const char* str, int suffix) {
EmbeddedVector<char, 128> buffer;
SNPrintF(buffer, "%s%d", str, suffix);
return MakeString(buffer.begin());
}
int sum10(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int sum10(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7,
int a8, int a9) { int a8, int a9) {
return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9; return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9;
...@@ -1090,7 +1078,7 @@ TEST(TransitionLookup) { ...@@ -1090,7 +1078,7 @@ TEST(TransitionLookup) {
name = factory->NewSymbol(); name = factory->NewSymbol();
} else { } else {
int random_key = rand_gen.NextInt(Smi::kMaxValue); int random_key = rand_gen.NextInt(Smi::kMaxValue);
name = MakeName("p", random_key); name = CcTest::MakeName("p", random_key);
} }
keys[i] = name; keys[i] = name;
...@@ -3572,8 +3560,8 @@ TEST(TestCallBuiltinInlineTrampoline) { ...@@ -3572,8 +3560,8 @@ TEST(TestCallBuiltinInlineTrampoline) {
options.use_pc_relative_calls_and_jumps = false; options.use_pc_relative_calls_and_jumps = false;
options.isolate_independent_code = false; options.isolate_independent_code = false;
FunctionTester ft(asm_tester.GenerateCode(options), kNumParams); FunctionTester ft(asm_tester.GenerateCode(options), kNumParams);
MaybeHandle<Object> result = ft.Call(MakeString("abcdef")); MaybeHandle<Object> result = ft.Call(CcTest::MakeString("abcdef"));
CHECK(String::Equals(isolate, MakeString("abcdefabcdef"), CHECK(String::Equals(isolate, CcTest::MakeString("abcdefabcdef"),
Handle<String>::cast(result.ToHandleChecked()))); Handle<String>::cast(result.ToHandleChecked())));
} }
...@@ -3598,8 +3586,8 @@ DISABLED_TEST(TestCallBuiltinIndirectLoad) { ...@@ -3598,8 +3586,8 @@ DISABLED_TEST(TestCallBuiltinIndirectLoad) {
options.use_pc_relative_calls_and_jumps = false; options.use_pc_relative_calls_and_jumps = false;
options.isolate_independent_code = true; options.isolate_independent_code = true;
FunctionTester ft(asm_tester.GenerateCode(options), kNumParams); FunctionTester ft(asm_tester.GenerateCode(options), kNumParams);
MaybeHandle<Object> result = ft.Call(MakeString("abcdef")); MaybeHandle<Object> result = ft.Call(CcTest::MakeString("abcdef"));
CHECK(String::Equals(isolate, MakeString("abcdefabcdef"), CHECK(String::Equals(isolate, CcTest::MakeString("abcdefabcdef"),
Handle<String>::cast(result.ToHandleChecked()))); Handle<String>::cast(result.ToHandleChecked())));
} }
......
This diff is collapsed.
...@@ -43,20 +43,6 @@ const int kPropCount = 7; ...@@ -43,20 +43,6 @@ const int kPropCount = 7;
// Helper functions. // Helper functions.
// //
static Handle<String> MakeString(const char* str) {
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
return factory->InternalizeUtf8String(str);
}
static Handle<String> MakeName(const char* str, int suffix) {
EmbeddedVector<char, 128> buffer;
SNPrintF(buffer, "%s%d", str, suffix);
return MakeString(buffer.begin());
}
static Handle<AccessorPair> CreateAccessorPair(bool with_getter, static Handle<AccessorPair> CreateAccessorPair(bool with_getter,
bool with_setter) { bool with_setter) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
...@@ -339,7 +325,7 @@ class Expectations { ...@@ -339,7 +325,7 @@ class Expectations {
SetDataField(property_index, attributes, constness, representation, SetDataField(property_index, attributes, constness, representation,
field_type); field_type);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
return Map::CopyWithField(isolate_, map, name, field_type, attributes, return Map::CopyWithField(isolate_, map, name, field_type, attributes,
constness, representation, INSERT_TRANSITION) constness, representation, INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
...@@ -351,7 +337,7 @@ class Expectations { ...@@ -351,7 +337,7 @@ class Expectations {
int property_index = number_of_properties_++; int property_index = number_of_properties_++;
SetDataConstant(property_index, attributes, value); SetDataConstant(property_index, attributes, value);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
return Map::CopyWithConstant(isolate_, map, name, value, attributes, return Map::CopyWithConstant(isolate_, map, name, value, attributes,
INSERT_TRANSITION) INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
...@@ -368,7 +354,7 @@ class Expectations { ...@@ -368,7 +354,7 @@ class Expectations {
SetDataField(property_index, attributes, constness, representation, SetDataField(property_index, attributes, constness, representation,
heap_type); heap_type);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
return Map::TransitionToDataProperty(isolate_, map, name, value, attributes, return Map::TransitionToDataProperty(isolate_, map, name, value, attributes,
constness, StoreOrigin::kNamed); constness, StoreOrigin::kNamed);
} }
...@@ -380,7 +366,7 @@ class Expectations { ...@@ -380,7 +366,7 @@ class Expectations {
int property_index = number_of_properties_++; int property_index = number_of_properties_++;
SetDataConstant(property_index, attributes, value); SetDataConstant(property_index, attributes, value);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
return Map::TransitionToDataProperty(isolate_, map, name, value, attributes, return Map::TransitionToDataProperty(isolate_, map, name, value, attributes,
PropertyConstness::kConst, PropertyConstness::kConst,
StoreOrigin::kNamed); StoreOrigin::kNamed);
...@@ -396,7 +382,7 @@ class Expectations { ...@@ -396,7 +382,7 @@ class Expectations {
SetDataField(property_index, attributes, constness, representation, SetDataField(property_index, attributes, constness, representation,
heap_type); heap_type);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
Map target = TransitionsAccessor(isolate_, map) Map target = TransitionsAccessor(isolate_, map)
.SearchTransition(*name, kData, attributes); .SearchTransition(*name, kData, attributes);
CHECK(!target.is_null()); CHECK(!target.is_null());
...@@ -410,7 +396,7 @@ class Expectations { ...@@ -410,7 +396,7 @@ class Expectations {
int property_index = number_of_properties_++; int property_index = number_of_properties_++;
SetAccessorConstant(property_index, attributes, pair); SetAccessorConstant(property_index, attributes, pair);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
Descriptor d = Descriptor::AccessorConstant(name, pair, attributes); Descriptor d = Descriptor::AccessorConstant(name, pair, attributes);
return Map::CopyInsertDescriptor(isolate_, map, &d, INSERT_TRANSITION); return Map::CopyInsertDescriptor(isolate_, map, &d, INSERT_TRANSITION);
...@@ -424,7 +410,7 @@ class Expectations { ...@@ -424,7 +410,7 @@ class Expectations {
int property_index = number_of_properties_++; int property_index = number_of_properties_++;
SetAccessorConstant(property_index, attributes, getter, setter); SetAccessorConstant(property_index, attributes, getter, setter);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
CHECK(!getter->IsNull(isolate_) || !setter->IsNull(isolate_)); CHECK(!getter->IsNull(isolate_) || !setter->IsNull(isolate_));
Factory* factory = isolate_->factory(); Factory* factory = isolate_->factory();
...@@ -451,7 +437,7 @@ class Expectations { ...@@ -451,7 +437,7 @@ class Expectations {
int property_index = number_of_properties_++; int property_index = number_of_properties_++;
SetAccessorConstant(property_index, attributes, pair); SetAccessorConstant(property_index, attributes, pair);
Handle<String> name = MakeName("prop", property_index); Handle<String> name = CcTest::MakeName("prop", property_index);
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
Handle<Object> getter(pair->getter(), isolate); Handle<Object> getter(pair->getter(), isolate);
...@@ -2121,7 +2107,7 @@ TEST(ReconfigurePropertySplitMapTransitionsOverflow) { ...@@ -2121,7 +2107,7 @@ TEST(ReconfigurePropertySplitMapTransitionsOverflow) {
split_map = map2; split_map = map2;
} }
Handle<String> name = MakeName("prop", i); Handle<String> name = CcTest::MakeName("prop", i);
Map target = TransitionsAccessor(isolate, map2) Map target = TransitionsAccessor(isolate, map2)
.SearchTransition(*name, kData, NONE); .SearchTransition(*name, kData, NONE);
CHECK(!target.is_null()); CHECK(!target.is_null());
...@@ -2148,7 +2134,7 @@ TEST(ReconfigurePropertySplitMapTransitionsOverflow) { ...@@ -2148,7 +2134,7 @@ TEST(ReconfigurePropertySplitMapTransitionsOverflow) {
// Fill in transition tree of |map2| so that it can't have more transitions. // Fill in transition tree of |map2| so that it can't have more transitions.
for (int i = 0; i < TransitionsAccessor::kMaxNumberOfTransitions; i++) { for (int i = 0; i < TransitionsAccessor::kMaxNumberOfTransitions; i++) {
CHECK(TransitionsAccessor(isolate, map2).CanHaveMoreTransitions()); CHECK(TransitionsAccessor(isolate, map2).CanHaveMoreTransitions());
Handle<String> name = MakeName("foo", i); Handle<String> name = CcTest::MakeName("foo", i);
Map::CopyWithField(isolate, map2, name, any_type, NONE, Map::CopyWithField(isolate, map2, name, any_type, NONE,
PropertyConstness::kMutable, Representation::Smi(), PropertyConstness::kMutable, Representation::Smi(),
INSERT_TRANSITION) INSERT_TRANSITION)
...@@ -2367,9 +2353,9 @@ TEST(ElementsKindTransitionFromMapNotOwningDescriptor) { ...@@ -2367,9 +2353,9 @@ TEST(ElementsKindTransitionFromMapNotOwningDescriptor) {
// Add one more transition to |map| in order to prevent descriptors // Add one more transition to |map| in order to prevent descriptors
// ownership. // ownership.
CHECK(map->owns_descriptors()); CHECK(map->owns_descriptors());
Map::CopyWithField(isolate, map, MakeString("foo"), any_type, NONE, Map::CopyWithField(isolate, map, CcTest::MakeString("foo"), any_type,
PropertyConstness::kMutable, Representation::Smi(), NONE, PropertyConstness::kMutable,
INSERT_TRANSITION) Representation::Smi(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
CHECK(!map->owns_descriptors()); CHECK(!map->owns_descriptors());
...@@ -2480,9 +2466,9 @@ TEST(PrototypeTransitionFromMapNotOwningDescriptor) { ...@@ -2480,9 +2466,9 @@ TEST(PrototypeTransitionFromMapNotOwningDescriptor) {
// Add one more transition to |map| in order to prevent descriptors // Add one more transition to |map| in order to prevent descriptors
// ownership. // ownership.
CHECK(map->owns_descriptors()); CHECK(map->owns_descriptors());
Map::CopyWithField(isolate, map, MakeString("foo"), any_type, NONE, Map::CopyWithField(isolate, map, CcTest::MakeString("foo"), any_type,
PropertyConstness::kMutable, Representation::Smi(), NONE, PropertyConstness::kMutable,
INSERT_TRANSITION) Representation::Smi(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
CHECK(!map->owns_descriptors()); CHECK(!map->owns_descriptors());
......
...@@ -45,20 +45,6 @@ static void InitializeVerifiedMapDescriptors( ...@@ -45,20 +45,6 @@ static void InitializeVerifiedMapDescriptors(
CHECK(layout_descriptor.IsConsistentWithMap(map, true)); CHECK(layout_descriptor.IsConsistentWithMap(map, true));
} }
static Handle<String> MakeString(const char* str) {
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
return factory->InternalizeUtf8String(str);
}
static Handle<String> MakeName(const char* str, int suffix) {
EmbeddedVector<char, 128> buffer;
SNPrintF(buffer, "%s%d", str, suffix);
return MakeString(buffer.begin());
}
Handle<JSObject> GetObject(const char* name) { Handle<JSObject> GetObject(const char* name) {
return Handle<JSObject>::cast( return Handle<JSObject>::cast(
v8::Utils::OpenHandle(*v8::Local<v8::Object>::Cast( v8::Utils::OpenHandle(*v8::Local<v8::Object>::Cast(
...@@ -995,13 +981,14 @@ TEST(DescriptorArrayTrimming) { ...@@ -995,13 +981,14 @@ TEST(DescriptorArrayTrimming) {
Handle<FieldType> any_type = FieldType::Any(isolate); Handle<FieldType> any_type = FieldType::Any(isolate);
Handle<Map> map = Map::Create(isolate, kFieldCount); Handle<Map> map = Map::Create(isolate, kFieldCount);
for (int i = 0; i < kSplitFieldIndex; i++) { for (int i = 0; i < kSplitFieldIndex; i++) {
map = Map::CopyWithField(isolate, map, MakeName("prop", i), any_type, NONE, map = Map::CopyWithField(isolate, map, CcTest::MakeName("prop", i),
PropertyConstness::kMutable, Representation::Smi(), any_type, NONE, PropertyConstness::kMutable,
INSERT_TRANSITION) Representation::Smi(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
} }
map = Map::CopyWithField(isolate, map, MakeName("dbl", kSplitFieldIndex), map = Map::CopyWithField(isolate, map,
any_type, NONE, PropertyConstness::kMutable, CcTest::MakeName("dbl", kSplitFieldIndex), any_type,
NONE, PropertyConstness::kMutable,
Representation::Double(), INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
CHECK(map->layout_descriptor().IsConsistentWithMap(*map, true)); CHECK(map->layout_descriptor().IsConsistentWithMap(*map, true));
...@@ -1015,7 +1002,7 @@ TEST(DescriptorArrayTrimming) { ...@@ -1015,7 +1002,7 @@ TEST(DescriptorArrayTrimming) {
Handle<Map> tmp_map = map; Handle<Map> tmp_map = map;
for (int i = kSplitFieldIndex + 1; i < kFieldCount; i++) { for (int i = kSplitFieldIndex + 1; i < kFieldCount; i++) {
tmp_map = Map::CopyWithField(isolate, tmp_map, MakeName("dbl", i), tmp_map = Map::CopyWithField(isolate, tmp_map, CcTest::MakeName("dbl", i),
any_type, NONE, PropertyConstness::kMutable, any_type, NONE, PropertyConstness::kMutable,
Representation::Double(), INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
...@@ -1055,14 +1042,15 @@ TEST(DescriptorArrayTrimming) { ...@@ -1055,14 +1042,15 @@ TEST(DescriptorArrayTrimming) {
Handle<Map> tmp_map = map; Handle<Map> tmp_map = map;
for (int i = kSplitFieldIndex + 1; i < kFieldCount - 1; i++) { for (int i = kSplitFieldIndex + 1; i < kFieldCount - 1; i++) {
tmp_map = Map::CopyWithField(isolate, tmp_map, MakeName("tagged", i), tmp_map =
any_type, NONE, PropertyConstness::kMutable, Map::CopyWithField(isolate, tmp_map, CcTest::MakeName("tagged", i),
Representation::Tagged(), INSERT_TRANSITION) any_type, NONE, PropertyConstness::kMutable,
.ToHandleChecked(); Representation::Tagged(), INSERT_TRANSITION)
.ToHandleChecked();
CHECK(tmp_map->layout_descriptor().IsConsistentWithMap(*tmp_map, true)); CHECK(tmp_map->layout_descriptor().IsConsistentWithMap(*tmp_map, true));
} }
tmp_map = Map::CopyWithField(isolate, tmp_map, MakeString("dbl"), any_type, tmp_map = Map::CopyWithField(isolate, tmp_map, CcTest::MakeString("dbl"),
NONE, PropertyConstness::kMutable, any_type, NONE, PropertyConstness::kMutable,
Representation::Double(), INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
CHECK(tmp_map->layout_descriptor().IsConsistentWithMap(*tmp_map, true)); CHECK(tmp_map->layout_descriptor().IsConsistentWithMap(*tmp_map, true));
...@@ -1087,8 +1075,8 @@ TEST(DoScavenge) { ...@@ -1087,8 +1075,8 @@ TEST(DoScavenge) {
Handle<FieldType> any_type = FieldType::Any(isolate); Handle<FieldType> any_type = FieldType::Any(isolate);
Handle<Map> map = Map::Create(isolate, 10); Handle<Map> map = Map::Create(isolate, 10);
map = Map::CopyWithField(isolate, map, MakeName("prop", 0), any_type, NONE, map = Map::CopyWithField(isolate, map, CcTest::MakeName("prop", 0), any_type,
PropertyConstness::kMutable, NONE, PropertyConstness::kMutable,
Representation::Double(), INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
...@@ -1153,12 +1141,12 @@ TEST(DoScavengeWithIncrementalWriteBarrier) { ...@@ -1153,12 +1141,12 @@ TEST(DoScavengeWithIncrementalWriteBarrier) {
Handle<FieldType> any_type = FieldType::Any(isolate); Handle<FieldType> any_type = FieldType::Any(isolate);
Handle<Map> map = Map::Create(isolate, 10); Handle<Map> map = Map::Create(isolate, 10);
map = Map::CopyWithField(isolate, map, MakeName("prop", 0), any_type, NONE, map = Map::CopyWithField(isolate, map, CcTest::MakeName("prop", 0), any_type,
PropertyConstness::kMutable, NONE, PropertyConstness::kMutable,
Representation::Double(), INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
map = Map::CopyWithField(isolate, map, MakeName("prop", 1), any_type, NONE, map = Map::CopyWithField(isolate, map, CcTest::MakeName("prop", 1), any_type,
PropertyConstness::kMutable, NONE, PropertyConstness::kMutable,
Representation::Tagged(), INSERT_TRANSITION) Representation::Tagged(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
...@@ -1390,14 +1378,14 @@ TEST(LayoutDescriptorSharing) { ...@@ -1390,14 +1378,14 @@ TEST(LayoutDescriptorSharing) {
{ {
Handle<Map> map = Map::Create(isolate, 64); Handle<Map> map = Map::Create(isolate, 64);
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
Handle<String> name = MakeName("prop", i); Handle<String> name = CcTest::MakeName("prop", i);
map = Map::CopyWithField(isolate, map, name, any_type, NONE, map = Map::CopyWithField(isolate, map, name, any_type, NONE,
PropertyConstness::kMutable, PropertyConstness::kMutable,
Representation::Smi(), INSERT_TRANSITION) Representation::Smi(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
} }
split_map = Map::CopyWithField(isolate, map, MakeString("dbl"), any_type, split_map = Map::CopyWithField(isolate, map, CcTest::MakeString("dbl"),
NONE, PropertyConstness::kMutable, any_type, NONE, PropertyConstness::kMutable,
Representation::Double(), INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
} }
...@@ -1408,9 +1396,9 @@ TEST(LayoutDescriptorSharing) { ...@@ -1408,9 +1396,9 @@ TEST(LayoutDescriptorSharing) {
CHECK(split_map->owns_descriptors()); CHECK(split_map->owns_descriptors());
Handle<Map> map1 = Handle<Map> map1 =
Map::CopyWithField(isolate, split_map, MakeString("foo"), any_type, NONE, Map::CopyWithField(isolate, split_map, CcTest::MakeString("foo"),
PropertyConstness::kMutable, Representation::Double(), any_type, NONE, PropertyConstness::kMutable,
INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
CHECK(!split_map->owns_descriptors()); CHECK(!split_map->owns_descriptors());
CHECK_EQ(*split_layout_descriptor, split_map->layout_descriptor()); CHECK_EQ(*split_layout_descriptor, split_map->layout_descriptor());
...@@ -1421,9 +1409,9 @@ TEST(LayoutDescriptorSharing) { ...@@ -1421,9 +1409,9 @@ TEST(LayoutDescriptorSharing) {
CHECK(map1->layout_descriptor().IsConsistentWithMap(*map1, true)); CHECK(map1->layout_descriptor().IsConsistentWithMap(*map1, true));
Handle<Map> map2 = Handle<Map> map2 =
Map::CopyWithField(isolate, split_map, MakeString("bar"), any_type, NONE, Map::CopyWithField(isolate, split_map, CcTest::MakeString("bar"),
PropertyConstness::kMutable, Representation::Tagged(), any_type, NONE, PropertyConstness::kMutable,
INSERT_TRANSITION) Representation::Tagged(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
// Layout descriptors should not be shared with |split_map|. // Layout descriptors should not be shared with |split_map|.
...@@ -1595,15 +1583,15 @@ static void TestWriteBarrierObjectShiftFieldsRight( ...@@ -1595,15 +1583,15 @@ static void TestWriteBarrierObjectShiftFieldsRight(
Handle<JSObject> func = GetObject("func"); Handle<JSObject> func = GetObject("func");
Handle<Map> map = Map::Create(isolate, 10); Handle<Map> map = Map::Create(isolate, 10);
map = Map::CopyWithConstant(isolate, map, MakeName("prop", 0), func, NONE, map = Map::CopyWithConstant(isolate, map, CcTest::MakeName("prop", 0), func,
INSERT_TRANSITION) NONE, INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
map = Map::CopyWithField(isolate, map, MakeName("prop", 1), any_type, NONE, map = Map::CopyWithField(isolate, map, CcTest::MakeName("prop", 1), any_type,
PropertyConstness::kMutable, NONE, PropertyConstness::kMutable,
Representation::Double(), INSERT_TRANSITION) Representation::Double(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
map = Map::CopyWithField(isolate, map, MakeName("prop", 2), any_type, NONE, map = Map::CopyWithField(isolate, map, CcTest::MakeName("prop", 2), any_type,
PropertyConstness::kMutable, NONE, PropertyConstness::kMutable,
Representation::Tagged(), INSERT_TRANSITION) Representation::Tagged(), INSERT_TRANSITION)
.ToHandleChecked(); .ToHandleChecked();
......
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