Commit 296afb3e authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Remove more superfluous write barriers.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10032 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5c1044bb
......@@ -9962,8 +9962,8 @@ void FixedArray::SwapPairs(FixedArray* numbers, int i, int j) {
set(j, temp);
if (this != numbers) {
temp = numbers->get(i);
numbers->set(i, numbers->get(j));
numbers->set(j, temp);
numbers->set(i, Smi::cast(numbers->get(j)));
numbers->set(j, Smi::cast(temp));
}
}
......
......@@ -1794,11 +1794,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpInitializeObject) {
JSFunction::cast(constructor)->initial_map() == map) {
// If we still have the original map, set in-object properties directly.
regexp->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex, source);
// TODO(lrn): Consider skipping write barrier on booleans as well.
// Both true and false should be in oldspace at all times.
regexp->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, global);
regexp->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, ignoreCase);
regexp->InObjectPropertyAtPut(JSRegExp::kMultilineFieldIndex, multiline);
// Both true and false are immovable immortal objects so no need for write
// barrier.
regexp->InObjectPropertyAtPut(
JSRegExp::kGlobalFieldIndex, global, SKIP_WRITE_BARRIER);
regexp->InObjectPropertyAtPut(
JSRegExp::kIgnoreCaseFieldIndex, ignoreCase, SKIP_WRITE_BARRIER);
regexp->InObjectPropertyAtPut(
JSRegExp::kMultilineFieldIndex, multiline, SKIP_WRITE_BARRIER);
regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex,
Smi::FromInt(0),
SKIP_WRITE_BARRIER); // It's a Smi.
......
......@@ -1658,14 +1658,14 @@ void FreeListNode::set_size(Heap* heap, int size_in_bytes) {
// field and a next pointer, we give it a filler map that gives it the
// correct size.
if (size_in_bytes > FreeSpace::kHeaderSize) {
set_map(heap->raw_unchecked_free_space_map());
set_map_unsafe(heap->raw_unchecked_free_space_map());
// Can't use FreeSpace::cast because it fails during deserialization.
FreeSpace* this_as_free_space = reinterpret_cast<FreeSpace*>(this);
this_as_free_space->set_size(size_in_bytes);
} else if (size_in_bytes == kPointerSize) {
set_map(heap->raw_unchecked_one_pointer_filler_map());
set_map_unsafe(heap->raw_unchecked_one_pointer_filler_map());
} else if (size_in_bytes == 2 * kPointerSize) {
set_map(heap->raw_unchecked_two_pointer_filler_map());
set_map_unsafe(heap->raw_unchecked_two_pointer_filler_map());
} else {
UNREACHABLE();
}
......
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