Commit 14bf7357 authored by ishell's avatar ishell Committed by Commit bot

Remove one of the JSObject::WriteToField() methods in favor of another.

BUG=

Review-Url: https://codereview.chromium.org/2645083003
Cr-Commit-Position: refs/heads/master@{#42571}
parent ee94fa11
......@@ -478,12 +478,12 @@ void JsonParser<seq_one_byte>::CommitStateToJsonObject(
DCHECK(!json_object->map()->is_dictionary_map());
DisallowHeapAllocation no_gc;
DescriptorArray* descriptors = map->instance_descriptors();
int length = properties->length();
for (int i = 0; i < length; i++) {
Handle<Object> value = (*properties)[i];
// Initializing store.
json_object->WriteToField(i, *value);
json_object->WriteToField(i, descriptors->GetDetails(i), *value);
}
}
......
......@@ -2354,12 +2354,6 @@ void JSObject::WriteToField(int descriptor, PropertyDetails details,
}
}
void JSObject::WriteToField(int descriptor, Object* value) {
DescriptorArray* desc = map()->instance_descriptors();
PropertyDetails details = desc->GetDetails(descriptor);
WriteToField(descriptor, details, value);
}
int JSObject::GetInObjectPropertyOffset(int index) {
return map()->GetInObjectPropertyOffset(index);
}
......
......@@ -2513,7 +2513,6 @@ class JSObject: public JSReceiver {
inline void RawFastDoublePropertyAtPut(FieldIndex index, double value);
inline void WriteToField(int descriptor, PropertyDetails details,
Object* value);
inline void WriteToField(int descriptor, Object* value);
// Access to in object properties.
inline int GetInObjectPropertyOffset(int index);
......
......@@ -70,6 +70,12 @@ static double GetDoubleFieldValue(JSObject* obj, FieldIndex field_index) {
}
}
void WriteToField(JSObject* object, int descriptor, Object* value) {
DescriptorArray* descriptors = object->map()->instance_descriptors();
PropertyDetails details = descriptors->GetDetails(descriptor);
object->WriteToField(descriptor, details, value);
}
const int kNumberOfBits = 32;
......@@ -1047,7 +1053,7 @@ TEST(DoScavenge) {
Handle<JSObject> obj = factory->NewJSObjectFromMap(map, NOT_TENURED);
Handle<HeapNumber> heap_number = factory->NewHeapNumber(42.5);
obj->WriteToField(0, *heap_number);
WriteToField(*obj, 0, *heap_number);
{
// Ensure the object is properly set up.
......@@ -1123,8 +1129,8 @@ TEST(DoScavengeWithIncrementalWriteBarrier) {
Handle<JSObject> obj = factory->NewJSObjectFromMap(map, NOT_TENURED);
Handle<HeapNumber> heap_number = factory->NewHeapNumber(42.5);
obj->WriteToField(0, *heap_number);
obj->WriteToField(1, *obj_value);
WriteToField(*obj, 0, *heap_number);
WriteToField(*obj, 1, *obj_value);
{
// Ensure the object is properly set up.
......
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