Commit b26322d4 authored by bak@chromium.org's avatar bak@chromium.org

- Applied FixedArray::WriteBarrierMode to NewArgumentsFast.

Review URL: http://codereview.chromium.org/8052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 50d9f5e2
...@@ -1779,13 +1779,13 @@ Object* Heap::CopyJSObject(JSObject* source) { ...@@ -1779,13 +1779,13 @@ Object* Heap::CopyJSObject(JSObject* source) {
FixedArray* properties = FixedArray::cast(source->properties()); FixedArray* properties = FixedArray::cast(source->properties());
// Update elements if necessary. // Update elements if necessary.
if (elements->length()> 0) { if (elements->length()> 0) {
Object* elem = Heap::CopyFixedArray(elements); Object* elem = CopyFixedArray(elements);
if (elem->IsFailure()) return elem; if (elem->IsFailure()) return elem;
JSObject::cast(clone)->set_elements(FixedArray::cast(elem)); JSObject::cast(clone)->set_elements(FixedArray::cast(elem));
} }
// Update properties if necessary. // Update properties if necessary.
if (properties->length() > 0) { if (properties->length() > 0) {
Object* prop = Heap::CopyFixedArray(properties); Object* prop = CopyFixedArray(properties);
if (prop->IsFailure()) return prop; if (prop->IsFailure()) return prop;
JSObject::cast(clone)->set_properties(FixedArray::cast(prop)); JSObject::cast(clone)->set_properties(FixedArray::cast(prop));
} }
...@@ -2107,7 +2107,8 @@ Object* Heap::CopyFixedArray(FixedArray* src) { ...@@ -2107,7 +2107,8 @@ Object* Heap::CopyFixedArray(FixedArray* src) {
FixedArray* result = FixedArray::cast(obj); FixedArray* result = FixedArray::cast(obj);
result->set_length(len); result->set_length(len);
// Copy the content // Copy the content
for (int i = 0; i < len; i++) result->set(i, src->get(i)); FixedArray::WriteBarrierMode mode = result->GetWriteBarrierMode();
for (int i = 0; i < len; i++) result->set(i, src->get(i), mode);
return result; return result;
} }
......
...@@ -3133,8 +3133,9 @@ static Object* Runtime_NewArguments(Arguments args) { ...@@ -3133,8 +3133,9 @@ static Object* Runtime_NewArguments(Arguments args) {
if (result->IsFailure()) return result; if (result->IsFailure()) return result;
FixedArray* array = FixedArray::cast(JSObject::cast(result)->elements()); FixedArray* array = FixedArray::cast(JSObject::cast(result)->elements());
ASSERT(array->length() == length); ASSERT(array->length() == length);
FixedArray::WriteBarrierMode mode = array->GetWriteBarrierMode();
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
array->set(i, frame->GetParameter(i)); array->set(i, frame->GetParameter(i), mode);
} }
return result; return result;
} }
...@@ -4865,8 +4866,9 @@ static Handle<Object> GetArgumentsObject(JavaScriptFrame* frame, ...@@ -4865,8 +4866,9 @@ static Handle<Object> GetArgumentsObject(JavaScriptFrame* frame,
Handle<Object> arguments = Factory::NewArgumentsObject(function, length); Handle<Object> arguments = Factory::NewArgumentsObject(function, length);
FixedArray* array = FixedArray::cast(JSObject::cast(*arguments)->elements()); FixedArray* array = FixedArray::cast(JSObject::cast(*arguments)->elements());
ASSERT(array->length() == length); ASSERT(array->length() == length);
FixedArray::WriteBarrierMode mode = array->GetWriteBarrierMode();
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
array->set(i, frame->GetParameter(i)); array->set(i, frame->GetParameter(i), mode);
} }
return arguments; return arguments;
} }
......
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