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

Unified Diff: src/lookup.cc

Issue 1218813012: Cleanup Delete backend implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/lookup.h ('k') | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index 53aa21dc490c58c10cc6767357be6eb8ee74ee5b..be18b3b7a182f010a177b875ab000002d4b8a31a 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -223,6 +223,28 @@ void LookupIterator::ApplyTransitionToDataProperty() {
}
+void LookupIterator::Delete() {
+ Handle<JSObject> holder = Handle<JSObject>::cast(holder_);
+ if (IsElement()) {
+ ElementsAccessor* accessor = holder->GetElementsAccessor();
+ accessor->Delete(holder, number_);
+ } else {
+ PropertyNormalizationMode mode = holder->map()->is_prototype_map()
+ ? KEEP_INOBJECT_PROPERTIES
+ : CLEAR_INOBJECT_PROPERTIES;
+
+ if (holder->HasFastProperties()) {
+ JSObject::NormalizeProperties(holder, mode, 0, "DeletingProperty");
+ holder_map_ = handle(holder->map(), isolate_);
+ ReloadPropertyInformation();
+ }
+ // TODO(verwaest): Get rid of the name_ argument.
+ JSObject::DeleteNormalizedProperty(holder, name_, number_);
+ JSObject::ReoptimizeIfPrototype(holder);
+ }
+}
+
+
void LookupIterator::TransitionToAccessorProperty(
AccessorComponent component, Handle<Object> accessor,
PropertyAttributes attributes) {
« no previous file with comments | « src/lookup.h ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698