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

Unified Diff: src/lithium.cc

Issue 882913006: Make functions contexts in optimized code weak. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months 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/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium.cc
diff --git a/src/lithium.cc b/src/lithium.cc
index 43d690c0c74c827225ffd711970603d4f5ea538d..f840b7c13653d3404edfafc201802f309bad7f94 100644
--- a/src/lithium.cc
+++ b/src/lithium.cc
@@ -427,27 +427,23 @@ static void AddWeakObjectToCodeDependency(Isolate* isolate,
void LChunk::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) const {
DCHECK(code->is_optimized_code());
ZoneList<Handle<Map> > maps(1, zone());
- ZoneList<Handle<JSObject> > objects(1, zone());
- ZoneList<Handle<Cell> > cells(1, zone());
+ ZoneList<Handle<HeapObject> > objects(1, zone());
int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::CELL);
for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
RelocInfo::Mode mode = it.rinfo()->rmode();
if (mode == RelocInfo::CELL &&
code->IsWeakObjectInOptimizedCode(it.rinfo()->target_cell())) {
- Handle<Cell> cell(it.rinfo()->target_cell());
- cells.Add(cell, zone());
+ objects.Add(Handle<HeapObject>(it.rinfo()->target_cell()), zone());
} else if (mode == RelocInfo::EMBEDDED_OBJECT &&
code->IsWeakObjectInOptimizedCode(it.rinfo()->target_object())) {
if (it.rinfo()->target_object()->IsMap()) {
Handle<Map> map(Map::cast(it.rinfo()->target_object()));
maps.Add(map, zone());
- } else if (it.rinfo()->target_object()->IsJSObject()) {
- Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object()));
+ } else {
+ Handle<HeapObject> object(
+ HeapObject::cast(it.rinfo()->target_object()));
objects.Add(object, zone());
- } else if (it.rinfo()->target_object()->IsCell()) {
- Handle<Cell> cell(Cell::cast(it.rinfo()->target_object()));
- cells.Add(cell, zone());
}
}
}
@@ -457,9 +453,6 @@ void LChunk::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) const {
for (int i = 0; i < objects.length(); i++) {
AddWeakObjectToCodeDependency(isolate(), objects.at(i), code);
}
- for (int i = 0; i < cells.length(); i++) {
- AddWeakObjectToCodeDependency(isolate(), cells.at(i), code);
- }
if (FLAG_enable_ool_constant_pool) {
code->constant_pool()->set_weak_object_state(
ConstantPoolArray::WEAK_OBJECTS_IN_OPTIMIZED_CODE);
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698