mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
!1924 Modify numArgs from int32_t to uint32_t
Merge pull request !1924 from lijiamin/master
This commit is contained in:
commit
82236d7f20
@ -22,9 +22,9 @@ JSHandle<TaggedArray> BuiltinsBase::GetArgsArray(EcmaRuntimeCallInfo *msg)
|
||||
{
|
||||
JSThread *thread = msg->GetThread();
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
int32_t length = msg->GetArgsNumber();
|
||||
uint32_t length = msg->GetArgsNumber();
|
||||
JSHandle<TaggedArray> array = factory->NewTaggedArray(length);
|
||||
for (int32_t i = 0; i < length; ++i) {
|
||||
for (uint32_t i = 0; i < length; ++i) {
|
||||
array->Set(thread, i, GetCallArg(msg, i).GetTaggedValue());
|
||||
}
|
||||
return array;
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
return msg->GetNewTarget();
|
||||
}
|
||||
|
||||
static inline JSHandle<JSTaggedValue> GetCallArg(EcmaRuntimeCallInfo *msg, int32_t position)
|
||||
static inline JSHandle<JSTaggedValue> GetCallArg(EcmaRuntimeCallInfo *msg, uint32_t position)
|
||||
{
|
||||
if (position >= msg->GetArgsNumber()) {
|
||||
JSThread *thread = msg->GetThread();
|
||||
|
@ -30,8 +30,8 @@ JSTaggedValue BuiltinsArkTools::ObjectDump(EcmaRuntimeCallInfo *info)
|
||||
// The default log level of ace_engine and js_runtime is error
|
||||
LOG_ECMA(ERROR) << ": " << base::StringHelper::ToStdString(*str);
|
||||
|
||||
int32_t numArgs = info->GetArgsNumber();
|
||||
for (int32_t i = 1; i < numArgs; i++) {
|
||||
uint32_t numArgs = info->GetArgsNumber();
|
||||
for (uint32_t i = 1; i < numArgs; i++) {
|
||||
JSHandle<JSTaggedValue> obj = GetCallArg(info, i);
|
||||
std::ostringstream oss;
|
||||
obj->Dump(oss);
|
||||
|
@ -48,7 +48,7 @@ JSTaggedValue BuiltinsArray::ArrayConstructor(EcmaRuntimeCallInfo *argv)
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
|
||||
// 1. Let numberOfArgs be the number of arguments passed to this function call.
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 3. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
|
||||
JSHandle<JSTaggedValue> constructor = GetConstructor(argv);
|
||||
@ -115,7 +115,7 @@ JSTaggedValue BuiltinsArray::ArrayConstructor(EcmaRuntimeCallInfo *argv)
|
||||
// d. Assert: defineStatus is true.
|
||||
// e. Increase k by 1.
|
||||
JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined());
|
||||
for (int32_t k = 0; k < argc; k++) {
|
||||
for (uint32_t k = 0; k < argc; k++) {
|
||||
key.Update(JSTaggedValue(k));
|
||||
JSHandle<JSTaggedValue> itemK = GetCallArg(argv, k);
|
||||
JSObject::CreateDataProperty(thread, newArrayHandle, key, itemK);
|
||||
@ -336,7 +336,7 @@ JSTaggedValue BuiltinsArray::Of(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSTaggedValue> lengthKey = globalConst->GetHandledLengthString();
|
||||
|
||||
// 1. Let len be the actual number of arguments passed to this function.
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 3. Let C be the this value.
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
@ -372,7 +372,7 @@ JSTaggedValue BuiltinsArray::Of(EcmaRuntimeCallInfo *argv)
|
||||
// d. ReturnIfAbrupt(defineStatus).
|
||||
// e. Increase k by 1.
|
||||
JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined());
|
||||
for (int32_t k = 0; k < argc; k++) {
|
||||
for (uint32_t k = 0; k < argc; k++) {
|
||||
key.Update(JSTaggedValue(k));
|
||||
JSHandle<JSTaggedValue> kValue = GetCallArg(argv, k);
|
||||
JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, key, kValue);
|
||||
@ -401,7 +401,7 @@ JSTaggedValue BuiltinsArray::Concat(EcmaRuntimeCallInfo *argv)
|
||||
BUILTINS_API_TRACE(argv->GetThread(), Array, Concat);
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
@ -453,7 +453,7 @@ JSTaggedValue BuiltinsArray::Concat(EcmaRuntimeCallInfo *argv)
|
||||
n++;
|
||||
}
|
||||
// 7. Repeat, while items is not empty
|
||||
for (int32_t i = 0; i < argc; i++) {
|
||||
for (uint32_t i = 0; i < argc; i++) {
|
||||
// a. Remove the first element from items and let E be the value of the element
|
||||
JSHandle<JSTaggedValue> addHandle = GetCallArg(argv, i);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
@ -1105,7 +1105,7 @@ JSTaggedValue BuiltinsArray::IndexOf(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
@ -1299,7 +1299,7 @@ JSTaggedValue BuiltinsArray::LastIndexOf(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
@ -1511,7 +1511,7 @@ JSTaggedValue BuiltinsArray::Push(EcmaRuntimeCallInfo *argv)
|
||||
return JSStableArray::Push(JSHandle<JSArray>::Cast(thisHandle), argv);
|
||||
}
|
||||
// 6. Let argCount be the number of elements in items.
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle);
|
||||
@ -1564,7 +1564,7 @@ JSTaggedValue BuiltinsArray::Reduce(EcmaRuntimeCallInfo *argv)
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle);
|
||||
@ -1642,7 +1642,7 @@ JSTaggedValue BuiltinsArray::Reduce(EcmaRuntimeCallInfo *argv)
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
key.Update(JSTaggedValue(k));
|
||||
JSHandle<JSTaggedValue> thisArgHandle = globalConst->GetHandledUndefined();
|
||||
const int32_t argsLength = 4; // 4: «accumulator, kValue, k, O»
|
||||
const uint32_t argsLength = 4; // 4: «accumulator, kValue, k, O»
|
||||
JSHandle<JSTaggedValue> undefined = globalConst->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength);
|
||||
@ -1669,7 +1669,7 @@ JSTaggedValue BuiltinsArray::ReduceRight(EcmaRuntimeCallInfo *argv)
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
const GlobalEnvConstants *globalConst = thread->GlobalConstants();
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
@ -1748,7 +1748,7 @@ JSTaggedValue BuiltinsArray::ReduceRight(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, key);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
JSHandle<JSTaggedValue> thisArgHandle = globalConst->GetHandledUndefined();
|
||||
const int32_t argsLength = 4; // 4: «accumulator, kValue, k, O»
|
||||
const uint32_t argsLength = 4; // 4: «accumulator, kValue, k, O»
|
||||
JSHandle<JSTaggedValue> undefined = globalConst->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength);
|
||||
@ -2232,7 +2232,7 @@ JSTaggedValue BuiltinsArray::Splice(EcmaRuntimeCallInfo *argv)
|
||||
BUILTINS_API_TRACE(argv->GetThread(), Array, Splice);
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle);
|
||||
@ -2412,7 +2412,7 @@ JSTaggedValue BuiltinsArray::Splice(EcmaRuntimeCallInfo *argv)
|
||||
k = start;
|
||||
// 23. Repeat, while items is not empty
|
||||
JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined());
|
||||
for (int32_t i = 2; i < argc; i++) {
|
||||
for (uint32_t i = 2; i < argc; i++) {
|
||||
JSHandle<JSTaggedValue> itemValue = GetCallArg(argv, i);
|
||||
key.Update(JSTaggedValue(k));
|
||||
JSArray::FastSetPropertyByValue(thread, thisObjVal, key, itemValue);
|
||||
@ -2555,7 +2555,7 @@ JSTaggedValue BuiltinsArray::ToString(EcmaRuntimeCallInfo *argv)
|
||||
callbackFnHandle = JSTaggedValue::GetProperty(thread, objectPrototype, toStringKey).GetValue();
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
}
|
||||
const int32_t argsLength = argv->GetArgsNumber();
|
||||
const uint32_t argsLength = argv->GetArgsNumber();
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *info =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisObjVal, undefined, argsLength);
|
||||
@ -2573,7 +2573,7 @@ JSTaggedValue BuiltinsArray::Unshift(EcmaRuntimeCallInfo *argv)
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
|
||||
// 5. Let argCount be the number of actual arguments.
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
// 1. Let O be ToObject(this value).
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
@ -2730,7 +2730,7 @@ JSTaggedValue BuiltinsArray::Flat(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
JSHandle<JSTaggedValue> thisObjVal(thisObjHandle);
|
||||
|
||||
// 2. Let sourceLen be ? LengthOfArrayLike(O).
|
||||
@ -2817,7 +2817,7 @@ JSTaggedValue BuiltinsArray::Includes(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
JSHandle<JSTaggedValue> thisObjVal(thisObjHandle);
|
||||
JSHandle<JSTaggedValue> searchElement = GetCallArg(argv, 0);
|
||||
|
||||
|
@ -308,7 +308,7 @@ JSTaggedValue BuiltinsAtomics::AtomicReadModifyWriteCase(JSThread *thread, JSTag
|
||||
JSTaggedValue data = jsArrayBuffer->GetArrayBufferData();
|
||||
void *pointer = JSNativePointer::Cast(data.GetTaggedObject())->GetExternalPointer();
|
||||
auto *block = reinterpret_cast<uint8_t *>(pointer);
|
||||
uint32_t size = static_cast<uint32_t>(argv->GetArgsNumber());
|
||||
uint32_t size = argv->GetArgsNumber();
|
||||
switch (type) {
|
||||
case DataViewType::UINT8:
|
||||
return HandleWithUint8(thread, size, block, indexedPosition, argv, op);
|
||||
|
@ -52,7 +52,7 @@ JSTaggedValue BuiltinsCjsModule::ResolveFilename(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
|
||||
int32_t length = argv->GetArgsNumber();
|
||||
uint32_t length = argv->GetArgsNumber();
|
||||
JSMutableHandle<JSTaggedValue> parent(thread, JSTaggedValue::Undefined());
|
||||
JSMutableHandle<JSTaggedValue> dirname(thread, JSTaggedValue::Undefined());
|
||||
const JSPandaFile *jsPandaFile = EcmaInterpreter::GetNativeCallPandafile(thread);
|
||||
|
@ -34,7 +34,7 @@ JSTaggedValue BuiltinsCjsRequire::CjsRequireConstructor(EcmaRuntimeCallInfo *arg
|
||||
if (!newTarget->IsUndefined()) {
|
||||
THROW_TYPE_ERROR_AND_RETURN(thread, "newTarget is undefined", JSTaggedValue::Exception());
|
||||
}
|
||||
int32_t length = argv->GetArgsNumber();
|
||||
uint32_t length = argv->GetArgsNumber();
|
||||
JSHandle<JSTaggedValue> result(thread, JSTaggedValue::Undefined());
|
||||
if (length != 1) { // strange arg's number
|
||||
LOG_ECMA(ERROR) << "BuiltinsCjsRequire::CjsRequireConstructor : can only accept one argument";
|
||||
|
@ -42,7 +42,7 @@ JSTaggedValue BuiltinsDate::DateConstructor(EcmaRuntimeCallInfo *argv)
|
||||
}
|
||||
|
||||
JSTaggedValue timeValue(0.0);
|
||||
uint32_t length = static_cast<uint32_t>(argv->GetArgsNumber());
|
||||
uint32_t length = argv->GetArgsNumber();
|
||||
if (length == 0) { // no value
|
||||
timeValue = JSDate::Now();
|
||||
} else if (length == 1) { // one value
|
||||
|
@ -149,7 +149,7 @@ JSTaggedValue BuiltinsFunction::FunctionPrototypeBind(EcmaRuntimeCallInfo *argv)
|
||||
}
|
||||
|
||||
JSHandle<JSTaggedValue> thisArg = GetCallArg(argv, 0);
|
||||
int32_t argsLength = 0;
|
||||
uint32_t argsLength = 0;
|
||||
if (argv->GetArgsNumber() > 1) {
|
||||
argsLength = argv->GetArgsNumber() - 1;
|
||||
}
|
||||
@ -157,7 +157,7 @@ JSTaggedValue BuiltinsFunction::FunctionPrototypeBind(EcmaRuntimeCallInfo *argv)
|
||||
// 3. Let args be a new (possibly empty) List consisting of all of the argument
|
||||
// values provided after thisArg in order.
|
||||
JSHandle<TaggedArray> argsArray = factory->NewTaggedArray(argsLength);
|
||||
for (int32_t index = 0; index < argsLength; ++index) {
|
||||
for (uint32_t index = 0; index < argsLength; ++index) {
|
||||
argsArray->Set(thread, index, GetCallArg(argv, index + 1));
|
||||
}
|
||||
// 4. Let F be BoundFunctionCreate(Target, thisArg, args).
|
||||
@ -239,7 +239,7 @@ JSTaggedValue BuiltinsFunction::FunctionPrototypeCall(EcmaRuntimeCallInfo *argv)
|
||||
|
||||
JSHandle<JSTaggedValue> func = GetThis(argv);
|
||||
JSHandle<JSTaggedValue> thisArg = GetCallArg(argv, 0);
|
||||
int32_t argsLength = 0;
|
||||
uint32_t argsLength = 0;
|
||||
if (argv->GetArgsNumber() > 1) {
|
||||
argsLength = argv->GetArgsNumber() - 1;
|
||||
}
|
||||
|
@ -481,8 +481,8 @@ JSTaggedValue BuiltinsGlobal::PrintEntrypoint(EcmaRuntimeCallInfo *msg)
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
BUILTINS_API_TRACE(thread, Global, PrintEntryPoint);
|
||||
|
||||
int32_t numArgs = msg->GetArgsNumber();
|
||||
for (int32_t i = 0; i < numArgs; i++) {
|
||||
uint32_t numArgs = msg->GetArgsNumber();
|
||||
for (uint32_t i = 0; i < numArgs; i++) {
|
||||
JSHandle<EcmaString> stringContent = JSTaggedValue::ToString(thread, GetCallArg(msg, i));
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
PrintString(thread, *stringContent);
|
||||
|
@ -36,7 +36,7 @@ JSTaggedValue BuiltinsJson::Parse(EcmaRuntimeCallInfo *argv)
|
||||
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc == 0) {
|
||||
JSHandle<JSObject> syntaxError = factory->GetJSError(base::ErrorType::SYNTAX_ERROR, "arg is empty");
|
||||
THROW_NEW_ERROR_AND_RETURN_VALUE(thread, syntaxError.GetTaggedValue(), JSTaggedValue::Exception());
|
||||
@ -84,7 +84,7 @@ JSTaggedValue BuiltinsJson::Stringify(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
JSTaggedValue value = GetCallArg(argv, 0).GetTaggedValue();
|
||||
JSTaggedValue replacer = JSTaggedValue::Undefined();
|
||||
JSTaggedValue gap = JSTaggedValue::Undefined();
|
||||
|
@ -363,9 +363,9 @@ JSTaggedValue BuiltinsMath::Hypot(EcmaRuntimeCallInfo *argv)
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
double result = 0;
|
||||
double value = 0;
|
||||
int32_t argLen = argv->GetArgsNumber();
|
||||
uint32_t argLen = argv->GetArgsNumber();
|
||||
auto numberValue = JSTaggedNumber(0);
|
||||
for (int32_t i = 0; i < argLen; i++) {
|
||||
for (uint32_t i = 0; i < argLen; i++) {
|
||||
JSHandle<JSTaggedValue> msg = GetCallArg(argv, i);
|
||||
numberValue = JSTaggedValue::ToNumber(thread, msg);
|
||||
value = numberValue.GetNumber();
|
||||
@ -482,13 +482,13 @@ JSTaggedValue BuiltinsMath::Max(EcmaRuntimeCallInfo *argv)
|
||||
BUILTINS_API_TRACE(argv->GetThread(), Math, Max);
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
int32_t argLen = argv->GetArgsNumber();
|
||||
uint32_t argLen = argv->GetArgsNumber();
|
||||
auto numberValue = JSTaggedNumber(-base::POSITIVE_INFINITY);
|
||||
// If no arguments are given, the result is -inf
|
||||
auto result = JSTaggedNumber(-base::POSITIVE_INFINITY);
|
||||
auto tmpMax = -base::POSITIVE_INFINITY;
|
||||
auto value = -base::POSITIVE_INFINITY;
|
||||
for (int32_t i = 0; i < argLen; i++) {
|
||||
for (uint32_t i = 0; i < argLen; i++) {
|
||||
JSHandle<JSTaggedValue> msg = GetCallArg(argv, i);
|
||||
numberValue = JSTaggedValue::ToNumber(thread, msg);
|
||||
value = numberValue.GetNumber();
|
||||
@ -516,13 +516,13 @@ JSTaggedValue BuiltinsMath::Min(EcmaRuntimeCallInfo *argv)
|
||||
BUILTINS_API_TRACE(argv->GetThread(), Math, Min);
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
int32_t argLen = argv->GetArgsNumber();
|
||||
uint32_t argLen = argv->GetArgsNumber();
|
||||
auto numberValue = JSTaggedNumber(base::POSITIVE_INFINITY);
|
||||
// If no arguments are given, the result is inf
|
||||
auto result = JSTaggedNumber(base::POSITIVE_INFINITY);
|
||||
auto tmpMin = base::POSITIVE_INFINITY;
|
||||
auto value = base::POSITIVE_INFINITY;
|
||||
for (int32_t i = 0; i < argLen; i++) {
|
||||
for (uint32_t i = 0; i < argLen; i++) {
|
||||
JSHandle<JSTaggedValue> msg = GetCallArg(argv, i);
|
||||
numberValue = JSTaggedValue::ToNumber(thread, msg);
|
||||
value = numberValue.GetNumber();
|
||||
|
@ -67,7 +67,7 @@ JSTaggedValue BuiltinsObject::Assign(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
|
||||
int32_t numArgs = argv->GetArgsNumber();
|
||||
uint32_t numArgs = argv->GetArgsNumber();
|
||||
// 1.Let to be ToObject(target).
|
||||
JSHandle<JSTaggedValue> target = GetCallArg(argv, 0);
|
||||
JSHandle<JSObject> toAssign = JSTaggedValue::ToObject(thread, target);
|
||||
@ -83,7 +83,7 @@ JSTaggedValue BuiltinsObject::Assign(EcmaRuntimeCallInfo *argv)
|
||||
// ii.Let keys be from.[[OwnPropertyKeys]]().
|
||||
// iii.ReturnIfAbrupt(keys).
|
||||
JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined());
|
||||
for (int32_t i = 1; i < numArgs; i++) {
|
||||
for (uint32_t i = 1; i < numArgs; i++) {
|
||||
JSHandle<JSTaggedValue> source = GetCallArg(argv, i);
|
||||
if (!source->IsNull() && !source->IsUndefined()) {
|
||||
JSHandle<JSObject> from = JSTaggedValue::ToObject(thread, source);
|
||||
@ -775,7 +775,7 @@ JSTaggedValue BuiltinsObject::ToLocaleString(EcmaRuntimeCallInfo *argv)
|
||||
|
||||
// 2. Return Invoke(O, "toString").
|
||||
JSHandle<JSTaggedValue> calleeKey = thread->GlobalConstants()->GetHandledToStringString();
|
||||
const int32_t argsLength = argv->GetArgsNumber();
|
||||
const uint32_t argsLength = argv->GetArgsNumber();
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, undefined, object, undefined, argsLength);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
|
@ -87,7 +87,7 @@ JSTaggedValue BuiltinsString::FromCharCode(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
int32_t argLength = argv->GetArgsNumber();
|
||||
uint32_t argLength = argv->GetArgsNumber();
|
||||
if (argLength == 0) {
|
||||
return factory->GetEmptyString().GetTaggedValue();
|
||||
}
|
||||
@ -101,7 +101,7 @@ JSTaggedValue BuiltinsString::FromCharCode(EcmaRuntimeCallInfo *argv)
|
||||
std::u16string u16str = base::StringHelper::Utf16ToU16String(&codePointValue, 1);
|
||||
CVector<uint16_t> valueTable;
|
||||
valueTable.reserve(argLength - 1);
|
||||
for (int32_t i = 1; i < argLength; i++) {
|
||||
for (uint32_t i = 1; i < argLength; i++) {
|
||||
JSHandle<JSTaggedValue> nextCp = BuiltinsString::GetCallArg(argv, i);
|
||||
uint16_t nextCv = JSTaggedValue::ToUint16(thread, nextCp);
|
||||
valueTable.emplace_back(nextCv);
|
||||
@ -124,13 +124,13 @@ JSTaggedValue BuiltinsString::FromCodePoint(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
int32_t argLength = argv->GetArgsNumber();
|
||||
uint32_t argLength = argv->GetArgsNumber();
|
||||
if (argLength == 0) {
|
||||
return factory->GetEmptyString().GetTaggedValue();
|
||||
}
|
||||
std::u16string u16str;
|
||||
int32_t u16strSize = argLength;
|
||||
for (int32_t i = 0; i < argLength; i++) {
|
||||
uint32_t u16strSize = argLength;
|
||||
for (uint32_t i = 0; i < argLength; i++) {
|
||||
JSHandle<JSTaggedValue> nextCpTag = BuiltinsString::GetCallArg(argv, i);
|
||||
JSTaggedNumber nextCpVal = JSTaggedValue::ToNumber(thread, nextCpTag);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
@ -199,9 +199,9 @@ JSTaggedValue BuiltinsString::Raw(EcmaRuntimeCallInfo *argv)
|
||||
}
|
||||
|
||||
std::u16string u16str;
|
||||
int argc = argv->GetArgsNumber() - 1;
|
||||
uint32_t argc = argv->GetArgsNumber() - 1;
|
||||
bool canBeCompress = true;
|
||||
for (int i = 0, argsI = 1; i < length; ++i, ++argsI) {
|
||||
for (uint32_t i = 0, argsI = 1; i < static_cast<uint32_t>(length); ++i, ++argsI) {
|
||||
// Let nextSeg be ToString(Get(raw, nextKey)).
|
||||
JSHandle<JSTaggedValue> elementString =
|
||||
JSObject::GetProperty(thread, JSHandle<JSTaggedValue>::Cast(rawObj), i).GetValue();
|
||||
@ -214,7 +214,7 @@ JSTaggedValue BuiltinsString::Raw(EcmaRuntimeCallInfo *argv)
|
||||
} else {
|
||||
u16str += base::StringHelper::Utf8ToU16String(nextSeg->GetDataUtf8(), nextSeg->GetLength());
|
||||
}
|
||||
if (i + 1 == length) {
|
||||
if (i + 1 == static_cast<uint32_t>(length)) {
|
||||
break;
|
||||
}
|
||||
if (argsI <= argc) {
|
||||
@ -336,7 +336,7 @@ JSTaggedValue BuiltinsString::Concat(EcmaRuntimeCallInfo *argv)
|
||||
JSHandle<EcmaString> thisHandle = JSTaggedValue::ToString(thread, thisTag);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
uint32_t thisLen = thisHandle->GetLength();
|
||||
int32_t argLength = argv->GetArgsNumber();
|
||||
uint32_t argLength = argv->GetArgsNumber();
|
||||
if (argLength == 0) {
|
||||
return thisHandle.GetTaggedValue();
|
||||
}
|
||||
@ -349,7 +349,7 @@ JSTaggedValue BuiltinsString::Concat(EcmaRuntimeCallInfo *argv)
|
||||
} else {
|
||||
u16strThis = base::StringHelper::Utf8ToU16String(thisHandle->GetDataUtf8(), thisLen);
|
||||
}
|
||||
for (int32_t i = 0; i < argLength; i++) {
|
||||
for (uint32_t i = 0; i < argLength; i++) {
|
||||
JSHandle<JSTaggedValue> nextTag = BuiltinsString::GetCallArg(argv, i);
|
||||
JSHandle<EcmaString> nextHandle = JSTaggedValue::ToString(thread, nextTag);
|
||||
uint32_t nextLen = nextHandle->GetLength();
|
||||
|
@ -290,7 +290,7 @@ JSTaggedValue BuiltinsTypedArray::Of(EcmaRuntimeCallInfo *argv)
|
||||
JSThread *thread = argv->GetThread();
|
||||
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
||||
// 1. Let len be the actual number of arguments passed to this function.
|
||||
int32_t len = argv->GetArgsNumber();
|
||||
uint32_t len = argv->GetArgsNumber();
|
||||
// 2. Let items be the List of arguments passed to this function.
|
||||
// 3. Let C be the this value.
|
||||
JSHandle<JSTaggedValue> thisHandle = GetThis(argv);
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
|
||||
static JSTaggedValue TestEveryFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) { // 10 : test case
|
||||
return GetTaggedBoolean(true);
|
||||
@ -119,7 +119,7 @@ public:
|
||||
|
||||
static JSTaggedValue TestFindFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
// 10 : test case
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) {
|
||||
@ -131,7 +131,7 @@ public:
|
||||
|
||||
static JSTaggedValue TestFindIndexFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
// 10 : test case
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) {
|
||||
@ -157,7 +157,7 @@ public:
|
||||
|
||||
static JSTaggedValue TestSomeFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) { // 10 : test case
|
||||
return GetTaggedBoolean(true);
|
||||
|
@ -68,7 +68,7 @@ JSTaggedValue TestFunctionApplyAndCall(EcmaRuntimeCallInfo *argv)
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
|
||||
int result = 0;
|
||||
for (int32_t index = 0; index < argv->GetArgsNumber(); ++index) {
|
||||
for (uint32_t index = 0; index < argv->GetArgsNumber(); ++index) {
|
||||
result += BuiltinsBase::GetCallArg(argv, index)->GetInt();
|
||||
}
|
||||
JSHandle<JSTaggedValue> thisValue(BuiltinsBase::GetThis(argv));
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
public:
|
||||
static JSTaggedValue TestForParse(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
}
|
||||
JSTaggedValue key = GetCallArg(argv, 0).GetTaggedValue();
|
||||
@ -90,7 +90,7 @@ public:
|
||||
|
||||
static JSTaggedValue TestForParse1(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
}
|
||||
return JSTaggedValue::Undefined();
|
||||
@ -98,7 +98,7 @@ public:
|
||||
|
||||
static JSTaggedValue TestForStringfy(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
JSTaggedValue key = GetCallArg(argv, 0).GetTaggedValue();
|
||||
if (key.IsUndefined()) {
|
||||
|
@ -74,7 +74,7 @@ JSTaggedValue TestReflectApply(EcmaRuntimeCallInfo *argv)
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
|
||||
int result = 0;
|
||||
for (int32_t index = 0; index < argv->GetArgsNumber(); ++index) {
|
||||
for (uint32_t index = 0; index < argv->GetArgsNumber(); ++index) {
|
||||
result += BuiltinsBase::GetCallArg(argv, index).GetTaggedValue().GetInt();
|
||||
}
|
||||
JSHandle<JSTaggedValue> thisValue = BuiltinsBase::GetThis(argv);
|
||||
|
@ -88,7 +88,7 @@ protected:
|
||||
|
||||
static JSTaggedValue TestEveryFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
[[maybe_unused]] int aaa = GetCallArg(argv, 0)->GetInt();
|
||||
// 10 : test case
|
||||
@ -102,7 +102,7 @@ protected:
|
||||
static JSTaggedValue TestFilterFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
ASSERT(argv);
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
// 10 : test case
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) {
|
||||
@ -121,7 +121,7 @@ protected:
|
||||
|
||||
static JSTaggedValue TestFindFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
// 10 : test case
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) {
|
||||
@ -133,7 +133,7 @@ protected:
|
||||
|
||||
static JSTaggedValue TestFindIndexFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
// 10 : test case
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) {
|
||||
@ -159,7 +159,7 @@ protected:
|
||||
|
||||
static JSTaggedValue TestSomeFunc(EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
int32_t argc = argv->GetArgsNumber();
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc > 0) {
|
||||
// 10 : test case
|
||||
if (GetCallArg(argv, 0)->GetInt() > 10) {
|
||||
|
@ -37,7 +37,7 @@ enum TriggerGCType {
|
||||
GC_TYPE_LAST
|
||||
};
|
||||
|
||||
constexpr int32_t NUM_MANDATORY_JSFUNC_ARGS = 3;
|
||||
constexpr uint32_t NUM_MANDATORY_JSFUNC_ARGS = 3;
|
||||
|
||||
using Address = uintptr_t;
|
||||
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
SetArg(THIS_INDEX, tagged);
|
||||
}
|
||||
|
||||
inline void SetCallArg(int32_t idx, const JSTaggedValue tagged)
|
||||
inline void SetCallArg(uint32_t idx, const JSTaggedValue tagged)
|
||||
{
|
||||
ASSERT_PRINT(idx < GetArgsNumber(), "Can not set values out of index range");
|
||||
SetArg(idx + FIRST_ARGS_INDEX, tagged);
|
||||
@ -149,9 +149,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void SetCallArg(int32_t argsLength, const JSHandle<TaggedArray> args)
|
||||
inline void SetCallArg(uint32_t argsLength, const JSHandle<TaggedArray> args)
|
||||
{
|
||||
for (int32_t i = 0; i < argsLength; i++) {
|
||||
for (uint32_t i = 0; i < argsLength; i++) {
|
||||
SetCallArg(i, args->Get(GetThread(), i));
|
||||
}
|
||||
}
|
||||
@ -163,9 +163,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void SetCallArg(int32_t argsLength, int32_t startIndex, const EcmaRuntimeCallInfo* argv, int32_t offset)
|
||||
inline void SetCallArg(uint32_t argsLength, uint32_t startIndex, const EcmaRuntimeCallInfo* argv, int32_t offset)
|
||||
{
|
||||
for (int32_t i = startIndex; i < argsLength; i++) {
|
||||
for (uint32_t i = startIndex; i < argsLength; i++) {
|
||||
SetCallArg(i, argv->GetCallArgValue(i - startIndex + offset));
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ public:
|
||||
return GetArg(THIS_INDEX);
|
||||
}
|
||||
|
||||
inline JSHandle<JSTaggedValue> GetCallArg(int32_t idx) const
|
||||
inline JSHandle<JSTaggedValue> GetCallArg(uint32_t idx) const
|
||||
{
|
||||
return GetArg(idx + FIRST_ARGS_INDEX);
|
||||
}
|
||||
@ -208,7 +208,7 @@ public:
|
||||
return thisObj.GetTaggedValue();
|
||||
}
|
||||
|
||||
inline JSTaggedValue GetCallArgValue(int32_t idx) const
|
||||
inline JSTaggedValue GetCallArgValue(uint32_t idx) const
|
||||
{
|
||||
JSHandle<JSTaggedValue> arg = GetCallArg(idx);
|
||||
return arg.GetTaggedValue();
|
||||
@ -218,7 +218,7 @@ public:
|
||||
* The number of arguments pairs excluding the 'func', 'new.target' and 'this'. For instance:
|
||||
* for code fragment: " foo(v1); ", GetArgsNumber() returns 1
|
||||
*/
|
||||
inline int32_t GetArgsNumber() const
|
||||
inline uint32_t GetArgsNumber() const
|
||||
{
|
||||
return numArgs_ - NUM_MANDATORY_JSFUNC_ARGS;
|
||||
}
|
||||
@ -231,7 +231,7 @@ public:
|
||||
private:
|
||||
enum ArgsIndex : uint8_t { FUNC_INDEX = 0, NEW_TARGET_INDEX, THIS_INDEX, FIRST_ARGS_INDEX };
|
||||
|
||||
inline uintptr_t GetArgAddress(int32_t idx) const
|
||||
inline uintptr_t GetArgAddress(uint32_t idx) const
|
||||
{
|
||||
if (idx < GetArgsNumber() + NUM_MANDATORY_JSFUNC_ARGS) {
|
||||
return reinterpret_cast<uintptr_t>(&stackArgs_[idx]);
|
||||
@ -239,7 +239,7 @@ private:
|
||||
return 0U;
|
||||
}
|
||||
|
||||
inline void SetArg(int32_t idx, const JSTaggedValue tagged)
|
||||
inline void SetArg(uint32_t idx, const JSTaggedValue tagged)
|
||||
{
|
||||
uintptr_t addr = GetArgAddress(idx);
|
||||
if (addr != 0U) {
|
||||
@ -247,7 +247,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
inline JSHandle<JSTaggedValue> GetArg(int32_t idx) const
|
||||
inline JSHandle<JSTaggedValue> GetArg(uint32_t idx) const
|
||||
{
|
||||
return JSHandle<JSTaggedValue>(GetArgAddress(idx));
|
||||
}
|
||||
|
@ -317,8 +317,8 @@ using CommonStubCSigns = kungfu::CommonStubCSigns;
|
||||
CALL_PUSH_ARGS_##ARG_TYPE(); \
|
||||
goto setVregsAndFrameNative; \
|
||||
} \
|
||||
int32_t declaredNumArgs = static_cast<int32_t>( \
|
||||
method->GetNumArgsWithCallField()); \
|
||||
int32_t declaredNumArgs = \
|
||||
static_cast<int32_t>(method->GetNumArgsWithCallField()); \
|
||||
if (actualNumArgs == declaredNumArgs) { \
|
||||
/* fast path, just push all args directly */ \
|
||||
CALL_PUSH_ARGS_##ARG_TYPE(); \
|
||||
@ -470,7 +470,7 @@ JSTaggedValue EcmaInterpreter::Execute(EcmaRuntimeCallInfo *info)
|
||||
|
||||
// current is entry frame.
|
||||
JSTaggedType *sp = const_cast<JSTaggedType *>(thread->GetCurrentSPFrame());
|
||||
int32_t actualNumArgs = info->GetArgsNumber();
|
||||
int32_t actualNumArgs = static_cast<int32_t>(info->GetArgsNumber());
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
|
||||
JSTaggedType *newSp = sp - InterpretedEntryFrame::NumOfMembers();
|
||||
if (UNLIKELY(thread->DoStackOverflowCheck(newSp - actualNumArgs - NUM_MANDATORY_JSFUNC_ARGS))) {
|
||||
|
@ -38,7 +38,7 @@ namespace panda::ecmascript {
|
||||
// +--------------------------+
|
||||
EcmaRuntimeCallInfo* EcmaInterpreter::NewRuntimeCallInfo(
|
||||
JSThread *thread, JSHandle<JSTaggedValue> func, JSHandle<JSTaggedValue> thisObj, JSHandle<JSTaggedValue> newTarget,
|
||||
int32_t numArgs, bool needCheckStack)
|
||||
uint32_t numArgs, bool needCheckStack)
|
||||
{
|
||||
JSTaggedType *sp = const_cast<JSTaggedType *>(thread->GetCurrentSPFrame());
|
||||
JSTaggedType *newSp = nullptr;
|
||||
@ -58,7 +58,7 @@ EcmaRuntimeCallInfo* EcmaInterpreter::NewRuntimeCallInfo(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto i = 0; i < numArgs; i++) {
|
||||
for (uint32_t i = 0; i < numArgs; i++) {
|
||||
*(--newSp) = JSTaggedValue::VALUE_UNDEFINED;
|
||||
}
|
||||
*(--newSp) = thisObj.GetTaggedType();
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
static inline JSTaggedValue ExecuteNative(EcmaRuntimeCallInfo *info);
|
||||
static EcmaRuntimeCallInfo* NewRuntimeCallInfo(
|
||||
JSThread *thread, JSHandle<JSTaggedValue> func, JSHandle<JSTaggedValue> thisObj,
|
||||
JSHandle<JSTaggedValue> newTarget, int32_t numArgs, bool needCheckStack = true);
|
||||
JSHandle<JSTaggedValue> newTarget, uint32_t numArgs, bool needCheckStack = true);
|
||||
static inline JSTaggedValue GeneratorReEnterInterpreter(JSThread *thread, JSHandle<GeneratorContext> context);
|
||||
static inline JSTaggedValue GeneratorReEnterAot(JSThread *thread, JSHandle<GeneratorContext> context);
|
||||
static inline void RunInternal(JSThread *thread, const uint8_t *pc, JSTaggedType *sp);
|
||||
|
@ -223,7 +223,7 @@ JSTaggedValue InterpreterAssembly::Execute(EcmaRuntimeCallInfo *info)
|
||||
}
|
||||
#endif
|
||||
thread->CheckSafepoint();
|
||||
int32_t argc = info->GetArgsNumber();
|
||||
uint32_t argc = info->GetArgsNumber();
|
||||
uintptr_t argv = reinterpret_cast<uintptr_t>(info->GetArgs());
|
||||
auto entry = thread->GetRTInterface(kungfu::RuntimeStubCSigns::ID_AsmInterpreterEntry);
|
||||
|
||||
|
@ -35,8 +35,8 @@ JSTaggedValue SlowRuntimeHelper::CallBoundFunction(EcmaRuntimeCallInfo *info)
|
||||
}
|
||||
|
||||
JSHandle<TaggedArray> boundArgs(thread, boundFunc->GetBoundArguments());
|
||||
const int32_t boundLength = static_cast<int32_t>(boundArgs->GetLength());
|
||||
const int32_t argsLength = info->GetArgsNumber() + boundLength;
|
||||
const uint32_t boundLength = boundArgs->GetLength();
|
||||
const uint32_t argsLength = info->GetArgsNumber() + boundLength;
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *runtimeInfo = EcmaInterpreter::NewRuntimeCallInfo(thread, JSHandle<JSTaggedValue>(targetFunc),
|
||||
info->GetThis(), undefined, argsLength);
|
||||
|
@ -554,7 +554,7 @@ JSTaggedValue JSDate::UTC(EcmaRuntimeCallInfo *argv)
|
||||
year = base::NAN_VALUE;
|
||||
}
|
||||
uint32_t index = 1;
|
||||
uint32_t numArgs = static_cast<uint32_t>(argv->GetArgsNumber());
|
||||
uint32_t numArgs = argv->GetArgsNumber();
|
||||
JSTaggedValue res;
|
||||
if (numArgs > index) {
|
||||
JSHandle<JSTaggedValue> value = base::BuiltinsBase::GetCallArg(argv, index);
|
||||
@ -976,7 +976,7 @@ JSTaggedValue JSDate::SetDateValue(EcmaRuntimeCallInfo *argv, uint32_t code, boo
|
||||
double timeMs = this->GetTimeValue().GetDouble();
|
||||
|
||||
// get values from argv.
|
||||
uint32_t argc = static_cast<uint32_t>(argv->GetArgsNumber());
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
if (argc == 0) {
|
||||
return JSTaggedValue(base::NAN_VALUE);
|
||||
}
|
||||
|
@ -450,8 +450,8 @@ JSTaggedValue JSBoundFunction::ConstructInternal(EcmaRuntimeCallInfo *info)
|
||||
}
|
||||
|
||||
JSHandle<TaggedArray> boundArgs(thread, func->GetBoundArguments());
|
||||
const int32_t boundLength = static_cast<int32_t>(boundArgs->GetLength());
|
||||
const int32_t argsLength = info->GetArgsNumber() + boundLength;
|
||||
const uint32_t boundLength = boundArgs->GetLength();
|
||||
const uint32_t argsLength = info->GetArgsNumber() + boundLength;
|
||||
JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
|
||||
EcmaRuntimeCallInfo *runtimeInfo =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, target, undefined, newTargetMutable, argsLength);
|
||||
|
@ -880,7 +880,7 @@ JSTaggedValue JSProxy::CallInternal(EcmaRuntimeCallInfo *info)
|
||||
|
||||
// 6.ReturnIfAbrupt(trap).
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
int32_t argc = info->GetArgsNumber();
|
||||
uint32_t argc = info->GetArgsNumber();
|
||||
JSHandle<JSTaggedValue> thisArg = info->GetThis();
|
||||
JSHandle<JSTaggedValue> undefined = globalConst->GetHandledUndefined();
|
||||
// 7.If trap is undefined, then
|
||||
@ -894,14 +894,14 @@ JSTaggedValue JSProxy::CallInternal(EcmaRuntimeCallInfo *info)
|
||||
}
|
||||
// 8.Let argArray be CreateArrayFromList(argumentsList).
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
JSHandle<TaggedArray> taggedArray = factory->NewTaggedArray(static_cast<uint32_t>(argc));
|
||||
for (int32_t index = 0; index < argc; ++index) {
|
||||
JSHandle<TaggedArray> taggedArray = factory->NewTaggedArray(argc);
|
||||
for (uint32_t index = 0; index < argc; ++index) {
|
||||
taggedArray->Set(thread, index, info->GetCallArg(index));
|
||||
}
|
||||
JSHandle<JSArray> arrHandle = JSArray::CreateArrayFromList(thread, taggedArray);
|
||||
|
||||
// 9.Return Call(trap, handler, «target, thisArgument, argArray»).
|
||||
const int32_t argsLength = 3; // 3: «target, thisArgument, argArray»
|
||||
const uint32_t argsLength = 3; // 3: «target, thisArgument, argArray»
|
||||
EcmaRuntimeCallInfo *runtimeInfo =
|
||||
EcmaInterpreter::NewRuntimeCallInfo(thread, method, handler, undefined, argsLength);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
@ -944,9 +944,9 @@ JSTaggedValue JSProxy::ConstructInternal(EcmaRuntimeCallInfo *info)
|
||||
|
||||
// 8.Let argArray be CreateArrayFromList(argumentsList).
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
int32_t argc = info->GetArgsNumber();
|
||||
JSHandle<TaggedArray> taggedArray = factory->NewTaggedArray(static_cast<uint32_t>(argc));
|
||||
for (int32_t index = 0; index < argc; ++index) {
|
||||
uint32_t argc = info->GetArgsNumber();
|
||||
JSHandle<TaggedArray> taggedArray = factory->NewTaggedArray(argc);
|
||||
for (uint32_t index = 0; index < argc; ++index) {
|
||||
taggedArray->Set(thread, index, info->GetCallArg(index));
|
||||
}
|
||||
JSHandle<JSArray> arrHandle = JSArray::CreateArrayFromList(thread, taggedArray);
|
||||
|
@ -29,7 +29,7 @@ namespace panda::ecmascript {
|
||||
JSTaggedValue JSStableArray::Push(JSHandle<JSArray> receiver, EcmaRuntimeCallInfo *argv)
|
||||
{
|
||||
JSThread *thread = argv->GetThread();
|
||||
uint32_t argc = static_cast<uint32_t>(argv->GetArgsNumber());
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
uint32_t oldLength = receiver->GetArrayLength();
|
||||
uint32_t newLength = argc + oldLength;
|
||||
|
||||
@ -74,7 +74,7 @@ JSTaggedValue JSStableArray::Splice(JSHandle<JSArray> receiver, EcmaRuntimeCallI
|
||||
{
|
||||
JSThread *thread = argv->GetThread();
|
||||
uint32_t len = receiver->GetArrayLength();
|
||||
uint32_t argc = static_cast<uint32_t>(argv->GetArgsNumber());
|
||||
uint32_t argc = argv->GetArgsNumber();
|
||||
|
||||
JSHandle<JSObject> thisObjHandle(receiver);
|
||||
JSTaggedValue newArray = JSArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(actualDeleteCount));
|
||||
|
@ -730,7 +730,7 @@ public:
|
||||
|
||||
class PUBLIC_API ArrayRef : public ObjectRef {
|
||||
public:
|
||||
static Local<ArrayRef> New(const EcmaVM *vm, int32_t length = 0);
|
||||
static Local<ArrayRef> New(const EcmaVM *vm, uint32_t length = 0);
|
||||
int32_t Length(const EcmaVM *vm);
|
||||
static bool SetValueAt(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t index, Local<JSValueRef> value);
|
||||
static Local<JSValueRef> GetValueAt(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t index);
|
||||
@ -1194,7 +1194,7 @@ public:
|
||||
|
||||
EcmaVM *GetVM() const;
|
||||
|
||||
inline int32_t GetArgsNumber() const
|
||||
inline uint32_t GetArgsNumber() const
|
||||
{
|
||||
return numArgs_;
|
||||
}
|
||||
@ -1242,7 +1242,7 @@ private:
|
||||
|
||||
private:
|
||||
JSThread *thread_ {nullptr};
|
||||
int32_t numArgs_ = 0;
|
||||
uint32_t numArgs_ = 0;
|
||||
JSTaggedType *stackArgs_ {nullptr};
|
||||
void *data_ {nullptr};
|
||||
friend class FunctionRef;
|
||||
|
@ -1224,7 +1224,7 @@ bool FunctionRef::IsNative(const EcmaVM *vm)
|
||||
}
|
||||
|
||||
// ----------------------------------- ArrayRef ----------------------------------------
|
||||
Local<ArrayRef> ArrayRef::New(const EcmaVM *vm, int32_t length)
|
||||
Local<ArrayRef> ArrayRef::New(const EcmaVM *vm, uint32_t length)
|
||||
{
|
||||
JSThread *thread = vm->GetJSThread();
|
||||
JSTaggedNumber arrayLen(length);
|
||||
|
@ -326,7 +326,7 @@ HWTEST_F_L0(JSNApiTests, GetProtoType)
|
||||
|
||||
void CheckReject(JsiRuntimeCallInfo* info)
|
||||
{
|
||||
ASSERT_EQ(info->GetArgsNumber(), 1);
|
||||
ASSERT_EQ(info->GetArgsNumber(), 1U);
|
||||
Local<JSValueRef> reason = info->GetCallArgRef(0);
|
||||
ASSERT_TRUE(reason->IsString());
|
||||
ASSERT_EQ(Local<StringRef>(reason)->ToString(), "Reject");
|
||||
@ -358,7 +358,7 @@ HWTEST_F_L0(JSNApiTests, PromiseCatch)
|
||||
|
||||
void CheckResolve(JsiRuntimeCallInfo* info)
|
||||
{
|
||||
ASSERT_EQ(info->GetArgsNumber(), 1);
|
||||
ASSERT_EQ(info->GetArgsNumber(), 1U);
|
||||
Local<JSValueRef> value = info->GetCallArgRef(0);
|
||||
ASSERT_TRUE(value->IsNumber());
|
||||
ASSERT_EQ(Local<NumberRef>(value)->Value(), 300.3); // 300.3 : test case of input
|
||||
|
@ -31,7 +31,7 @@ void DebuggerExecutor::Initialize(const EcmaVM *vm)
|
||||
Local<JSValueRef> DebuggerExecutor::DebuggerGetValue(JsiRuntimeCallInfo *runtimeCallInfo)
|
||||
{
|
||||
EcmaVM *vm = runtimeCallInfo->GetVM();
|
||||
int32_t argc = runtimeCallInfo->GetArgsNumber();
|
||||
uint32_t argc = runtimeCallInfo->GetArgsNumber();
|
||||
if (argc != NUM_ARGS) {
|
||||
return JSValueRef::Undefined(vm);
|
||||
}
|
||||
@ -62,7 +62,7 @@ Local<JSValueRef> DebuggerExecutor::DebuggerGetValue(JsiRuntimeCallInfo *runtime
|
||||
Local<JSValueRef> DebuggerExecutor::DebuggerSetValue(JsiRuntimeCallInfo *runtimeCallInfo)
|
||||
{
|
||||
EcmaVM *vm = runtimeCallInfo->GetVM();
|
||||
int32_t argc = runtimeCallInfo->GetArgsNumber();
|
||||
uint32_t argc = runtimeCallInfo->GetArgsNumber();
|
||||
if (argc != NUM_ARGS) {
|
||||
return JSValueRef::Undefined(vm);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ private:
|
||||
Local<StringRef> name, Local<JSValueRef> value);
|
||||
static bool SetGlobalValue(const EcmaVM *vm, Local<StringRef> name, Local<JSValueRef> value);
|
||||
|
||||
constexpr static int32_t NUM_ARGS = 2;
|
||||
constexpr static uint32_t NUM_ARGS = 2;
|
||||
};
|
||||
} // namespace tooling
|
||||
} // namespace panda::ecmascript
|
||||
|
Loading…
Reference in New Issue
Block a user