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

Unified Diff: src/runtime.cc

Issue 309663005: Split Put into Put and Remove (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix comments Created 6 years, 7 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
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index c5b60e91d2aec12f1ac3ba354bb9982938967aec..73929e94d931cd4a772bc9d79f141c07b1b8b5c3 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1643,8 +1643,7 @@ RUNTIME_FUNCTION(Runtime_MapDelete) {
CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
Handle<OrderedHashMap> table(OrderedHashMap::cast(holder->table()));
Handle<Object> lookup(table->Lookup(key), isolate);
- Handle<OrderedHashMap> new_table =
- OrderedHashMap::Put(table, key, isolate->factory()->the_hole_value());
+ Handle<OrderedHashMap> new_table = OrderedHashMap::Remove(table, key);
adamk 2014/05/30 20:13:58 You probably want to use the was_present version h
arv (Not doing code reviews) 2014/05/30 20:53:07 Done.
holder->set_table(*new_table);
return isolate->heap()->ToBoolean(!lookup->IsTheHole());
}
@@ -1760,8 +1759,7 @@ RUNTIME_FUNCTION(Runtime_WeakCollectionDelete) {
weak_collection->table()));
RUNTIME_ASSERT(table->IsKey(*key));
Handle<Object> lookup(table->Lookup(key), isolate);
- Handle<ObjectHashTable> new_table =
- ObjectHashTable::Put(table, key, isolate->factory()->the_hole_value());
+ Handle<ObjectHashTable> new_table = ObjectHashTable::Remove(table, key);
weak_collection->set_table(*new_table);
return isolate->heap()->ToBoolean(!lookup->IsTheHole());
}

Powered by Google App Engine
This is Rietveld 408576698