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

Unified Diff: src/objects.cc

Issue 1421123002: Revert of Reland "Use C++ implementation of Object.definePropert{y,ies}" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/js/v8natives.js ('k') | src/property-descriptor.cc » ('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 91fd624f54df229c9ecc435d18b0a5f43ed3d754..39c30336ea755b86a1c9a25fccbba19d76adb284 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6024,17 +6024,6 @@
LookupIterator it = LookupIterator::PropertyOrElement(
isolate, object, key, &success, LookupIterator::HIDDEN);
DCHECK(success); // ...so creating a LookupIterator can't fail.
-
- // Deal with access checks first.
- if (it.state() == LookupIterator::ACCESS_CHECK) {
- if (!it.HasAccess()) {
- isolate->ReportFailedAccessCheck(it.GetHolder<JSObject>());
- RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, false);
- return false;
- }
- it.Next();
- }
-
return OrdinaryDefineOwnProperty(&it, desc, should_throw);
}
@@ -6074,13 +6063,6 @@
}
return false;
}
- // We have to use a fresh LookupIterator to handle interceptors properly.
- LookupIterator lookup_for_store =
- it->IsElement() ? LookupIterator(isolate, it->GetReceiver(),
- it->index(), LookupIterator::HIDDEN)
- : LookupIterator(it->GetReceiver(), it->name(),
- LookupIterator::HIDDEN);
-
// 2c. If IsGenericDescriptor(Desc) or IsDataDescriptor(Desc) is true, then:
// (This is equivalent to !IsAccessorDescriptor(desc).)
DCHECK((desc_is_generic_descriptor || desc_is_data_descriptor) ==
@@ -6100,9 +6082,8 @@
? desc->value()
: Handle<Object>::cast(isolate->factory()->undefined_value()));
MaybeHandle<Object> result =
- JSObject::DefineOwnPropertyIgnoreAttributes(
- &lookup_for_store, value, desc->ToAttributes(),
- JSObject::DONT_FORCE_FIELD);
+ JSObject::DefineOwnPropertyIgnoreAttributes(it, value,
+ desc->ToAttributes());
if (result.is_null()) return false;
}
} else {
@@ -6124,8 +6105,8 @@
desc->has_set()
? desc->set()
: Handle<Object>::cast(isolate->factory()->undefined_value()));
- MaybeHandle<Object> result = JSObject::DefineAccessor(
- &lookup_for_store, getter, setter, desc->ToAttributes());
+ MaybeHandle<Object> result =
+ JSObject::DefineAccessor(it, getter, setter, desc->ToAttributes());
if (result.is_null()) return false;
}
}
@@ -6534,7 +6515,7 @@
if (!success && should_throw == THROW_ON_ERROR) {
isolate->Throw(*isolate->factory()->NewTypeError(
MessageTemplate::kStrictDeleteProperty,
- isolate->factory()->NewNumberFromUint(actual_new_len - 1), a));
+ isolate->factory()->NewNumberFromUint(actual_new_len - 1)));
}
return success;
}
@@ -7814,10 +7795,7 @@
DCHECK(filter == INCLUDE_SYMBOLS);
PropertyAttributes attr_filter =
static_cast<PropertyAttributes>(DONT_ENUM | PRIVATE_SYMBOL);
- Handle<FixedArray> property_keys = isolate->factory()->NewFixedArray(
- current->NumberOfOwnProperties(attr_filter));
- current->GetOwnPropertyNames(*property_keys, 0, attr_filter);
- accumulator.AddKeys(property_keys);
+ JSObject::CollectOwnElementKeys(current, &accumulator, attr_filter);
}
// Add the property keys from the interceptor.
« no previous file with comments | « src/js/v8natives.js ('k') | src/property-descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698