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

Unified Diff: src/heap.cc

Issue 253393006: WeakHashTable::Put() and callers handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review comments Created 6 years, 8 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.h ('k') | src/lithium-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index d80e2f93b13017654c251460c93230728786cd55..e9de684199de6cba9acd10dd3e9ce302caa7befc 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -5672,20 +5672,20 @@ void Heap::RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback) {
}
-MaybeObject* Heap::AddWeakObjectToCodeDependency(Object* obj,
- DependentCode* dep) {
- ASSERT(!InNewSpace(obj));
- ASSERT(!InNewSpace(dep));
- MaybeObject* maybe_obj =
- WeakHashTable::cast(weak_object_to_code_table_)->Put(obj, dep);
- WeakHashTable* table;
- if (!maybe_obj->To(&table)) return maybe_obj;
- if (ShouldZapGarbage() && weak_object_to_code_table_ != table) {
+// TODO(ishell): Find a better place for this.
+void Heap::AddWeakObjectToCodeDependency(Handle<Object> obj,
+ Handle<DependentCode> dep) {
+ ASSERT(!InNewSpace(*obj));
+ ASSERT(!InNewSpace(*dep));
+ Handle<WeakHashTable> table(WeakHashTable::cast(weak_object_to_code_table_),
+ isolate());
+ table = WeakHashTable::Put(table, obj, dep);
+
+ if (ShouldZapGarbage() && weak_object_to_code_table_ != *table) {
WeakHashTable::cast(weak_object_to_code_table_)->Zap(the_hole_value());
}
- set_weak_object_to_code_table(table);
- ASSERT_EQ(dep, WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj));
- return weak_object_to_code_table_;
+ set_weak_object_to_code_table(*table);
+ ASSERT_EQ(*dep, table->Lookup(*obj));
}
« no previous file with comments | « src/heap.h ('k') | src/lithium-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698