Get rid of obsolete unchecked accessors.

R=yangguo@chromium.org
BUG=v8:1490

Review URL: https://codereview.chromium.org/11271020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 889de3b7
......@@ -98,7 +98,7 @@ void CompilationSubCache::Age() {
void CompilationSubCache::IterateFunctions(ObjectVisitor* v) {
Object* undefined = isolate()->heap()->raw_unchecked_undefined_value();
Object* undefined = isolate()->heap()->undefined_value();
for (int i = 0; i < generations_; i++) {
if (tables_[i] != undefined) {
reinterpret_cast<CompilationCacheTable*>(tables_[i])->IterateElements(v);
......
......@@ -503,8 +503,8 @@ class ElementsAccessorBase : public ElementsAccessor {
Map* map = fixed_array_base->map();
// Arrays that have been shifted in place can't be verified.
Heap* heap = holder->GetHeap();
if (map == heap->raw_unchecked_one_pointer_filler_map() ||
map == heap->raw_unchecked_two_pointer_filler_map() ||
if (map == heap->one_pointer_filler_map() ||
map == heap->two_pointer_filler_map() ||
map == heap->free_space_map()) {
return;
}
......
......@@ -484,7 +484,7 @@ Address StackFrame::UnpaddedFP() const {
Code* EntryFrame::unchecked_code() const {
return HEAP->raw_unchecked_js_entry_code();
return HEAP->js_entry_code();
}
......@@ -507,7 +507,7 @@ StackFrame::Type EntryFrame::GetCallerState(State* state) const {
Code* EntryConstructFrame::unchecked_code() const {
return HEAP->raw_unchecked_js_construct_entry_code();
return HEAP->js_construct_entry_code();
}
......
......@@ -607,7 +607,7 @@ void ExternalStringTable::Verify() {
Object* obj = Object::cast(new_space_strings_[i]);
// TODO(yangguo): check that the object is indeed an external string.
ASSERT(heap_->InNewSpace(obj));
ASSERT(obj != HEAP->raw_unchecked_the_hole_value());
ASSERT(obj != HEAP->the_hole_value());
if (obj->IsExternalAsciiString()) {
ExternalAsciiString* string = ExternalAsciiString::cast(obj);
ASSERT(String::IsAscii(string->GetChars(), string->length()));
......@@ -617,7 +617,7 @@ void ExternalStringTable::Verify() {
Object* obj = Object::cast(old_space_strings_[i]);
// TODO(yangguo): check that the object is indeed an external string.
ASSERT(!heap_->InNewSpace(obj));
ASSERT(obj != HEAP->raw_unchecked_the_hole_value());
ASSERT(obj != HEAP->the_hole_value());
if (obj->IsExternalAsciiString()) {
ExternalAsciiString* string = ExternalAsciiString::cast(obj);
ASSERT(String::IsAscii(string->GetChars(), string->length()));
......
......@@ -7206,7 +7206,7 @@ void TranscendentalCache::Clear() {
void ExternalStringTable::CleanUp() {
int last = 0;
for (int i = 0; i < new_space_strings_.length(); ++i) {
if (new_space_strings_[i] == heap_->raw_unchecked_the_hole_value()) {
if (new_space_strings_[i] == heap_->the_hole_value()) {
continue;
}
if (heap_->InNewSpace(new_space_strings_[i])) {
......@@ -7218,7 +7218,7 @@ void ExternalStringTable::CleanUp() {
new_space_strings_.Rewind(last);
last = 0;
for (int i = 0; i < old_space_strings_.length(); ++i) {
if (old_space_strings_[i] == heap_->raw_unchecked_the_hole_value()) {
if (old_space_strings_[i] == heap_->the_hole_value()) {
continue;
}
ASSERT(!heap_->InNewSpace(old_space_strings_[i]));
......
......@@ -628,11 +628,11 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
uint32_t count = 1;
while (true) {
Object* element = symbol_table->KeyAt(entry);
if (element == isolate()->heap()->raw_unchecked_undefined_value()) {
if (element == isolate()->heap()->undefined_value()) {
// Lookup failure.
break;
}
if (element != isolate()->heap()->raw_unchecked_the_hole_value() &&
if (element != isolate()->heap()->the_hole_value() &&
String::cast(element)->IsAsciiEqualTo(string_vector)) {
// Lookup success, update the current position.
position_ = position;
......
......@@ -660,8 +660,8 @@ bool Object::IsDictionary() {
bool Object::IsSymbolTable() {
return IsHashTable() && this ==
HeapObject::cast(this)->GetHeap()->raw_unchecked_symbol_table();
return IsHashTable() &&
this == HeapObject::cast(this)->GetHeap()->raw_unchecked_symbol_table();
}
......@@ -1850,7 +1850,7 @@ void FixedArray::set(int index,
void FixedArray::NoIncrementalWriteBarrierSet(FixedArray* array,
int index,
Object* value) {
ASSERT(array->map() != HEAP->raw_unchecked_fixed_cow_array_map());
ASSERT(array->map() != HEAP->fixed_cow_array_map());
ASSERT(index >= 0 && index < array->length());
int offset = kHeaderSize + index * kPointerSize;
WRITE_FIELD(array, offset, value);
......@@ -1864,7 +1864,7 @@ void FixedArray::NoIncrementalWriteBarrierSet(FixedArray* array,
void FixedArray::NoWriteBarrierSet(FixedArray* array,
int index,
Object* value) {
ASSERT(array->map() != HEAP->raw_unchecked_fixed_cow_array_map());
ASSERT(array->map() != HEAP->fixed_cow_array_map());
ASSERT(index >= 0 && index < array->length());
ASSERT(!HEAP->InNewSpace(value));
WRITE_FIELD(array, kHeaderSize + index * kPointerSize, value);
......@@ -2291,8 +2291,8 @@ int HashTable<Shape, Key>::FindEntry(Isolate* isolate, Key key) {
while (true) {
Object* element = KeyAt(entry);
// Empty entry.
if (element == isolate->heap()->raw_unchecked_undefined_value()) break;
if (element != isolate->heap()->raw_unchecked_the_hole_value() &&
if (element == isolate->heap()->undefined_value()) break;
if (element != isolate->heap()->the_hole_value() &&
Shape::IsMatch(key, element)) return entry;
entry = NextProbe(entry, count++, capacity);
}
......@@ -5252,8 +5252,8 @@ void Map::ClearCodeCache(Heap* heap) {
// Please note this function is used during marking:
// - MarkCompactCollector::MarkUnmarkedObject
// - IncrementalMarking::Step
ASSERT(!heap->InNewSpace(heap->raw_unchecked_empty_fixed_array()));
WRITE_FIELD(this, kCodeCacheOffset, heap->raw_unchecked_empty_fixed_array());
ASSERT(!heap->InNewSpace(heap->empty_fixed_array()));
WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array());
}
......@@ -5347,7 +5347,7 @@ Handle<Object> TypeFeedbackCells::MegamorphicSentinel(Isolate* isolate) {
Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) {
return heap->raw_unchecked_the_hole_value();
return heap->the_hole_value();
}
......
......@@ -8105,7 +8105,7 @@ void SharedFunctionInfo::DetachInitialMap() {
// constructor is called. The countdown will continue and (possibly after
// several more GCs) CompleteInobjectSlackTracking will eventually be called.
Heap* heap = map->GetHeap();
set_initial_map(heap->raw_unchecked_undefined_value());
set_initial_map(heap->undefined_value());
Builtins* builtins = heap->isolate()->builtins();
ASSERT_EQ(builtins->builtin(Builtins::kJSConstructStubCountdown),
*RawField(this, kConstructStubOffset));
......
......@@ -2443,19 +2443,17 @@ bool V8HeapExplorer::IterateAndExtractReferences(
bool V8HeapExplorer::IsEssentialObject(Object* object) {
// We have to use raw_unchecked_* versions because checked versions
// would fail during iteration over object properties.
return object->IsHeapObject()
&& !object->IsOddball()
&& object != heap_->raw_unchecked_empty_byte_array()
&& object != heap_->raw_unchecked_empty_fixed_array()
&& object != heap_->raw_unchecked_empty_descriptor_array()
&& object != heap_->raw_unchecked_fixed_array_map()
&& object != heap_->raw_unchecked_global_property_cell_map()
&& object != heap_->raw_unchecked_shared_function_info_map()
&& object != heap_->raw_unchecked_free_space_map()
&& object != heap_->raw_unchecked_one_pointer_filler_map()
&& object != heap_->raw_unchecked_two_pointer_filler_map();
&& object != heap_->empty_byte_array()
&& object != heap_->empty_fixed_array()
&& object != heap_->empty_descriptor_array()
&& object != heap_->fixed_array_map()
&& object != heap_->global_property_cell_map()
&& object != heap_->shared_function_info_map()
&& object != heap_->free_space_map()
&& object != heap_->one_pointer_filler_map()
&& object != heap_->two_pointer_filler_map();
}
......
......@@ -1297,7 +1297,7 @@ void PartialSerializer::SerializeObject(
// The code-caches link to context-specific code objects, which
// the startup and context serializes cannot currently handle.
ASSERT(Map::cast(heap_object)->code_cache() ==
heap_object->GetHeap()->raw_unchecked_empty_fixed_array());
heap_object->GetHeap()->empty_fixed_array());
}
int root_index;
......
......@@ -747,10 +747,8 @@ Code* StubCache::FindCallInitialize(int argc,
CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT);
Code::Flags flags =
Code::ComputeFlags(kind, UNINITIALIZED, extra_state, Code::NORMAL, argc);
// Use raw_unchecked... so we don't get assert failures during GC.
UnseededNumberDictionary* dictionary =
isolate()->heap()->raw_unchecked_non_monomorphic_cache();
isolate()->heap()->non_monomorphic_cache();
int entry = dictionary->FindEntry(isolate(), flags);
ASSERT(entry != -1);
Object* code = dictionary->ValueAt(entry);
......
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