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

Unified Diff: src/objects.cc

Issue 250023002: Dictionary::DeleteProperty() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/objects.h ('k') | no next file » | 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 a788361d561db40897ea4541f812d2b8f900af8b..ca3a9feeba82c1c571abc7446dd667d65a5ecfe7 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -725,7 +725,8 @@ Handle<Object> JSObject::DeleteNormalizedProperty(Handle<JSObject> object,
PropertyCell::SetValueInferType(cell, value);
dictionary->DetailsAtPut(entry, details.AsDeleted());
} else {
- Handle<Object> deleted(dictionary->DeleteProperty(entry, mode), isolate);
+ Handle<Object> deleted(
+ NameDictionary::DeleteProperty(dictionary, entry, mode));
if (*deleted == isolate->heap()->true_value()) {
Handle<NameDictionary> new_properties =
NameDictionary::Shrink(dictionary, *name);
@@ -14924,28 +14925,13 @@ Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
SeededNumberDictionaryShape,
uint32_t>::SortMode);
-template Object*
-Dictionary<NameDictionary, NameDictionaryShape, Name*>::DeleteProperty(
- int, JSObject::DeleteMode);
-
template Handle<Object>
Dictionary<NameDictionary, NameDictionaryShape, Name*>::DeleteProperty(
- Handle<Dictionary<NameDictionary, NameDictionaryShape, Name*> >,
- int,
- JSObject::DeleteMode);
-
-template Object*
-Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
- DeleteProperty(int, JSObject::DeleteMode);
+ Handle<NameDictionary>, int, JSObject::DeleteMode);
template Handle<Object>
Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
- DeleteProperty(
- Handle<Dictionary<SeededNumberDictionary,
- SeededNumberDictionaryShape,
- uint32_t> >,
- int,
- JSObject::DeleteMode);
+ DeleteProperty(Handle<SeededNumberDictionary>, int, JSObject::DeleteMode);
template Handle<NameDictionary>
HashTable<NameDictionary, NameDictionaryShape, Name*>::
@@ -15855,31 +15841,21 @@ Handle<Derived> Dictionary<Derived, Shape, Key>::EnsureCapacity(
}
-// TODO(ishell): Temporary wrapper until handlified.
template<typename Derived, typename Shape, typename Key>
Handle<Object> Dictionary<Derived, Shape, Key>::DeleteProperty(
- Handle<Dictionary<Derived, Shape, Key> > dictionary,
+ Handle<Derived> dictionary,
int entry,
JSObject::DeleteMode mode) {
- CALL_HEAP_FUNCTION(dictionary->GetIsolate(),
- dictionary->DeleteProperty(entry, mode),
- Object);
-}
-
-
-template<typename Derived, typename Shape, typename Key>
-Object* Dictionary<Derived, Shape, Key>::DeleteProperty(
- int entry,
- JSReceiver::DeleteMode mode) {
- Heap* heap = Dictionary::GetHeap();
- PropertyDetails details = DetailsAt(entry);
+ Factory* factory = dictionary->GetIsolate()->factory();
+ PropertyDetails details = dictionary->DetailsAt(entry);
// Ignore attributes if forcing a deletion.
if (details.IsDontDelete() && mode != JSReceiver::FORCE_DELETION) {
- return heap->false_value();
+ return factory->false_value();
}
- SetEntry(entry, heap->the_hole_value(), heap->the_hole_value());
- DerivedHashTable::ElementRemoved();
- return heap->true_value();
+ dictionary->SetEntry(
+ entry, *factory->the_hole_value(), *factory->the_hole_value());
+ dictionary->ElementRemoved();
+ return factory->true_value();
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698