Commit 0cffc08b authored by arv's avatar arv Committed by Commit bot

Super store

When the property is not found on the [[HomeObject]] prototype chain
then we should do a [[DefineOwnProperty]] on the instance.

BUG=v8:3330
LOG=N

Review URL: https://codereview.chromium.org/934463003

Cr-Commit-Position: refs/heads/master@{#26754}
parent 0ebd870f
This diff is collapsed.
......@@ -1017,8 +1017,6 @@ class Object {
CERTAINLY_NOT_STORE_FROM_KEYED
};
enum StorePropertyMode { NORMAL_PROPERTY, SUPER_PROPERTY };
INLINE(bool IsFixedArrayBase() const);
INLINE(bool IsExternal() const);
INLINE(bool IsAccessorInfo() const);
......@@ -1128,13 +1126,23 @@ class Object {
MUST_USE_RESULT static MaybeHandle<Object> SetProperty(
LookupIterator* it, Handle<Object> value, LanguageMode language_mode,
StoreFromKeyed store_mode,
StorePropertyMode data_store_mode = NORMAL_PROPERTY);
StoreFromKeyed store_mode);
MUST_USE_RESULT static MaybeHandle<Object> SetSuperProperty(
LookupIterator* it, Handle<Object> value, LanguageMode language_mode,
StoreFromKeyed store_mode);
MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyProperty(
LookupIterator* it, Handle<Object> value, LanguageMode language_mode);
MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyProperty(
Isolate* isolate, Handle<Object> reciever, Handle<Object> name,
Handle<Object> value, LanguageMode language_mode);
MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyElement(
Isolate* isolate, Handle<Object> receiver, uint32_t index,
Handle<Object> value, LanguageMode language_mode);
MUST_USE_RESULT static MaybeHandle<Object> RedefineNonconfigurableProperty(
Isolate* isolate, Handle<Object> name, Handle<Object> value,
LanguageMode language_mode);
MUST_USE_RESULT static MaybeHandle<Object> SetDataProperty(
LookupIterator* it, Handle<Object> value);
MUST_USE_RESULT static MaybeHandle<Object> AddDataProperty(
......@@ -1254,6 +1262,11 @@ class Object {
// Return the map of the root of object's prototype chain.
Map* GetRootMap(Isolate* isolate);
// Helper for SetProperty and SetSuperProperty.
MUST_USE_RESULT static MaybeHandle<Object> SetPropertyInternal(
LookupIterator* it, Handle<Object> value, LanguageMode language_mode,
StoreFromKeyed store_mode, bool* found);
DISALLOW_IMPLICIT_CONSTRUCTORS(Object);
};
......
......@@ -311,9 +311,8 @@ static Object* StoreToSuper(Isolate* isolate, Handle<JSObject> home_object,
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
Object::SetProperty(&it, value, language_mode,
Object::CERTAINLY_NOT_STORE_FROM_KEYED,
Object::SUPER_PROPERTY));
Object::SetSuperProperty(&it, value, language_mode,
Object::CERTAINLY_NOT_STORE_FROM_KEYED));
return *result;
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment