Revision: 21060
Author:   [email protected]
Date:     Tue Apr 29 14:31:12 2014 UTC
Log: WeakHashTable::Lookup() handlified and ObjectHashTable's interface cleaned up.

[email protected]

Review URL: https://codereview.chromium.org/251293002
http://code.google.com/p/v8/source/detail?r=21060

Modified:
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/heap.h
 /branches/bleeding_edge/src/lithium-codegen.cc
 /branches/bleeding_edge/src/objects-debug.cc
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/heap.cc Tue Apr 29 13:58:55 2014 UTC
+++ /branches/bleeding_edge/src/heap.cc Tue Apr 29 14:31:12 2014 UTC
@@ -5505,11 +5505,11 @@
     WeakHashTable::cast(weak_object_to_code_table_)->Zap(the_hole_value());
   }
   set_weak_object_to_code_table(*table);
-  ASSERT_EQ(*dep, table->Lookup(*obj));
+  ASSERT_EQ(*dep, table->Lookup(obj));
 }


-DependentCode* Heap::LookupWeakObjectToCodeDependency(Object* obj) {
+DependentCode* Heap::LookupWeakObjectToCodeDependency(Handle<Object> obj) {
Object* dep = WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj);
   if (dep->IsDependentCode()) return DependentCode::cast(dep);
   return DependentCode::cast(empty_fixed_array());
=======================================
--- /branches/bleeding_edge/src/heap.h  Tue Apr 29 13:58:55 2014 UTC
+++ /branches/bleeding_edge/src/heap.h  Tue Apr 29 14:31:12 2014 UTC
@@ -1485,7 +1485,7 @@
   void AddWeakObjectToCodeDependency(Handle<Object> obj,
                                      Handle<DependentCode> dep);

-  DependentCode* LookupWeakObjectToCodeDependency(Object* obj);
+  DependentCode* LookupWeakObjectToCodeDependency(Handle<Object> obj);

   void InitializeWeakObjectToCodeTable() {
     set_weak_object_to_code_table(undefined_value());
=======================================
--- /branches/bleeding_edge/src/lithium-codegen.cc Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/lithium-codegen.cc Tue Apr 29 14:31:12 2014 UTC
@@ -155,7 +155,7 @@
                                           Handle<Code> code) {
   Heap* heap = isolate->heap();
   heap->EnsureWeakObjectToCodeTable();
- Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); + Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(object));
   dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code);
   heap->AddWeakObjectToCodeDependency(object, dep);
 }
=======================================
--- /branches/bleeding_edge/src/objects-debug.cc Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/objects-debug.cc Tue Apr 29 14:31:12 2014 UTC
@@ -655,6 +655,9 @@

 void Code::VerifyEmbeddedObjectsDependency() {
   if (!CanContainWeakObjects()) return;
+  DisallowHeapAllocation no_gc;
+  Isolate* isolate = GetIsolate();
+  HandleScope scope(isolate);
   int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
   for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
     Object* obj = it.rinfo()->target_object();
@@ -667,7 +670,8 @@
       } else if (obj->IsJSObject()) {
Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table();
         WeakHashTable* table = WeakHashTable::cast(raw_table);
-        CHECK(DependentCode::cast(table->Lookup(obj))->Contains(
+        Handle<Object> key_obj(obj, isolate);
+        CHECK(DependentCode::cast(table->Lookup(key_obj))->Contains(
             DependentCode::kWeakCodeGroup, this));
       }
     }
=======================================
--- /branches/bleeding_edge/src/objects.cc      Tue Apr 29 14:16:38 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Tue Apr 29 14:31:12 2014 UTC
@@ -16049,21 +16049,6 @@
   if (entry == kNotFound) return GetHeap()->the_hole_value();
   return get(EntryToIndex(entry) + 1);
 }
-
-
-// TODO(ishell): Try to remove this when FindEntry(Object* key) is removed
-int ObjectHashTable::FindEntry(Handle<Object> key) {
-  return DerivedHashTable::FindEntry(key);
-}
-
-
-// TODO(ishell): Remove this when all the callers are handlified.
-int ObjectHashTable::FindEntry(Object* key) {
-  DisallowHeapAllocation no_allocation;
-  Isolate* isolate = GetIsolate();
-  HandleScope scope(isolate);
-  return FindEntry(handle(key, isolate));
-}


 Handle<ObjectHashTable> ObjectHashTable::Put(Handle<ObjectHashTable> table,
@@ -16114,27 +16099,13 @@
 }


-Object* WeakHashTable::Lookup(Object* key) {
-  ASSERT(IsKey(key));
+Object* WeakHashTable::Lookup(Handle<Object> key) {
+  DisallowHeapAllocation no_gc;
+  ASSERT(IsKey(*key));
   int entry = FindEntry(key);
   if (entry == kNotFound) return GetHeap()->the_hole_value();
   return get(EntryToValueIndex(entry));
 }
-
-
-// TODO(ishell): Try to remove this when FindEntry(Object* key) is removed
-int WeakHashTable::FindEntry(Handle<Object> key) {
-  return DerivedHashTable::FindEntry(key);
-}
-
-
-// TODO(ishell): Remove this when all the callers are handlified.
-int WeakHashTable::FindEntry(Object* key) {
-  DisallowHeapAllocation no_allocation;
-  Isolate* isolate = GetIsolate();
-  HandleScope scope(isolate);
-  return FindEntry(handle(key, isolate));
-}


 Handle<WeakHashTable> WeakHashTable::Put(Handle<WeakHashTable> table,
=======================================
--- /branches/bleeding_edge/src/objects.h       Tue Apr 29 14:16:38 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Tue Apr 29 14:31:12 2014 UTC
@@ -4202,10 +4202,6 @@
   // returned in case the key is not present.
   Object* Lookup(Handle<Object> key);

-  int FindEntry(Handle<Object> key);
-  // TODO(ishell): Remove this when all the callers are handlified.
-  int FindEntry(Object* key);
-
// Adds (or overwrites) the value associated with the given key. Mapping a
   // key to the hole value causes removal of the whole entry.
   static Handle<ObjectHashTable> Put(Handle<ObjectHashTable> table,
@@ -4431,11 +4427,7 @@

   // Looks up the value associated with the given key. The hole value is
   // returned in case the key is not present.
-  Object* Lookup(Object* key);
-
-  int FindEntry(Handle<Object> key);
-  // TODO(ishell): Remove this when all the callers are handlified.
-  int FindEntry(Object* key);
+  Object* Lookup(Handle<Object> key);

// Adds (or overwrites) the value associated with the given key. Mapping a
   // key to the hole value causes removal of the whole entry.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to