diff --git a/ecmascript/ic/ic_runtime.cpp b/ecmascript/ic/ic_runtime.cpp index c1bbc6ad19..339bcc01bf 100644 --- a/ecmascript/ic/ic_runtime.cpp +++ b/ecmascript/ic/ic_runtime.cpp @@ -411,13 +411,6 @@ JSTaggedValue StoreICRuntime::StoreMiss(JSHandle 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(); diff --git a/test/moduletest/storeicbyname/expect_output.txt b/test/moduletest/storeicbyname/expect_output.txt index f80d25c6b0..c14f86b1d4 100644 --- a/test/moduletest/storeicbyname/expect_output.txt +++ b/test/moduletest/storeicbyname/expect_output.txt @@ -14,3 +14,4 @@ test successful !!! test set __proto__ null successful test set bad_proto successful! +test accessor ic successful! diff --git a/test/moduletest/storeicbyname/storeicbyname.js b/test/moduletest/storeicbyname/storeicbyname.js index d3f7ae42b1..ba01caa319 100644 --- a/test/moduletest/storeicbyname/storeicbyname.js +++ b/test/moduletest/storeicbyname/storeicbyname.js @@ -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!"); \ No newline at end of file