arkcompiler_ets_runtime/ecmascript/ic/ic_runtime_stub.h
weng-xi 8f1fda94e3 Fix AOT bug of hasOwnProperty
1. change the logic of load/store operations when use AOT HClass
2. Supplement ut case
3. Add two new IC handlers
4. Add removeAOTFlag method to arktools
5. Add accessor flag to AOT HCLASS

Issues: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I692NO
Signed-off-by: weng-xi <wengxi1@huawei.com>
Change-Id: I9ca7e329b77e83b6c5a2c98525d551b5b4a1a9a4
2023-01-14 14:49:52 +08:00

83 lines
5.8 KiB
C++

/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ECMASCRIPT_IC_IC_RUNTIME_STUB_H_
#define ECMASCRIPT_IC_IC_RUNTIME_STUB_H_
#include "ecmascript/ic/profile_type_info.h"
#include "ecmascript/js_tagged_value.h"
#include "ecmascript/property_attributes.h"
namespace panda::ecmascript {
class ICRuntimeStub {
public:
static inline JSTaggedValue LoadGlobalICByName(JSThread *thread, ProfileTypeInfo *profileTypeInfo,
JSTaggedValue globalValue, JSTaggedValue key, uint32_t slotId,
bool tryLoad);
static inline JSTaggedValue StoreGlobalICByName(JSThread *thread, ProfileTypeInfo *profileTypeInfo,
JSTaggedValue globalValue, JSTaggedValue key,
JSTaggedValue value, uint32_t slotId, bool tryStore);
static inline JSTaggedValue LoadICByName(JSThread *thread, ProfileTypeInfo *profileTypeInfo,
JSTaggedValue receiver, JSTaggedValue key, uint32_t slotId);
static inline JSTaggedValue TryLoadICByName(JSThread *thread, JSTaggedValue receiver,
JSTaggedValue firstValue, JSTaggedValue secondValue);
static inline JSTaggedValue TryStoreICByName(JSThread *thread, JSTaggedValue receiver,
JSTaggedValue firstValue, JSTaggedValue secondValue,
JSTaggedValue value);
static inline JSTaggedValue StoreICByName(JSThread *thread, ProfileTypeInfo *profileTypeInfo,
JSTaggedValue receiver, JSTaggedValue key,
JSTaggedValue value, uint32_t slotId);
static inline JSTaggedValue CheckPolyHClass(JSTaggedValue cachedValue, JSHClass* hclass);
static inline JSTaggedValue LoadICWithHandler(JSThread *thread, JSTaggedValue receiver, JSTaggedValue holder,
JSTaggedValue handler);
static inline JSTaggedValue StoreICWithHandler(JSThread *thread, JSTaggedValue receiver, JSTaggedValue holder,
JSTaggedValue value, JSTaggedValue handler);
static inline void StoreWithTransition(JSThread *thread, JSObject *receiver, JSTaggedValue value,
JSTaggedValue handler, bool withPrototype = false);
static inline JSTaggedValue StoreTransWithProto(JSThread *thread, JSObject *receiver,
JSTaggedValue value, JSTaggedValue handler);
static inline JSTaggedValue StoreWithTS(JSThread *thread, JSTaggedValue receiver,
JSTaggedValue value, JSTaggedValue handler);
static inline JSTaggedValue StorePrototype(JSThread *thread, JSTaggedValue receiver,
JSTaggedValue value, JSTaggedValue handler);
static inline JSTaggedValue LoadFromField(JSObject *receiver, uint32_t handlerInfo);
static inline void StoreField(JSThread *thread, JSObject *receiver, JSTaggedValue value, uint32_t handler);
static inline JSTaggedValue LoadGlobal(JSTaggedValue handler);
static inline JSTaggedValue StoreGlobal(JSThread *thread, JSTaggedValue value, JSTaggedValue handler);
static inline JSTaggedValue LoadPrototype(JSThread *thread, JSTaggedValue receiver, JSTaggedValue handler);
static inline JSTaggedValue TryLoadICByValue(JSThread *thread, JSTaggedValue receiver, JSTaggedValue key,
JSTaggedValue firstValue, JSTaggedValue secondValue);
static inline JSTaggedValue LoadICByValue(JSThread *thread, ProfileTypeInfo *profileTypeInfo,
JSTaggedValue receiver, JSTaggedValue key, uint32_t slotId);
static inline JSTaggedValue TryStoreICByValue(JSThread *thread, JSTaggedValue receiver, JSTaggedValue key,
JSTaggedValue firstValue, JSTaggedValue secondValue,
JSTaggedValue value);
static inline JSTaggedValue StoreICByValue(JSThread *thread, ProfileTypeInfo *profileTypeInfo,
JSTaggedValue receiver, JSTaggedValue key, JSTaggedValue value,
uint32_t slotId);
static inline JSTaggedValue LoadElement(JSObject *receiver, JSTaggedValue key);
static inline JSTaggedValue StoreElement(JSThread *thread, JSObject *receiver, JSTaggedValue key,
JSTaggedValue value, JSTaggedValue handlerInfo);
static inline int32_t TryToElementsIndex(JSTaggedValue key);
static inline JSTaggedValue LoadMiss(JSThread *thread, ProfileTypeInfo *profileTypeInfo, JSTaggedValue receiver,
JSTaggedValue key, uint32_t slotId, ICKind kind);
static inline JSTaggedValue StoreMiss(JSThread *thread, ProfileTypeInfo *profileTypeInfo, JSTaggedValue receiver,
JSTaggedValue key, JSTaggedValue value, uint32_t slotId, ICKind kind);
};
} // namespace panda::ecmascript
#endif // ECMASCRIPT_IC_IC_RUNTIME_STUB_H_