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

Unified Diff: src/lithium-codegen.cc

Issue 117483002: Make cells pointing to JSObjects weak in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Set number of gcs to 4 Created 6 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 | « src/heap.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-codegen.cc
diff --git a/src/lithium-codegen.cc b/src/lithium-codegen.cc
index 84e95888ea86fd5d6d94029f6ebf716d16062123..2d71d13c69fd9536203e99f40b88dee006b85bc0 100644
--- a/src/lithium-codegen.cc
+++ b/src/lithium-codegen.cc
@@ -150,15 +150,26 @@ int LCodeGenBase::GetNextEmittedBlock() const {
void LCodeGenBase::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) {
ZoneList<Handle<Map> > maps(1, zone());
ZoneList<Handle<JSObject> > objects(1, zone());
- int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
+ ZoneList<Handle<Cell> > cells(1, zone());
+ int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
+ RelocInfo::ModeMask(RelocInfo::CELL);
for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
- if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) {
+ RelocInfo::Mode mode = it.rinfo()->rmode();
+ if (mode == RelocInfo::CELL &&
+ Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_cell())) {
+ Handle<Cell> cell(it.rinfo()->target_cell());
+ cells.Add(cell, zone());
+ } else if (mode == RelocInfo::EMBEDDED_OBJECT &&
+ Code::IsWeakEmbeddedObject(code->kind(), 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()));
objects.Add(object, zone());
+ } else if (it.rinfo()->target_object()->IsCell()) {
+ Handle<Cell> cell(Cell::cast(it.rinfo()->target_object()));
+ cells.Add(cell, zone());
}
}
}
@@ -174,6 +185,9 @@ void LCodeGenBase::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) {
for (int i = 0; i < objects.length(); i++) {
AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code);
}
+ for (int i = 0; i < cells.length(); i++) {
+ AddWeakObjectToCodeDependency(isolate()->heap(), cells.at(i), code);
+ }
}
« no previous file with comments | « src/heap.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698