mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 01:59:58 +00:00
Check the results of NewRuntimeCallInfo
Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IB40SU Signed-off-by: shaoxiangdong <shaoxiangdong@huawei.com> Change-Id: Ifdc5efb6ba5e9a520a2034770ca5fccc46f36b62
This commit is contained in:
parent
811daec3dc
commit
3bf1a3cee9
@ -2720,7 +2720,6 @@ JSTaggedValue BuiltinsArray::ToString(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisObjVal, undefined, 0);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
return JSFunction::Call(info);
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,7 @@ JSTaggedValue BuiltinsAsyncFromSyncIterator::Throw(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSTaggedValue> reject(thread, pcap->GetReject());
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, reject, undefinedValue, undefinedValue, 1);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
info->SetCallArg(iterResult.GetTaggedValue());
|
||||
return pcap->GetPromise();
|
||||
}
|
||||
@ -98,7 +99,6 @@ JSTaggedValue BuiltinsAsyncFromSyncIterator::Throw(EcmaRuntimeCallInfo *argv)
|
||||
if (value->IsNull()) {
|
||||
EcmaRuntimeCallInfo *callInfo =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, throwResult, syncIterator, undefinedValue, 0);
|
||||
RETURN_REJECT_PROMISE_IF_ABRUPT(thread, throwResult, pcap);
|
||||
ret = JSFunction::Call(callInfo);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
} else {
|
||||
@ -119,6 +119,7 @@ JSTaggedValue BuiltinsAsyncFromSyncIterator::Throw(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSTaggedValue> reject(thread, pcap->GetReject());
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, reject, undefinedValue, undefinedValue, 1);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
info->SetCallArg(resolutionError.GetTaggedValue());
|
||||
JSFunction::Call(info);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
@ -167,6 +168,7 @@ JSTaggedValue BuiltinsAsyncFromSyncIterator::Return(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSTaggedValue> resolve(thread, pcap->GetResolve());
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, resolve, undefinedValue, undefinedValue, 1);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
info->SetCallArg(its.GetTaggedValue());
|
||||
JSHandle<JSObject> promise(thread, pcap->GetPromise());
|
||||
return promise.GetTaggedValue();
|
||||
@ -176,7 +178,6 @@ JSTaggedValue BuiltinsAsyncFromSyncIterator::Return(EcmaRuntimeCallInfo *argv)
|
||||
if (value->IsNull()) {
|
||||
EcmaRuntimeCallInfo *callInfo =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, returnResult, syncIterator, undefinedValue, 0);
|
||||
RETURN_REJECT_PROMISE_IF_ABRUPT(thread, returnResult, pcap);
|
||||
ret = JSFunction::Call(callInfo);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
} else {
|
||||
@ -197,6 +198,7 @@ JSTaggedValue BuiltinsAsyncFromSyncIterator::Return(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSTaggedValue> reject(thread, pcap->GetReject());
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, reject, undefinedValue, undefinedValue, 1);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
info->SetCallArg(rstErr.GetTaggedValue());
|
||||
JSFunction::Call(info);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
|
@ -467,10 +467,6 @@ void EcmaContext::CJSExecution(JSHandle<JSFunction> &func, JSHandle<JSTaggedValu
|
||||
JSHandle<JSTaggedValue>(func),
|
||||
thisArg, undefined, 5); // 5 : argument numbers
|
||||
RETURN_IF_ABRUPT_COMPLETION(thread_);
|
||||
if (info == nullptr) {
|
||||
LOG_ECMA(ERROR) << "CJSExecution Stack overflow!";
|
||||
return;
|
||||
}
|
||||
info->SetCallArg(cjsInfo.exportsHdl.GetTaggedValue(),
|
||||
cjsInfo.requireHdl.GetTaggedValue(),
|
||||
cjsInfo.moduleHdl.GetTaggedValue(),
|
||||
|
@ -285,7 +285,6 @@ inline JSTaggedValue LoadICRuntime::CallPrivateGetter(JSHandle<JSTaggedValue> re
|
||||
JSHandle<JSTaggedValue> undefined = thread_->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo* info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread_, key, receiver, undefined, 0); // 0: getter has 0 argument
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread_);
|
||||
JSTaggedValue resGetter = JSFunction::Call(info);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread_);
|
||||
return resGetter;
|
||||
@ -304,7 +303,9 @@ JSTaggedValue LoadICRuntime::LoadTypedArrayValueMiss(JSHandle<JSTaggedValue> rec
|
||||
}
|
||||
UpdateTypedArrayHandler(receiver);
|
||||
JSHandle<JSTaggedValue> indexHandle(GetThread(), numericIndex);
|
||||
uint32_t index = static_cast<uint32_t>(JSTaggedValue::ToInteger(GetThread(), indexHandle).ToInt32());
|
||||
JSTaggedNumber integerValue = JSTaggedValue::ToInteger(GetThread(), indexHandle);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(GetThread());
|
||||
uint32_t index = static_cast<uint32_t>(integerValue.ToInt32());
|
||||
JSType type = receiver->GetTaggedObject()->GetClass()->GetObjectType();
|
||||
return JSTypedArray::FastGetPropertyByIndex(GetThread(), receiver.GetTaggedValue(), index, type);
|
||||
} else {
|
||||
@ -448,7 +449,9 @@ JSTaggedValue StoreICRuntime::StoreTypedArrayValueMiss(JSHandle<JSTaggedValue> r
|
||||
}
|
||||
UpdateTypedArrayHandler(receiver);
|
||||
JSHandle<JSTaggedValue> indexHandle(GetThread(), numericIndex);
|
||||
uint32_t index = static_cast<uint32_t>(JSTaggedValue::ToInteger(GetThread(), indexHandle).ToInt32());
|
||||
JSTaggedNumber integerValue = JSTaggedValue::ToInteger(GetThread(), indexHandle);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(GetThread());
|
||||
uint32_t index = static_cast<uint32_t>(integerValue.ToInt32());
|
||||
JSType type = receiver->GetTaggedObject()->GetClass()->GetObjectType();
|
||||
return JSTypedArray::FastSetPropertyByIndex(GetThread(), receiver.GetTaggedValue(), index,
|
||||
value.GetTaggedValue(), type);
|
||||
|
@ -67,6 +67,7 @@ JSTaggedValue JSAsyncGeneratorObject::AsyncGeneratorResolve(JSThread *thread,
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo* info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, resolve, undefined, undefined, 1, StackCheck::NO);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
info->SetCallArg(its.GetTaggedValue());
|
||||
[[maybe_unused]] JSTaggedValue res = JSFunction::Call(info);
|
||||
if ((thread)->HasPendingException()) {
|
||||
|
@ -429,7 +429,10 @@ OperationResult JSTypedArray::IntegerIndexedElementGet(JSThread *thread, const J
|
||||
// arrayTypeName.
|
||||
uint32_t elementSize = TypedArrayHelper::GetElementSize(typedarrayObj);
|
||||
// 12. Let indexedPosition = (index × elementSize) + offset.
|
||||
uint32_t k = static_cast<uint32_t>(JSTaggedValue::ToInteger(thread, indexHandle).ToInt32());
|
||||
JSTaggedNumber integerValue = JSTaggedValue::ToInteger(thread, indexHandle);
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(
|
||||
thread, OperationResult(thread, JSTaggedValue::Exception(), PropertyMetaData(false)));
|
||||
uint32_t k = static_cast<uint32_t>(integerValue.ToInt32());
|
||||
uint32_t byteIndex = k * elementSize + offset;
|
||||
// 13. Let elementType be the String value of the Element Type value in Table 49 for arrayTypeName.
|
||||
DataViewType elementType = TypedArrayHelper::GetType(typedarrayObj);
|
||||
@ -628,7 +631,9 @@ bool JSTypedArray::IntegerIndexedElementSet(JSThread *thread, const JSHandle<JST
|
||||
// arrayTypeName.
|
||||
uint32_t elementSize = TypedArrayHelper::GetElementSize(typedarrayObj);
|
||||
// 9. Let indexedPosition = (index × elementSize) + offset.
|
||||
uint32_t k = JSTaggedValue::ToInteger(thread, indexHandle).ToUint32();
|
||||
JSTaggedNumber integerValue = JSTaggedValue::ToInteger(thread, indexHandle);
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||
uint32_t k = integerValue.ToUint32();
|
||||
uint32_t byteIndex = k * elementSize + offset;
|
||||
// 10. Let elementType be the String value of the Element Type value in Table 49 for arrayTypeName.
|
||||
DataViewType elementType = TypedArrayHelper::GetType(typedarrayObj);
|
||||
|
@ -584,7 +584,6 @@ JSTaggedValue RuntimeStubs::RuntimeGetIteratorNext(JSThread *thread, const JSHan
|
||||
ASSERT(method->IsCallable());
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
JSTaggedValue ret = JSFunction::Call(info);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
if (!ret.IsECMAObject()) {
|
||||
@ -1544,7 +1543,6 @@ JSTaggedValue RuntimeStubs::RuntimeLdPrivateProperty(JSThread *thread, JSTaggedV
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
// 0: getter has 0 arg
|
||||
EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, handleKey, handleObj, undefined, 0);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
JSTaggedValue resGetter = JSFunction::Call(info);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
return resGetter;
|
||||
@ -2676,6 +2674,7 @@ JSTaggedValue RuntimeStubs::RuntimeCallBigIntAsIntN(JSThread *thread, JSTaggedVa
|
||||
{
|
||||
auto biginteger = JSHandle<BigInt>(thread, bigint);
|
||||
JSTaggedNumber bitness = JSTaggedValue::ToNumber(thread, bits);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
return BigInt::AsintN(thread, bitness, biginteger);
|
||||
}
|
||||
|
||||
@ -2683,6 +2682,7 @@ JSTaggedValue RuntimeStubs::RuntimeCallBigIntAsUintN(JSThread *thread, JSTaggedV
|
||||
{
|
||||
auto biginteger = JSHandle<BigInt>(thread, bigint);
|
||||
JSTaggedNumber bitness = JSTaggedValue::ToNumber(thread, bits);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
return BigInt::AsUintN(thread, bitness, biginteger);
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,6 @@ ComparisonResult TaggedTree<Derived>::EntryCompare(JSThread *thread, const JSHan
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, compareFn, thisArgHandle, undefined, argsLength);
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, ComparisonResult::UNDEFINED);
|
||||
ASSERT(info != nullptr);
|
||||
info->SetCallArg(valueX.GetTaggedValue(), valueY.GetTaggedValue());
|
||||
JSTaggedValue callResult = JSFunction::Call(info);
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, ComparisonResult::UNDEFINED);
|
||||
@ -372,6 +371,7 @@ ComparisonResult TaggedTree<Derived>::EntryCompare(JSThread *thread, const JSHan
|
||||
// if callResult is true, compareResult = -1.
|
||||
if (callResult.IsFalse()) {
|
||||
info = EcmaInterpreter::NewRuntimeCallInfo(thread, compareFn, thisArgHandle, undefined, argsLength);
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, ComparisonResult::UNDEFINED);
|
||||
info->SetCallArg(valueY.GetTaggedValue(), valueX.GetTaggedValue());
|
||||
callResult = JSFunction::Call(info);
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, ComparisonResult::UNDEFINED);
|
||||
|
Loading…
Reference in New Issue
Block a user