UpdateReceiverHClass in UpdateStoreHandler

Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IANXQV

Signed-off-by: dov1s <maojunwei1@huawei.com>
Change-Id: I0b64ecc009d9244feba7a0a896bd973da5cc278e
This commit is contained in:
dov1s 2024-09-01 20:34:37 +08:00
parent 9ec9a0f31d
commit 9f66728121
3 changed files with 21 additions and 7 deletions

View File

@ -411,13 +411,6 @@ JSTaggedValue StoreICRuntime::StoreMiss(JSHandle<JSTaggedValue> receiver, JSHand
}
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread_);
// ic-switch
if (op.GetValue().IsAccessor()) {
op = ObjectOperator(GetThread(), receiver, key);
if (!op.GetValue().IsAccessor()) {
//Don't support switch ic type from store handler to prototype handler
return JSTaggedValue::Undefined();
}
}
if (!GetThread()->GetEcmaVM()->ICEnabled()) {
icAccessor_.SetAsMega();
return success ? JSTaggedValue::Undefined() : JSTaggedValue::Exception();

View File

@ -14,3 +14,4 @@
test successful !!!
test set __proto__ null successful
test set bad_proto successful!
test accessor ic successful!

View File

@ -42,3 +42,23 @@ let bad_proto = {
let obj = {};
obj.__proto__ = bad_proto;
print("test set bad_proto successful!");
let obj1 = {};
Object.defineProperty(obj1, 'foo', {
set: function(value) {
Object.defineProperty(this, 'bar', {
get: function() {
return this._bar;
},
set: function(value) {
this._bar = value;
},
});
}
});
obj.foo = 'some value';
for (let i = 0; i < 20; i++) {
obj.bar = 'new value';
}
print("test accessor ic successful!");