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

Unified Diff: src/lithium.cc

Issue 871253005: Use weak cells in dependent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 10 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/objects-visiting-inl.h ('k') | src/objects.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 f840b7c13653d3404edfafc201802f309bad7f94..c15e9dbee2612f8e670a036a42357e76302c725e 100644
--- a/src/lithium.cc
+++ b/src/lithium.cc
@@ -414,12 +414,12 @@ Representation LChunk::LookupLiteralRepresentation(
static void AddWeakObjectToCodeDependency(Isolate* isolate,
- Handle<Object> object,
+ Handle<HeapObject> object,
Handle<Code> code) {
+ Handle<WeakCell> cell = Code::WeakCellFor(code);
Heap* heap = isolate->heap();
- heap->EnsureWeakObjectToCodeTable();
Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(object));
- dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code);
+ dep = DependentCode::InsertWeakCode(dep, DependentCode::kWeakCodeGroup, cell);
heap->AddWeakObjectToCodeDependency(object, dep);
}
@@ -462,6 +462,9 @@ void LChunk::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) const {
void LChunk::CommitDependencies(Handle<Code> code) const {
+ if (!code->is_optimized_code()) return;
+ HandleScope scope(isolate());
+
for (MapSet::const_iterator it = deprecation_dependencies_.begin(),
iend = deprecation_dependencies_.end(); it != iend; ++it) {
Handle<Map> map = *it;
@@ -479,7 +482,7 @@ void LChunk::CommitDependencies(Handle<Code> code) const {
}
info_->CommitDependencies(code);
- if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code);
+ RegisterWeakObjectsInOptimizedCode(code);
}
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698