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

Unified Diff: src/objects.cc

Issue 1181733002: Revert of Replace SetObjectProperty / DefineObjectProperty with less powerful alternatives where relevant. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 7e402184b1f5e1c82cc9fa6719ed363f50393e13..180255f4fd39cca153b7323c0d1c1f990224322e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3223,6 +3223,17 @@
}
+MaybeHandle<Object> Object::WriteToReadOnlyElement(Isolate* isolate,
+ Handle<Object> receiver,
+ uint32_t index,
+ Handle<Object> value,
+ LanguageMode language_mode) {
+ return WriteToReadOnlyProperty(isolate, receiver,
+ isolate->factory()->NewNumberFromUint(index),
+ value, language_mode);
+}
+
+
MaybeHandle<Object> Object::RedefineNonconfigurableProperty(
Isolate* isolate, Handle<Object> name, Handle<Object> value,
LanguageMode language_mode) {
@@ -3251,12 +3262,11 @@
MaybeHandle<Object> maybe_old;
if (is_observed) maybe_old = it->GetDataValue();
- Handle<Object> to_assign = value;
// Convert the incoming value to a number for storing into typed arrays.
if (it->IsElement() && (receiver->HasExternalArrayElements() ||
receiver->HasFixedTypedArrayElements())) {
if (!value->IsNumber() && !value->IsUndefined()) {
- ASSIGN_RETURN_ON_EXCEPTION(it->isolate(), to_assign,
+ ASSIGN_RETURN_ON_EXCEPTION(it->isolate(), value,
Execution::ToNumber(it->isolate(), value),
Object);
}
@@ -3264,10 +3274,10 @@
// Possibly migrate to the most up-to-date map that will be able to store
// |value| under it->name().
- it->PrepareForDataProperty(to_assign);
+ it->PrepareForDataProperty(value);
// Write the property value.
- it->WriteDataValue(to_assign);
+ value = it->WriteDataValue(value);
// Send the change record if there are observers.
if (is_observed && !value->SameValue(*maybe_old.ToHandleChecked())) {
@@ -4244,7 +4254,7 @@
DCHECK(!value->IsTheHole());
LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR);
if (it.state() == LookupIterator::ACCESS_CHECK) {
- if (!it.HasAccess()) {
+ if (!it.isolate()->MayAccess(object)) {
return SetPropertyWithFailedAccessCheck(&it, value, SLOPPY);
}
it.Next();
@@ -4267,7 +4277,7 @@
LookupIterator it(isolate, object, index,
LookupIterator::OWN_SKIP_INTERCEPTOR);
if (it.state() == LookupIterator::ACCESS_CHECK) {
- if (!it.HasAccess()) {
+ if (!isolate->MayAccess(object)) {
return SetPropertyWithFailedAccessCheck(&it, value, STRICT);
}
it.Next();
« 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