Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: src/heap.cc

Issue 8816020: More removal of write barriers and a rename to a less scary name. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 10174)
+++ src/heap.cc (working copy)
@@ -1813,7 +1813,7 @@
}
Map* map = reinterpret_cast<Map*>(result);
- map->set_map_unsafe(meta_map());
+ map->set_map_no_wb(meta_map());
map->set_instance_type(instance_type);
map->set_visitor_id(
StaticVisitorBase::GetVisitorId(instance_type, instance_size));
@@ -2173,7 +2173,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- HeapObject::cast(result)->set_map_unsafe(heap_number_map());
+ HeapObject::cast(result)->set_map_no_wb(heap_number_map());
HeapNumber::cast(result)->set_value(value);
return result;
}
@@ -2191,7 +2191,7 @@
{ MaybeObject* maybe_result = new_space_.AllocateRaw(HeapNumber::kSize);
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- HeapObject::cast(result)->set_map_unsafe(heap_number_map());
+ HeapObject::cast(result)->set_map_no_wb(heap_number_map());
HeapNumber::cast(result)->set_value(value);
return result;
}
@@ -2202,7 +2202,7 @@
{ MaybeObject* maybe_result = AllocateRawCell();
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- HeapObject::cast(result)->set_map_unsafe(global_property_cell_map());
+ HeapObject::cast(result)->set_map_no_wb(global_property_cell_map());
JSGlobalPropertyCell::cast(result)->set_value(value);
return result;
}
@@ -2543,7 +2543,7 @@
}
}
}
- array->set_map(heap->fixed_cow_array_map());
+ array->set_map_no_wb(heap->fixed_cow_array_map());
}
@@ -3139,7 +3139,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- reinterpret_cast<ByteArray*>(result)->set_map_unsafe(byte_array_map());
+ reinterpret_cast<ByteArray*>(result)->set_map_no_wb(byte_array_map());
reinterpret_cast<ByteArray*>(result)->set_length(length);
return result;
}
@@ -3157,7 +3157,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- reinterpret_cast<ByteArray*>(result)->set_map_unsafe(byte_array_map());
+ reinterpret_cast<ByteArray*>(result)->set_map_no_wb(byte_array_map());
reinterpret_cast<ByteArray*>(result)->set_length(length);
return result;
}
@@ -3167,11 +3167,11 @@
if (size == 0) return;
HeapObject* filler = HeapObject::FromAddress(addr);
if (size == kPointerSize) {
- filler->set_map_unsafe(one_pointer_filler_map());
+ filler->set_map_no_wb(one_pointer_filler_map());
} else if (size == 2 * kPointerSize) {
- filler->set_map_unsafe(two_pointer_filler_map());
+ filler->set_map_no_wb(two_pointer_filler_map());
} else {
- filler->set_map_unsafe(free_space_map());
+ filler->set_map_no_wb(free_space_map());
FreeSpace::cast(filler)->set_size(size);
}
}
@@ -3189,7 +3189,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- reinterpret_cast<ExternalArray*>(result)->set_map_unsafe(
+ reinterpret_cast<ExternalArray*>(result)->set_map_no_wb(
MapForExternalArrayType(array_type));
reinterpret_cast<ExternalArray*>(result)->set_length(length);
reinterpret_cast<ExternalArray*>(result)->set_external_pointer(
@@ -3226,7 +3226,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
// Initialize the object
- HeapObject::cast(result)->set_map_unsafe(code_map());
+ HeapObject::cast(result)->set_map_no_wb(code_map());
Code* code = Code::cast(result);
ASSERT(!isolate_->code_range()->exists() ||
isolate_->code_range()->contains(code->address()));
@@ -3355,7 +3355,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
// No need for write barrier since object is white and map is in old space.
- HeapObject::cast(result)->set_map_unsafe(map);
+ HeapObject::cast(result)->set_map_no_wb(map);
return result;
}
@@ -4084,7 +4084,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- reinterpret_cast<HeapObject*>(result)->set_map_unsafe(map);
+ reinterpret_cast<HeapObject*>(result)->set_map_no_wb(map);
// Set length and hash fields of the allocated string.
String* answer = String::cast(result);
answer->set_length(chars);
@@ -4128,7 +4128,7 @@
}
// Partially initialize the object.
- HeapObject::cast(result)->set_map_unsafe(ascii_string_map());
+ HeapObject::cast(result)->set_map_no_wb(ascii_string_map());
String::cast(result)->set_length(length);
String::cast(result)->set_hash_field(String::kEmptyHashField);
ASSERT_EQ(size, HeapObject::cast(result)->Size());
@@ -4163,7 +4163,7 @@
}
// Partially initialize the object.
- HeapObject::cast(result)->set_map_unsafe(string_map());
+ HeapObject::cast(result)->set_map_no_wb(string_map());
String::cast(result)->set_length(length);
String::cast(result)->set_hash_field(String::kEmptyHashField);
ASSERT_EQ(size, HeapObject::cast(result)->Size());
@@ -4179,7 +4179,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
// Initialize the object.
- reinterpret_cast<FixedArray*>(result)->set_map_unsafe(fixed_array_map());
+ reinterpret_cast<FixedArray*>(result)->set_map_no_wb(fixed_array_map());
reinterpret_cast<FixedArray*>(result)->set_length(0);
return result;
}
@@ -4208,13 +4208,13 @@
}
if (InNewSpace(obj)) {
HeapObject* dst = HeapObject::cast(obj);
- dst->set_map_unsafe(map);
+ dst->set_map_no_wb(map);
CopyBlock(dst->address() + kPointerSize,
src->address() + kPointerSize,
FixedArray::SizeFor(len) - kPointerSize);
return obj;
}
- HeapObject::cast(obj)->set_map_unsafe(map);
+ HeapObject::cast(obj)->set_map_no_wb(map);
FixedArray* result = FixedArray::cast(obj);
result->set_length(len);
@@ -4234,7 +4234,7 @@
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
}
HeapObject* dst = HeapObject::cast(obj);
- dst->set_map_unsafe(map);
+ dst->set_map_no_wb(map);
CopyBlock(
dst->address() + FixedDoubleArray::kLengthOffset,
src->address() + FixedDoubleArray::kLengthOffset,
@@ -4252,7 +4252,7 @@
}
// Initialize header.
FixedArray* array = reinterpret_cast<FixedArray*>(result);
- array->set_map_unsafe(fixed_array_map());
+ array->set_map_no_wb(fixed_array_map());
array->set_length(length);
// Initialize body.
ASSERT(!InNewSpace(undefined_value()));
@@ -4300,7 +4300,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- HeapObject::cast(result)->set_map_unsafe(heap->fixed_array_map());
+ HeapObject::cast(result)->set_map_no_wb(heap->fixed_array_map());
FixedArray* array = FixedArray::cast(result);
array->set_length(length);
MemsetPointer(array->data_start(), filler, length);
@@ -4333,7 +4333,7 @@
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
}
- reinterpret_cast<FixedArray*>(obj)->set_map_unsafe(fixed_array_map());
+ reinterpret_cast<FixedArray*>(obj)->set_map_no_wb(fixed_array_map());
FixedArray::cast(obj)->set_length(length);
return obj;
}
@@ -4347,7 +4347,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
// Initialize the object.
- reinterpret_cast<FixedDoubleArray*>(result)->set_map_unsafe(
+ reinterpret_cast<FixedDoubleArray*>(result)->set_map_no_wb(
fixed_double_array_map());
reinterpret_cast<FixedDoubleArray*>(result)->set_length(0);
return result;
@@ -4364,7 +4364,7 @@
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
}
- reinterpret_cast<FixedDoubleArray*>(obj)->set_map_unsafe(
+ reinterpret_cast<FixedDoubleArray*>(obj)->set_map_no_wb(
fixed_double_array_map());
FixedDoubleArray::cast(obj)->set_length(length);
return obj;
@@ -4401,7 +4401,7 @@
{ MaybeObject* maybe_result = AllocateFixedArray(length, pretenure);
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- reinterpret_cast<HeapObject*>(result)->set_map_unsafe(hash_table_map());
+ reinterpret_cast<HeapObject*>(result)->set_map_no_wb(hash_table_map());
ASSERT(result->IsHashTable());
return result;
}
@@ -4414,7 +4414,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
Context* context = reinterpret_cast<Context*>(result);
- context->set_map_unsafe(global_context_map());
+ context->set_map_no_wb(global_context_map());
ASSERT(context->IsGlobalContext());
ASSERT(result->IsContext());
return result;
@@ -4428,7 +4428,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
Context* context = reinterpret_cast<Context*>(result);
- context->set_map_unsafe(function_context_map());
+ context->set_map_no_wb(function_context_map());
context->set_closure(function);
context->set_previous(function->context());
context->set_extension(NULL);
@@ -4448,7 +4448,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
Context* context = reinterpret_cast<Context*>(result);
- context->set_map_unsafe(catch_context_map());
+ context->set_map_no_wb(catch_context_map());
context->set_closure(function);
context->set_previous(previous);
context->set_extension(name);
@@ -4466,7 +4466,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
Context* context = reinterpret_cast<Context*>(result);
- context->set_map_unsafe(with_context_map());
+ context->set_map_no_wb(with_context_map());
context->set_closure(function);
context->set_previous(previous);
context->set_extension(extension);
@@ -4484,7 +4484,7 @@
if (!maybe_result->ToObject(&result)) return maybe_result;
}
Context* context = reinterpret_cast<Context*>(result);
- context->set_map_unsafe(block_context_map());
+ context->set_map_no_wb(block_context_map());
context->set_closure(function);
context->set_previous(previous);
context->set_extension(scope_info);
@@ -4497,7 +4497,7 @@
FixedArray* scope_info;
MaybeObject* maybe_scope_info = AllocateFixedArray(length, TENURED);
if (!maybe_scope_info->To(&scope_info)) return maybe_scope_info;
- scope_info->set_map_unsafe(scope_info_map());
+ scope_info->set_map_no_wb(scope_info_map());
return scope_info;
}
@@ -5414,7 +5414,7 @@
Address map_addr = map_p->address();
- obj->set_map(reinterpret_cast<Map*>(map_addr + kMarkTag));
+ obj->set_map_no_wb(reinterpret_cast<Map*>(map_addr + kMarkTag));
MarkObjectRecursively(&map);
@@ -5461,7 +5461,7 @@
HeapObject* map_p = HeapObject::FromAddress(map_addr);
- obj->set_map(reinterpret_cast<Map*>(map_p));
+ obj->set_map_no_wb(reinterpret_cast<Map*>(map_p));
UnmarkObjectRecursively(reinterpret_cast<Object**>(&map_p));
@@ -6173,7 +6173,7 @@
Address map_addr = map_p->address();
- obj->set_map(reinterpret_cast<Map*>(map_addr + kMarkTag));
+ obj->set_map_no_wb(reinterpret_cast<Map*>(map_addr + kMarkTag));
// Scan the object body.
if (is_global_context && (visit_mode_ == VISIT_ONLY_STRONG)) {
@@ -6215,7 +6215,7 @@
HeapObject* map_p = HeapObject::FromAddress(map_addr);
- obj->set_map(reinterpret_cast<Map*>(map_p));
+ obj->set_map_no_wb(reinterpret_cast<Map*>(map_p));
UnmarkRecursively(reinterpret_cast<Object**>(&map_p), unmark_visitor);
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698