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

Unified Diff: src/objects.cc

Issue 771033003: Revert of Use weak cells in map checks in polymorphic ICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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 | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index d3e58e8a000da26a8c20b52cd1b54a3582db701c..89451524076a19e5a7356515e00db8c9e2304bb7 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1574,14 +1574,6 @@
HeapStringAllocator allocator;
StringStream accumulator(&allocator);
PropertyCell::cast(this)->value()->ShortPrint(&accumulator);
- os << accumulator.ToCString().get();
- break;
- }
- case WEAK_CELL_TYPE: {
- os << "WeakCell for ";
- HeapStringAllocator allocator;
- StringStream accumulator(&allocator);
- WeakCell::cast(this)->value()->ShortPrint(&accumulator);
os << accumulator.ToCString().get();
break;
}
@@ -3430,21 +3422,6 @@
}
return false;
-}
-
-
-Handle<WeakCell> Map::WeakCellForMap(Handle<Map> map) {
- Isolate* isolate = map->GetIsolate();
- if (map->code_cache()->IsFixedArray()) {
- return isolate->factory()->NewWeakCell(map);
- }
- Handle<CodeCache> code_cache(CodeCache::cast(map->code_cache()), isolate);
- if (code_cache->weak_cell_cache()->IsWeakCell()) {
- return Handle<WeakCell>(WeakCell::cast(code_cache->weak_cell_cache()));
- }
- Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(map);
- code_cache->set_weak_cell_cache(*weak_cell);
- return weak_cell;
}
@@ -10590,7 +10567,6 @@
for (RelocIterator it(this, mask); !it.done(); it.next()) {
RelocInfo* info = it.rinfo();
Object* object = info->target_object();
- if (object->IsWeakCell()) object = WeakCell::cast(object)->value();
if (object->IsHeapObject()) {
if (HeapObject::cast(object)->map() == match_map) {
if (--n == 0) return object;
@@ -10623,7 +10599,6 @@
RelocInfo* info = it.rinfo();
Object* object = info->target_object();
if (object->IsHeapObject()) {
- DCHECK(!object->IsWeakCell());
Map* map = HeapObject::cast(object)->map();
if (map == *pattern.find_[current_pattern]) {
info->set_target_object(*pattern.replace_[current_pattern]);
@@ -10642,7 +10617,6 @@
for (RelocIterator it(this, mask); !it.done(); it.next()) {
RelocInfo* info = it.rinfo();
Object* object = info->target_object();
- if (object->IsWeakCell()) object = WeakCell::cast(object)->value();
if (object->IsMap()) maps->Add(handle(Map::cast(object)));
}
}
@@ -10651,21 +10625,11 @@
Code* Code::FindFirstHandler() {
DCHECK(is_inline_cache_stub());
DisallowHeapAllocation no_allocation;
- int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
- RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
- bool skip_next_handler = false;
+ int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET);
for (RelocIterator it(this, mask); !it.done(); it.next()) {
RelocInfo* info = it.rinfo();
- if (info->rmode() == RelocInfo::EMBEDDED_OBJECT) {
- Object* obj = info->target_object();
- skip_next_handler |= obj->IsWeakCell() && WeakCell::cast(obj)->cleared();
- } else {
- Code* code = Code::GetCodeFromTargetAddress(info->target_address());
- if (code->kind() == Code::HANDLER) {
- if (!skip_next_handler) return code;
- skip_next_handler = false;
- }
- }
+ Code* code = Code::GetCodeFromTargetAddress(info->target_address());
+ if (code->kind() == Code::HANDLER) return code;
}
return NULL;
}
@@ -10674,27 +10638,17 @@
bool Code::FindHandlers(CodeHandleList* code_list, int length) {
DCHECK(is_inline_cache_stub());
DisallowHeapAllocation no_allocation;
- int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
- RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
- bool skip_next_handler = false;
+ int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET);
int i = 0;
for (RelocIterator it(this, mask); !it.done(); it.next()) {
if (i == length) return true;
RelocInfo* info = it.rinfo();
- if (info->rmode() == RelocInfo::EMBEDDED_OBJECT) {
- Object* obj = info->target_object();
- skip_next_handler |= obj->IsWeakCell() && WeakCell::cast(obj)->cleared();
- } else {
- Code* code = Code::GetCodeFromTargetAddress(info->target_address());
- // IC stubs with handlers never contain non-handler code objects before
- // handler targets.
- if (code->kind() != Code::HANDLER) break;
- if (!skip_next_handler) {
- code_list->Add(Handle<Code>(code));
- i++;
- }
- skip_next_handler = false;
- }
+ Code* code = Code::GetCodeFromTargetAddress(info->target_address());
+ // IC stubs with handlers never contain non-handler code objects before
+ // handler targets.
+ if (code->kind() != Code::HANDLER) break;
+ code_list->Add(Handle<Code>(code));
+ i++;
}
return i == length;
}
@@ -10709,7 +10663,6 @@
RelocInfo* info = it.rinfo();
if (info->rmode() == RelocInfo::EMBEDDED_OBJECT) {
Object* object = info->target_object();
- if (object->IsWeakCell()) object = WeakCell::cast(object)->value();
if (object == map) return_next = true;
} else if (return_next) {
Code* code = Code::GetCodeFromTargetAddress(info->target_address());
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698