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

Unified Diff: src/objects.cc

Issue 1297273005: Keep track of script objects in a weak fixed array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: do not remove gc. Created 5 years, 4 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/objects.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/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 1f25a5d11b7dcd788a6541e41781eb98e826f6b7..c745cae233c8e7e3a46eb452e6496c230ef8c19f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -14843,49 +14843,6 @@ void WeakHashTable::AddEntry(int entry, Handle<WeakCell> key_cell,
}
-#ifdef DEBUG
-Object* WeakValueHashTable::LookupWeak(Handle<Object> key) {
- Object* value = Lookup(key);
- if (value->IsWeakCell() && !WeakCell::cast(value)->cleared()) {
- value = WeakCell::cast(value)->value();
- }
- return value;
-}
-#endif // DEBUG
-
-
-Handle<WeakValueHashTable> WeakValueHashTable::PutWeak(
- Handle<WeakValueHashTable> table, Handle<Object> key,
- Handle<HeapObject> value) {
- Handle<WeakCell> cell = value->GetIsolate()->factory()->NewWeakCell(value);
- return Handle<WeakValueHashTable>::cast(
- Put(Handle<ObjectHashTable>::cast(table), key, cell));
-}
-
-
-Handle<FixedArray> WeakValueHashTable::GetWeakValues(
- Handle<WeakValueHashTable> table) {
- Isolate* isolate = table->GetIsolate();
- uint32_t capacity = table->Capacity();
- Handle<FixedArray> results = isolate->factory()->NewFixedArray(capacity);
- int length = 0;
- for (uint32_t i = 0; i < capacity; i++) {
- uint32_t key_index = table->EntryToIndex(i);
- Object* key = table->get(key_index);
- if (!table->IsKey(key)) continue;
- uint32_t value_index = table->EntryToValueIndex(i);
- WeakCell* value_cell = WeakCell::cast(table->get(value_index));
- if (value_cell->cleared()) {
- table->RemoveEntry(i);
- } else {
- results->set(length++, value_cell->value());
- }
- }
- results->Shrink(length);
- return results;
-}
-
-
template<class Derived, class Iterator, int entrysize>
Handle<Derived> OrderedHashTable<Derived, Iterator, entrysize>::Allocate(
Isolate* isolate, int capacity, PretenureFlag pretenure) {
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698