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

Unified Diff: src/crankshaft/lithium.cc

Issue 1555743003: [turbofan] Port Crankshaft's weak objects mechanism to TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 12 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/crankshaft/lithium.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/crankshaft/lithium.cc
diff --git a/src/crankshaft/lithium.cc b/src/crankshaft/lithium.cc
index 0a940d5b164986fe87b9ef72f4cfcf8b941ab4ca..82ad6962be43e121badea6907aa1e62f9b5010f2 100644
--- a/src/crankshaft/lithium.cc
+++ b/src/crankshaft/lithium.cc
@@ -406,53 +406,6 @@ Representation LChunk::LookupLiteralRepresentation(
}
-static void AddWeakObjectToCodeDependency(Isolate* isolate,
- Handle<HeapObject> object,
- Handle<Code> code) {
- Handle<WeakCell> cell = Code::WeakCellFor(code);
- Heap* heap = isolate->heap();
- Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(object));
- dep = DependentCode::InsertWeakCode(dep, DependentCode::kWeakCodeGroup, cell);
- heap->AddWeakObjectToCodeDependency(object, dep);
-}
-
-
-void LChunk::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) const {
- DCHECK(code->is_optimized_code());
- ZoneList<Handle<Map> > maps(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())) {
- 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 {
- Handle<HeapObject> object(
- HeapObject::cast(it.rinfo()->target_object()));
- objects.Add(object, zone());
- }
- }
- }
- for (int i = 0; i < maps.length(); i++) {
- if (maps.at(i)->dependent_code()->IsEmpty(DependentCode::kWeakCodeGroup)) {
- isolate()->heap()->AddRetainedMap(maps.at(i));
- }
- Map::AddDependentCode(maps.at(i), DependentCode::kWeakCodeGroup, code);
- }
- for (int i = 0; i < objects.length(); i++) {
- AddWeakObjectToCodeDependency(isolate(), objects.at(i), code);
- }
- code->set_can_have_weak_objects(true);
-}
-
-
void LChunk::CommitDependencies(Handle<Code> code) const {
if (!code->is_optimized_code()) return;
HandleScope scope(isolate());
@@ -470,7 +423,6 @@ void LChunk::CommitDependencies(Handle<Code> code) const {
}
info_->dependencies()->Commit(code);
- RegisterWeakObjectsInOptimizedCode(code);
}
« no previous file with comments | « src/crankshaft/lithium.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698