2021-09-04 08:06:49 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ecmascript/interpreter/slow_runtime_stub.h"
|
|
|
|
|
2022-03-24 07:04:57 +00:00
|
|
|
#include "ecmascript/interpreter/interpreter-inl.h"
|
2022-07-27 06:09:34 +00:00
|
|
|
#include "ecmascript/stubs/runtime_stubs-inl.h"
|
2021-09-04 08:06:49 +00:00
|
|
|
|
|
|
|
namespace panda::ecmascript {
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::CallSpread(JSThread *thread, JSTaggedValue func, JSTaggedValue obj,
|
2024-01-09 11:54:37 +00:00
|
|
|
JSTaggedValue array)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, CallSpread);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> jsFunc(thread, func);
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> jsArray(thread, array);
|
|
|
|
JSHandle<JSTaggedValue> taggedObj(thread, obj);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeCallSpread(thread, jsFunc, taggedObj, jsArray);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Neg(JSThread *thread, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Neg);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> inputTag(thread, value);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeNeg(thread, inputTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::AsyncFunctionEnter(JSThread *thread)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, AsyncFunctionEnter);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeAsyncFunctionEnter(thread);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::ToNumber(JSThread *thread, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, Tonumber);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> number(thread, value);
|
|
|
|
// may return exception
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeToNumber(thread, number);
|
2022-07-13 03:43:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::ToNumeric(JSThread *thread, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, Tonumeric);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> numeric(thread, value);
|
|
|
|
// may return exception
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeToNumeric(thread, numeric);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Not(JSThread *thread, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Not);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-03-25 02:59:10 +00:00
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> inputTag(thread, value);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeNot(thread, inputTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Inc(JSThread *thread, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Inc);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-05-16 11:38:24 +00:00
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> inputTag(thread, value);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeInc(thread, inputTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Dec(JSThread *thread, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Dec);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> inputTag(thread, value);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeDec(thread, inputTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
void SlowRuntimeStub::Throw(JSThread *thread, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Throw);
|
|
|
|
RuntimeStubs::RuntimeThrow(thread, value);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::GetPropIterator(JSThread *thread, JSTaggedValue value)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, GetPropIterator);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetPropIterator(thread, objHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlowRuntimeStub::ThrowConstAssignment(JSThread *thread, JSTaggedValue value)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowConstAssignment);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<EcmaString> name(thread, value.GetTaggedObject());
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeThrowConstAssignment(thread, name);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Add2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Add2);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> leftValue(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightValue(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeAdd2(thread, leftValue, rightValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Sub2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Sub2);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeSub2(thread, leftTag, rightTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Mul2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Mul2);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeMul2(thread, leftTag, rightTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Div2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Div2);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeDiv2(thread, leftTag, rightTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Mod2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Mod2);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeMod2(thread, leftTag, rightTag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Eq(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Eq);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> leftValue(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightValue(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeEq(thread, leftValue, rightValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::NotEq(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, NotEq);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> leftValue(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightValue(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeNotEq(thread, leftValue, rightValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Less(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Less);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> leftValue(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightValue(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeLess(thread, leftValue, rightValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LessEq(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, LessEq);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> leftValue(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightValue(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeLessEq(thread, leftValue, rightValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Greater(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Greater);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> leftValue(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightValue(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeGreater(thread, leftValue, rightValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::GreaterEq(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, GreaterEq);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> leftValue(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightValue(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeGreaterEq(thread, leftValue, rightValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Shl2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2022-03-10 13:25:06 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Shl2);
|
2022-03-10 13:25:06 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-03-25 02:59:10 +00:00
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeShl2(thread, leftTag, rightTag);
|
2022-03-10 13:25:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Shr2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2022-03-10 13:25:06 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Shr2);
|
2022-03-10 13:25:06 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeShr2(thread, leftTag, rightTag);
|
2022-03-10 13:25:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Ashr2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2022-03-10 13:25:06 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Ashr2);
|
2022-03-10 13:25:06 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeAshr2(thread, leftTag, rightTag);
|
2022-03-10 13:25:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::And2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2022-03-10 13:25:06 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, And2);
|
2022-03-10 13:25:06 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeAnd2(thread, leftTag, rightTag);
|
2022-03-10 13:25:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Or2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2022-03-10 13:25:06 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Or2);
|
2022-03-10 13:25:06 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeOr2(thread, leftTag, rightTag);
|
2022-03-10 13:25:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Xor2(JSThread *thread, JSTaggedValue left, JSTaggedValue right)
|
2022-03-10 13:25:06 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Xor2);
|
2022-03-10 13:25:06 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-05-12 07:19:53 +00:00
|
|
|
JSHandle<JSTaggedValue> leftTag(thread, left);
|
|
|
|
JSHandle<JSTaggedValue> rightTag(thread, right);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeXor2(thread, leftTag, rightTag);
|
2022-03-10 13:25:06 +00:00
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::ToJSTaggedValueWithInt32(JSThread *thread, JSTaggedValue value)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ToJSTaggedValueWithInt32);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeToJSTaggedValueWithInt32(thread, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::ToJSTaggedValueWithUint32(JSThread *thread, JSTaggedValue value)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ToJSTaggedValueWithUint32);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeToJSTaggedValueWithUint32(thread, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::DelObjProp(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, Delobjprop);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeDelObjProp(thread, objHandle, propHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::NewObjRange(JSThread *thread, JSTaggedValue func, JSTaggedValue newTarget,
|
2022-09-13 09:29:27 +00:00
|
|
|
uint16_t firstArgIdx, uint16_t length)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, NewobjRange);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> funcHandle(thread, func);
|
|
|
|
JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeNewObjRange(thread, funcHandle, newTargetHandle, firstArgIdx, length);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateObjectWithExcludedKeys(JSThread *thread, uint16_t numKeys, JSTaggedValue objVal,
|
|
|
|
uint16_t firstArgRegIdx)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, CreateObjectWithExcludedKeys);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> obj(thread, objVal);
|
|
|
|
return RuntimeStubs::RuntimeCreateObjectWithExcludedKeys(thread, numKeys, obj, firstArgRegIdx);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Exp(JSThread *thread, JSTaggedValue base, JSTaggedValue exponent)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Exp);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeExp(thread, base, exponent);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::IsIn(JSThread *thread, JSTaggedValue prop, JSTaggedValue obj)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, IsIn);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeIsIn(thread, propHandle, objHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::Instanceof(JSThread *thread, JSTaggedValue obj, JSTaggedValue target)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Instanceof);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> targetHandle(thread, target);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeInstanceof(thread, objHandle, targetHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 03:53:08 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::InstanceofByHandler(JSThread *thread, JSTaggedValue target, JSTaggedValue object,
|
|
|
|
JSTaggedValue instOfHandler)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, InstanceofByHandler);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objectHandle(thread, object);
|
|
|
|
JSHandle<JSTaggedValue> targetHandle(thread, target);
|
|
|
|
JSHandle<JSTaggedValue> instOfHandle(thread, instOfHandler);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeInstanceofByHandler(thread, targetHandle, objectHandle, instOfHandle);
|
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::NewLexicalEnv(JSThread *thread, uint16_t numVars)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, Newlexenv);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeNewLexicalEnv(thread, numVars);
|
2022-02-26 07:55:01 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 09:41:27 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::NewSendableEnv(JSThread *thread, uint16_t numVars)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, NewSendableEnv);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeNewSendableEnv(thread, numVars);
|
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::NewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uint16_t scopeId)
|
2022-02-26 07:55:01 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, NewlexenvwithName);
|
2022-02-26 07:55:01 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeNewLexicalEnvWithName(thread, numVars, scopeId);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateIterResultObj(JSThread *thread, JSTaggedValue value, JSTaggedValue flag)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, CreateIterResultObj);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateIterResultObj(thread, valueHandle, flag);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateGeneratorObj(JSThread *thread, JSTaggedValue genFunc)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, CreateGeneratorObj);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> generatorFunction(thread, genFunc);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateGeneratorObj(thread, generatorFunction);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-07-29 03:13:50 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::CreateAsyncGeneratorObj(JSThread *thread, JSTaggedValue genFunc)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, CreateAsyncGeneratorObj);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> asyncGeneratorFunction(thread, genFunc);
|
2022-08-29 09:08:06 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateAsyncGeneratorObj(thread, asyncGeneratorFunction);
|
2022-07-29 03:13:50 +00:00
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::SuspendGenerator(JSThread *thread, JSTaggedValue genObj, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, SuspendGenerator);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-29 03:13:50 +00:00
|
|
|
JSHandle<JSTaggedValue> genObjHandle(thread, genObj);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-08-29 09:08:06 +00:00
|
|
|
return RuntimeStubs::RuntimeSuspendGenerator(thread, genObjHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2023-01-12 10:49:18 +00:00
|
|
|
void SlowRuntimeStub::SetGeneratorState(JSThread *thread, JSTaggedValue genObj, int32_t index)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, SetGeneratorState);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> genObjHandle(thread, genObj);
|
|
|
|
return RuntimeStubs::RuntimeSetGeneratorState(thread, genObjHandle, index);
|
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::AsyncFunctionAwaitUncaught(JSThread *thread, JSTaggedValue asyncFuncObj,
|
|
|
|
JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, AsyncFunctionAwaitUncaught);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> asyncFuncObjHandle(thread, asyncFuncObj);
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-29 03:13:50 +00:00
|
|
|
|
2022-08-29 09:08:06 +00:00
|
|
|
return RuntimeStubs::RuntimeAsyncFunctionAwaitUncaught(thread, asyncFuncObjHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::AsyncFunctionResolveOrReject(JSThread *thread, JSTaggedValue asyncFuncObj,
|
|
|
|
JSTaggedValue value, bool is_resolve)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, AsyncFunctionResolveOrReject);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> asyncFuncObjHandle(thread, asyncFuncObj);
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeAsyncFunctionResolveOrReject(thread, asyncFuncObjHandle, valueHandle, is_resolve);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-16 15:48:09 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::NewObjApply(JSThread *thread, JSTaggedValue func, JSTaggedValue array)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-09-20 08:33:24 +00:00
|
|
|
INTERPRETER_TRACE(thread, NewObjApply);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> funcHandle(thread, func);
|
|
|
|
JSHandle<JSTaggedValue> jsArray(thread, array);
|
2022-08-16 15:48:09 +00:00
|
|
|
return RuntimeStubs::RuntimeNewObjApply(thread, funcHandle, jsArray);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlowRuntimeStub::ThrowUndefinedIfHole(JSThread *thread, JSTaggedValue obj)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowUndefinedIfHole);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<EcmaString> name(thread, obj);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeThrowUndefinedIfHole(thread, name);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::ThrowIfSuperNotCorrectCall(JSThread *thread, uint16_t index, JSTaggedValue thisValue)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowIfSuperNotCorrectCall);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeThrowIfSuperNotCorrectCall(thread, index, thisValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlowRuntimeStub::ThrowIfNotObject(JSThread *thread)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowIfNotObject);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
THROW_TYPE_ERROR(thread, "Inner return result is not object");
|
|
|
|
}
|
|
|
|
|
|
|
|
void SlowRuntimeStub::ThrowThrowNotExists(JSThread *thread)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowThrowNotExists);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeThrowIfNotObject(thread);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlowRuntimeStub::ThrowPatternNonCoercible(JSThread *thread)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowPatternNonCoercible);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeThrowPatternNonCoercible(thread);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StOwnByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, JSTaggedValue value)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StOwnByName);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStOwnByName(thread, objHandle, propHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-09-15 06:54:22 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::StOwnByNameWithNameSet(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop,
|
|
|
|
JSTaggedValue value)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StOwnByName);
|
2021-09-15 06:54:22 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStOwnByNameWithNameSet(thread, objHandle, propHandle, valueHandle);
|
2021-09-15 06:54:22 +00:00
|
|
|
}
|
2021-09-04 08:06:49 +00:00
|
|
|
|
2021-09-07 14:24:16 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::StOwnByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StOwnById);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
2021-09-07 14:24:16 +00:00
|
|
|
JSHandle<JSTaggedValue> idxHandle(thread, JSTaggedValue(idx));
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStOwnByIndex(thread, objHandle, idxHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StOwnByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue key, JSTaggedValue value)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StOwnByValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2021-09-15 06:54:22 +00:00
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> keyHandle(thread, key);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStOwnByValue(thread, objHandle, keyHandle, valueHandle);
|
2021-09-15 06:54:22 +00:00
|
|
|
}
|
2021-09-17 01:50:12 +00:00
|
|
|
|
2021-09-15 06:54:22 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::StOwnByValueWithNameSet(JSThread *thread, JSTaggedValue obj, JSTaggedValue key,
|
|
|
|
JSTaggedValue value)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StOwnByValue);
|
2022-07-27 06:09:34 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2021-09-15 06:54:22 +00:00
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> keyHandle(thread, key);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStOwnByValueWithNameSet(thread, objHandle, keyHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateEmptyArray(JSThread *thread, ObjectFactory *factory, JSHandle<GlobalEnv> globalEnv)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CreateEmptyArray);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateEmptyArray(thread, factory, globalEnv);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateEmptyObject(JSThread *thread, ObjectFactory *factory,
|
|
|
|
JSHandle<GlobalEnv> globalEnv)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CreateEmptyObject);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateEmptyObject(thread, factory, globalEnv);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateObjectWithBuffer(JSThread *thread, ObjectFactory *factory, JSObject *literal)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CreateObjectWithBuffer);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSObject> obj(thread, literal);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateObjectWithBuffer(thread, factory, obj);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateObjectHavingMethod(JSThread *thread, ObjectFactory *factory, JSObject *literal,
|
2022-08-16 13:05:02 +00:00
|
|
|
JSTaggedValue env)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CreateObjectHavingMethod);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSObject> obj(thread, literal);
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> envi(thread, env);
|
2022-08-16 13:05:02 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateObjectHavingMethod(thread, factory, obj, envi);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::SetObjectWithProto(JSThread *thread, JSTaggedValue proto, JSTaggedValue obj)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, SetObjectWithProto);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> protoHandle(thread, proto);
|
|
|
|
JSHandle<JSObject> objHandle(thread, obj);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeSetObjectWithProto(thread, protoHandle, objHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::IterNext(JSThread *thread, JSTaggedValue iter)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, IterNext);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> iterHandle(thread, iter);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeIterNext(thread, iterHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CloseIterator(JSThread *thread, JSTaggedValue iter)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CloseIterator);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> iterHandle(thread, iter);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCloseIterator(thread, iterHandle);
|
|
|
|
}
|
|
|
|
|
2022-09-18 12:12:18 +00:00
|
|
|
void SlowRuntimeStub::StModuleVar(JSThread *thread, int32_t index, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, StModuleVar);
|
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeStModuleVar(thread, index, value);
|
|
|
|
}
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
void SlowRuntimeStub::StModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, StModuleVar);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeStModuleVar(thread, key, value);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-09-18 12:12:18 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdLocalModuleVar(JSThread *thread, int32_t index)
|
|
|
|
{
|
2022-09-20 08:33:24 +00:00
|
|
|
RUNTIME_TRACE(thread, LdLocalModuleVarByIndex);
|
2022-09-18 12:12:18 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeLdLocalModuleVar(thread, index);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::LdExternalModuleVar(JSThread *thread, int32_t index)
|
|
|
|
{
|
2022-09-20 08:33:24 +00:00
|
|
|
RUNTIME_TRACE(thread, LdExternalModuleVarByIndex);
|
2022-09-18 12:12:18 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeLdExternalModuleVar(thread, index);
|
|
|
|
}
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdModuleVar(JSThread *thread, JSTaggedValue key, bool inner)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-01-30 08:01:33 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdModuleVar);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeLdModuleVar(thread, key, inner);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-09-07 14:24:16 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::CreateRegExpWithLiteral(JSThread *thread, JSTaggedValue pattern, uint8_t flags)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CreateRegExpWithLiteral);
|
2021-09-07 14:24:16 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> patternHandle(thread, pattern);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateRegExpWithLiteral(thread, patternHandle, flags);
|
2021-09-07 14:24:16 +00:00
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::CreateArrayWithBuffer(JSThread *thread, ObjectFactory *factory, JSArray *literal)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CreateArrayWithBuffer);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> array(thread, literal);
|
|
|
|
return RuntimeStubs::RuntimeCreateArrayWithBuffer(thread, factory, array);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::GetTemplateObject(JSThread *thread, JSTaggedValue literal)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, GetTemplateObject);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> templateLiteral(thread, literal);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetTemplateObject(thread, templateLiteral);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::GetNextPropName(JSThread *thread, JSTaggedValue iter)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, GetNextPropName);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> iterator(thread, iter);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetNextPropName(thread, iterator);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CopyDataProperties(JSThread *thread, JSTaggedValue dst, JSTaggedValue src)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, CopyDataProperties);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> dstHandle(thread, dst);
|
|
|
|
JSHandle<JSTaggedValue> srcHandle(thread, src);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCopyDataProperties(thread, dstHandle, srcHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::GetIteratorNext(JSThread *thread, JSTaggedValue obj, JSTaggedValue method)
|
|
|
|
{
|
2022-09-20 08:33:24 +00:00
|
|
|
RUNTIME_TRACE(thread, GetIteratorNext);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> iter(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> next(thread, method);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetIteratorNext(thread, iter, next);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::GetUnmapedArgs(JSThread *thread, JSTaggedType *sp, uint32_t actualNumArgs,
|
|
|
|
uint32_t startIdx)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, GetUnmapedArgs);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetUnmapedArgs(thread, sp, actualNumArgs, startIdx);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CopyRestArgs(JSThread *thread, JSTaggedType *sp, uint32_t restNumArgs, uint32_t startIdx)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, Copyrestargs);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeCopyRestArgs(thread, sp, restNumArgs, startIdx);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::GetIterator(JSThread *thread, JSTaggedValue obj)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, GetIterator);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetIterator(thread, objHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2023-01-12 10:49:18 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::GetAsyncIterator(JSThread *thread, JSTaggedValue obj)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, GetAsyncIterator);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
return RuntimeStubs::RuntimeGetAsyncIterator(thread, objHandle);
|
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::DefineGetterSetterByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop,
|
|
|
|
JSTaggedValue getter, JSTaggedValue setter, bool flag)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, DefineGetterSetterByValue);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSObject> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> getterHandle(thread, getter);
|
|
|
|
JSHandle<JSTaggedValue> setterHandle(thread, setter);
|
2023-10-31 06:47:29 +00:00
|
|
|
JSHandle<JSTaggedValue> func(thread, JSTaggedValue::Undefined());
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeDefineGetterSetterByValue(thread, objHandle, propHandle,
|
2023-10-31 06:47:29 +00:00
|
|
|
getterHandle, setterHandle, flag,
|
|
|
|
func, 0);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-09-07 14:24:16 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdObjByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, bool callGetter,
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue receiver)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdObjByIndex);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeLdObjByIndex(thread, objHandle, idx, callGetter, receiver);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-09-07 14:24:16 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::StObjByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, JSTaggedValue value)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StObjByIndex);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
|
|
|
return RuntimeStubs::RuntimeStObjByIndex(thread, objHandle, idx, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::LdObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, bool callGetter,
|
|
|
|
JSTaggedValue receiver)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdObjByName);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeLdObjByName(thread, obj, prop, callGetter, receiver);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, JSTaggedValue value)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StObjByName);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStObjByName(thread, objHandle, propHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::LdObjByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, bool callGetter,
|
|
|
|
JSTaggedValue receiver)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdObjByValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
return RuntimeStubs::RuntimeLdObjByValue(thread, objHandle, propHandle, callGetter, receiver);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StObjByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop,
|
|
|
|
JSTaggedValue value)
|
|
|
|
{
|
2022-08-16 15:48:09 +00:00
|
|
|
INTERPRETER_TRACE(thread, StObjByValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStObjByValue(thread, objHandle, propHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-08-02 07:54:31 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::TryLdGlobalByNameFromGlobalProto(JSThread *thread, JSTaggedValue global,
|
|
|
|
JSTaggedValue prop)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, Trygetobjprop);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2021-09-13 06:11:34 +00:00
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> obj(thread, global.GetTaggedObject()->GetClass()->GetPrototype());
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeTryLdGlobalByName(thread, obj, propHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::TryStGlobalByName(JSThread *thread, JSTaggedValue prop)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, TryStGlobalByName);
|
2021-09-04 08:06:49 +00:00
|
|
|
// If fast path is fail, not need slow path, just throw error.
|
|
|
|
return ThrowReferenceError(thread, prop, " is not defined");
|
|
|
|
}
|
|
|
|
|
2022-08-02 07:54:31 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdGlobalVarFromGlobalProto(JSThread *thread, JSTaggedValue global, JSTaggedValue prop)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdGlobalVar);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, global);
|
2021-09-04 08:06:49 +00:00
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeLdGlobalVarFromProto(thread, objHandle, propHandle); // After checked global itself.
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StGlobalVar(JSThread *thread, JSTaggedValue prop, JSTaggedValue value)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, StGlobalVar);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStGlobalVar(thread, propHandle, valueHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-09-10 08:34:37 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::TryUpdateGlobalRecord(JSThread *thread, JSTaggedValue prop, JSTaggedValue value)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, TryUpdateGlobalRecord);
|
2021-09-10 08:34:37 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeTryUpdateGlobalRecord(thread, prop, value);
|
2021-09-10 08:34:37 +00:00
|
|
|
}
|
|
|
|
|
2021-10-12 08:57:22 +00:00
|
|
|
// return box
|
2022-02-16 03:05:56 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdGlobalRecord(JSThread *thread, JSTaggedValue key)
|
2021-09-11 01:54:43 +00:00
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdGlobalRecord);
|
2021-09-10 08:34:37 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeLdGlobalRecord(thread, key);
|
2021-09-10 08:34:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StGlobalRecord(JSThread *thread, JSTaggedValue prop, JSTaggedValue value, bool isConst)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, StGlobalRecord);
|
2021-09-10 08:34:37 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStGlobalRecord(thread, propHandle, valueHandle, isConst);
|
2021-09-10 08:34:37 +00:00
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::ThrowReferenceError(JSThread *thread, JSTaggedValue prop, const char *desc)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowReferenceError);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, prop);
|
|
|
|
return RuntimeStubs::RuntimeThrowReferenceError(thread, propHandle, desc);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::ThrowTypeError(JSThread *thread, const char *message)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowTypeError);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeThrowTypeError(thread, message);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-09-10 08:34:37 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::ThrowSyntaxError(JSThread *thread, const char *message)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowSyntaxError);
|
2021-09-10 08:34:37 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-07-27 06:09:34 +00:00
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeThrowSyntaxError(thread, message);
|
2021-09-10 08:34:37 +00:00
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::StArraySpread(JSThread *thread, JSTaggedValue dst, JSTaggedValue index,
|
|
|
|
JSTaggedValue src)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, StArraySpread);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> dstHandle(thread, dst);
|
|
|
|
JSHandle<JSTaggedValue> srcHandle(thread, src);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStArraySpread(thread, dstHandle, index, srcHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2023-11-14 13:23:21 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::DefineFunc(JSThread *thread, JSTaggedValue constPool, uint16_t methodId,
|
2023-12-19 12:16:54 +00:00
|
|
|
JSTaggedValue module, uint16_t length, JSTaggedValue env,
|
|
|
|
JSTaggedValue homeObject)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2022-08-31 14:13:23 +00:00
|
|
|
INTERPRETER_TRACE(thread, DefineFunc);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2023-11-14 13:23:21 +00:00
|
|
|
JSHandle<JSTaggedValue> constpoolHandle(thread, constPool);
|
|
|
|
JSHandle<JSTaggedValue> moduleHandle(thread, module);
|
2023-12-19 12:16:54 +00:00
|
|
|
JSHandle<JSTaggedValue> envHandle(thread, env);
|
|
|
|
JSHandle<JSTaggedValue> homeObjectHandle(thread, homeObject);
|
|
|
|
return RuntimeStubs::RuntimeDefinefunc(thread, constpoolHandle, methodId, moduleHandle,
|
|
|
|
length, envHandle, homeObjectHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-05-02 08:47:45 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::GetSuperConstructor(JSThread *thread, JSTaggedValue ctor)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, GetSuperConstructor);
|
|
|
|
JSHandle<JSTaggedValue> ctorHandle(thread, ctor);
|
|
|
|
JSHandle<JSTaggedValue> superConstructor(thread, JSTaggedValue::GetPrototype(thread, ctorHandle));
|
|
|
|
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
|
|
|
return superConstructor.GetTaggedValue();
|
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::SuperCall(JSThread *thread, JSTaggedValue func, JSTaggedValue newTarget,
|
|
|
|
uint16_t firstVRegIdx, uint16_t length)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, SuperCall);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> funcHandle(thread, func);
|
|
|
|
JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeSuperCall(thread, funcHandle, newTargetHandle, firstVRegIdx, length);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2022-09-02 07:52:55 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::DynamicImport(JSThread *thread, JSTaggedValue specifier, JSTaggedValue currentFunc)
|
2022-08-27 10:57:41 +00:00
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, DynamicImport);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-09-02 07:52:55 +00:00
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> specifierHandle(thread, specifier);
|
|
|
|
JSHandle<JSTaggedValue> currentFuncHandle(thread, currentFunc);
|
|
|
|
return RuntimeStubs::RuntimeDynamicImport(thread, specifierHandle, currentFuncHandle);
|
2022-08-27 10:57:41 +00:00
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::SuperCallSpread(JSThread *thread, JSTaggedValue func, JSTaggedValue newTarget,
|
|
|
|
JSTaggedValue array)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, SuperCallSpread);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> funcHandle(thread, func);
|
|
|
|
JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget);
|
|
|
|
JSHandle<JSTaggedValue> jsArray(thread, array);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeSuperCallSpread(thread, funcHandle, newTargetHandle, jsArray);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2024-06-13 14:08:48 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::SuperCallForwardAllArgs(JSThread *thread, JSTaggedType *sp, JSTaggedValue func,
|
|
|
|
JSTaggedValue newTarget, uint32_t restNumArgs, uint32_t startIdx)
|
|
|
|
{
|
|
|
|
JSHandle<JSTaggedValue> superFunc(thread, GetSuperConstructor(thread, func));
|
|
|
|
JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget);
|
|
|
|
return RuntimeStubs::RuntimeSuperCallForwardAllArgs(thread, sp, superFunc, newTargetHandle, restNumArgs, startIdx);
|
|
|
|
}
|
|
|
|
|
2023-12-19 12:16:54 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::DefineMethod(JSThread *thread, Method *method, JSTaggedValue homeObject,
|
2024-02-20 10:38:38 +00:00
|
|
|
uint16_t length, JSTaggedValue env, JSTaggedValue module)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, DefineMethod);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2022-08-31 14:13:23 +00:00
|
|
|
JSHandle<Method> methodHandle(thread, method);
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> homeObjectHandle(thread, homeObject);
|
2023-12-19 12:16:54 +00:00
|
|
|
JSHandle<JSTaggedValue> envHandle(thread, env);
|
2024-02-20 10:38:38 +00:00
|
|
|
JSHandle<JSTaggedValue> moduleHandle(thread, module);
|
|
|
|
return RuntimeStubs::RuntimeDefineMethod(thread, methodHandle, homeObjectHandle, length, envHandle, moduleHandle);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2023-12-30 09:41:07 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdSendableClass(JSThread *thread, JSTaggedValue env, uint16_t level)
|
2023-12-22 13:09:57 +00:00
|
|
|
{
|
2023-12-30 09:41:07 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdSendableClass);
|
2023-12-22 13:09:57 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2023-12-19 12:16:54 +00:00
|
|
|
JSHandle<JSTaggedValue> envHandle(thread, env);
|
2023-12-30 09:41:07 +00:00
|
|
|
return RuntimeStubs::RuntimeLdSendableClass(envHandle, level);
|
2023-12-22 13:09:57 +00:00
|
|
|
}
|
|
|
|
|
2024-02-19 07:30:31 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdSendableExternalModuleVar(JSThread *thread, int32_t index, JSTaggedValue thisFunc)
|
|
|
|
{
|
|
|
|
RUNTIME_TRACE(thread, LdSendableExternalModuleVarByIndex);
|
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeLdSendableExternalModuleVar(thread, index, thisFunc);
|
|
|
|
}
|
|
|
|
|
2024-07-09 16:41:17 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdLazyExternalModuleVar(JSThread *thread, int32_t index, JSTaggedValue thisFunc)
|
|
|
|
{
|
|
|
|
RUNTIME_TRACE(thread, LdLazyExternalModuleVarByIndex);
|
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
|
|
|
return RuntimeStubs::RuntimeLdLazyExternalModuleVar(thread, index, thisFunc);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::LdLazySendableExternalModuleVar(JSThread *thread, int32_t index, JSTaggedValue thisFunc)
|
|
|
|
{
|
|
|
|
RUNTIME_TRACE(thread, LdLazySendableExternalModuleVarByIndex);
|
|
|
|
[[maybe_unused]] EcmaHandleScope scope(thread);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeLdLazySendableExternalModuleVar(thread, index, thisFunc);
|
|
|
|
}
|
|
|
|
|
2021-09-04 08:06:49 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdSuperByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue key,
|
|
|
|
JSTaggedValue thisFunc)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, LdSuperByValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, key);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeLdSuperByValue(thread, objHandle, propHandle, thisFunc);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StSuperByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue key,
|
|
|
|
JSTaggedValue value, JSTaggedValue thisFunc)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, StSuperByValue);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> objHandle(thread, obj);
|
|
|
|
JSHandle<JSTaggedValue> propHandle(thread, key);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeStSuperByValue(thread, objHandle, propHandle, valueHandle, thisFunc);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::GetCallSpreadArgs(JSThread *thread, JSTaggedValue array)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, GetCallSpreadArgs);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> jsArray(thread, array);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetCallSpreadArgs(thread, jsArray);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlowRuntimeStub::ThrowDeleteSuperProperty(JSThread *thread)
|
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, ThrowDeleteSuperProperty);
|
2021-09-04 08:06:49 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeThrowDeleteSuperProperty(thread);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
|
|
|
|
2024-01-17 12:23:59 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::NotifyInlineCache(JSThread *thread, JSFunction *function)
|
2021-09-04 08:06:49 +00:00
|
|
|
{
|
2021-09-16 03:25:47 +00:00
|
|
|
INTERPRETER_TRACE(thread, NotifyInlineCache);
|
2022-07-27 06:09:34 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
2021-09-04 08:06:49 +00:00
|
|
|
|
2024-01-17 12:23:59 +00:00
|
|
|
JSHandle<JSFunction> functionHandle(thread, function);
|
|
|
|
uint32_t slotSize = functionHandle->GetCallTarget()->GetSlotSize();
|
|
|
|
return RuntimeStubs::RuntimeNotifyInlineCache(thread, functionHandle, slotSize);
|
2021-09-04 08:06:49 +00:00
|
|
|
}
|
2021-12-25 01:51:43 +00:00
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::ResolveClass(JSThread *thread, JSTaggedValue ctor, TaggedArray *literal,
|
2022-08-16 13:05:02 +00:00
|
|
|
JSTaggedValue base, JSTaggedValue lexenv)
|
2021-12-25 01:51:43 +00:00
|
|
|
{
|
|
|
|
JSHandle<JSFunction> cls(thread, ctor);
|
|
|
|
JSHandle<TaggedArray> literalBuffer(thread, literal);
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> baseHandle(thread, base);
|
2021-12-25 01:51:43 +00:00
|
|
|
JSHandle<JSTaggedValue> lexicalEnv(thread, lexenv);
|
2022-08-16 13:05:02 +00:00
|
|
|
return RuntimeStubs::RuntimeResolveClass(thread, cls, literalBuffer, baseHandle, lexicalEnv);
|
2021-12-25 01:51:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// clone class may need re-set inheritance relationship due to extends may be a variable.
|
|
|
|
JSTaggedValue SlowRuntimeStub::CloneClassFromTemplate(JSThread *thread, JSTaggedValue ctor, JSTaggedValue base,
|
2022-08-16 13:05:02 +00:00
|
|
|
JSTaggedValue lexenv)
|
2021-12-25 01:51:43 +00:00
|
|
|
{
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> lexenvHandle(thread, lexenv);
|
|
|
|
JSHandle<JSTaggedValue> baseHandle(thread, base);
|
|
|
|
JSHandle<JSFunction> cls(thread, ctor);
|
2022-08-16 13:05:02 +00:00
|
|
|
return RuntimeStubs::RuntimeCloneClassFromTemplate(thread, cls, baseHandle, lexenvHandle);
|
2021-12-25 01:51:43 +00:00
|
|
|
}
|
|
|
|
|
2022-08-25 11:32:26 +00:00
|
|
|
// clone class may need re-set inheritance relationship due to extends may be a variable.
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreateClassWithBuffer(JSThread *thread, JSTaggedValue base,
|
|
|
|
JSTaggedValue lexenv, JSTaggedValue constpool,
|
2023-12-19 12:16:54 +00:00
|
|
|
uint16_t methodId, uint16_t literalId, JSTaggedValue module,
|
|
|
|
JSTaggedValue length)
|
2022-08-25 11:32:26 +00:00
|
|
|
{
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
JSHandle<JSTaggedValue> baseHandle(thread, base);
|
|
|
|
JSHandle<JSTaggedValue> lexenvHandle(thread, lexenv);
|
|
|
|
JSHandle<JSTaggedValue> constpoolHandle(thread, constpool);
|
2022-10-17 01:19:55 +00:00
|
|
|
JSHandle<JSTaggedValue> moduleHandle(thread, module);
|
2023-12-19 12:16:54 +00:00
|
|
|
JSHandle<JSTaggedValue> lengthHandle(thread, length);
|
2022-09-20 08:33:24 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateClassWithBuffer(thread, baseHandle, lexenvHandle,
|
2023-12-19 12:16:54 +00:00
|
|
|
constpoolHandle, methodId, literalId,
|
|
|
|
moduleHandle, lengthHandle);
|
2022-08-25 11:32:26 +00:00
|
|
|
}
|
|
|
|
|
2023-12-30 09:41:07 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::CreateSharedClass(JSThread *thread, JSTaggedValue base,
|
2023-12-23 11:57:20 +00:00
|
|
|
JSTaggedValue constpool, uint16_t methodId, uint16_t literalId,
|
|
|
|
uint16_t length, JSTaggedValue module)
|
2023-12-14 08:18:09 +00:00
|
|
|
{
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
JSHandle<JSTaggedValue> baseHandle(thread, base);
|
|
|
|
JSHandle<JSTaggedValue> constpoolHandle(thread, constpool);
|
|
|
|
JSHandle<JSTaggedValue> moduleHandle(thread, module);
|
2023-12-30 09:41:07 +00:00
|
|
|
return RuntimeStubs::RuntimeCreateSharedClass(thread, baseHandle, constpoolHandle, methodId,
|
2023-12-23 11:57:20 +00:00
|
|
|
literalId, length, moduleHandle);
|
2023-12-14 08:18:09 +00:00
|
|
|
}
|
|
|
|
|
2021-12-25 01:51:43 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::SetClassInheritanceRelationship(JSThread *thread, JSTaggedValue ctor, JSTaggedValue base)
|
|
|
|
{
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> cls(thread, ctor);
|
2022-07-27 06:09:34 +00:00
|
|
|
JSHandle<JSTaggedValue> parent(thread, base);
|
|
|
|
return RuntimeStubs::RuntimeSetClassInheritanceRelationship(thread, cls, parent);
|
2021-12-25 01:51:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::SetClassConstructorLength(JSThread *thread, JSTaggedValue ctor, JSTaggedValue length)
|
|
|
|
{
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeSetClassConstructorLength(thread, ctor, length);
|
2021-12-25 01:51:43 +00:00
|
|
|
}
|
2022-01-30 08:01:33 +00:00
|
|
|
|
2022-09-18 12:12:18 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::GetModuleNamespace(JSThread *thread, int32_t index)
|
|
|
|
{
|
|
|
|
return RuntimeStubs::RuntimeGetModuleNamespace(thread, index);
|
|
|
|
}
|
|
|
|
|
2022-01-30 08:01:33 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::GetModuleNamespace(JSThread *thread, JSTaggedValue localName)
|
|
|
|
{
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeGetModuleNamespace(thread, localName);
|
2022-01-30 08:01:33 +00:00
|
|
|
}
|
2022-03-10 13:25:06 +00:00
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::LdBigInt(JSThread *thread, JSTaggedValue numberBigInt)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, LdBigInt);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
JSHandle<JSTaggedValue> bigint(thread, numberBigInt);
|
2022-07-27 06:09:34 +00:00
|
|
|
return RuntimeStubs::RuntimeLdBigInt(thread, bigint);
|
2022-03-10 13:25:06 +00:00
|
|
|
}
|
2022-07-29 03:13:50 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::AsyncGeneratorResolve(JSThread *thread, JSTaggedValue asyncFuncObj,
|
|
|
|
const JSTaggedValue value, JSTaggedValue flag)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, AsyncGeneratorResolve);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
2022-08-29 09:08:06 +00:00
|
|
|
JSHandle<JSTaggedValue> genObjHandle(thread, asyncFuncObj);
|
2022-07-29 03:13:50 +00:00
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
2022-08-29 09:08:06 +00:00
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeAsyncGeneratorResolve(thread, genObjHandle, valueHandle, flag);
|
2022-07-29 03:13:50 +00:00
|
|
|
}
|
|
|
|
|
2022-08-11 02:28:22 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::AsyncGeneratorReject(JSThread *thread, JSTaggedValue asyncFuncObj,
|
|
|
|
const JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, AsyncGeneratorReject);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSAsyncGeneratorObject> asyncFuncObjHandle(thread, asyncFuncObj);
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
|
|
|
|
|
|
|
return JSAsyncGeneratorObject::AsyncGeneratorReject(thread, asyncFuncObjHandle, valueHandle);
|
|
|
|
}
|
|
|
|
|
2022-09-03 08:08:40 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::LdPatchVar(JSThread *thread, uint32_t index)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, LdPatchVar);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
return RuntimeStubs::RuntimeLdPatchVar(thread, index);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StPatchVar(JSThread *thread, uint32_t index, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, StPatchVar);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
|
|
|
|
JSHandle<JSTaggedValue> valueHandle(thread, value);
|
|
|
|
return RuntimeStubs::RuntimeStPatchVar(thread, index, valueHandle);
|
|
|
|
}
|
2023-02-09 09:12:46 +00:00
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::NotifyConcurrentResult(JSThread *thread, JSTaggedValue result, JSTaggedValue hint)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, NotifyConcurrentResult);
|
|
|
|
return RuntimeStubs::RuntimeNotifyConcurrentResult(thread, result, hint);
|
|
|
|
}
|
2023-10-31 06:47:29 +00:00
|
|
|
|
2023-12-22 05:41:23 +00:00
|
|
|
JSTaggedValue SlowRuntimeStub::UpdateAOTHClass(JSThread *thread, JSTaggedValue jshclass,
|
|
|
|
JSTaggedValue newjshclass, JSTaggedValue key)
|
2023-10-31 06:47:29 +00:00
|
|
|
{
|
2023-12-22 05:41:23 +00:00
|
|
|
INTERPRETER_TRACE(thread, UpdateAOTHClass);
|
2023-10-31 06:47:29 +00:00
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
JSHandle<JSHClass> oldhclass(thread, jshclass);
|
|
|
|
JSHandle<JSHClass> newhclass(thread, newjshclass);
|
2023-12-22 05:41:23 +00:00
|
|
|
return RuntimeStubs::RuntimeUpdateAOTHClass(thread, oldhclass, newhclass, key);
|
2023-10-31 06:47:29 +00:00
|
|
|
}
|
2023-12-01 07:52:13 +00:00
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::DefineField(JSThread *thread, JSTaggedValue obj,
|
|
|
|
JSTaggedValue propKey, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, DefineField);
|
|
|
|
return RuntimeStubs::RuntimeDefineField(thread, obj, propKey, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::CreatePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv,
|
|
|
|
uint32_t count, JSTaggedValue constpool, uint32_t literalId, JSTaggedValue module)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, CreatePrivateProperty);
|
|
|
|
return RuntimeStubs::RuntimeCreatePrivateProperty(thread, lexicalEnv, count, constpool, literalId, module);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::DefinePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv,
|
|
|
|
uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, DefinePrivateProperty);
|
|
|
|
return RuntimeStubs::RuntimeDefinePrivateProperty(thread, lexicalEnv, levelIndex, slotIndex, obj, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::LdPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv,
|
|
|
|
uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, LdPrivateProperty);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
return RuntimeStubs::RuntimeLdPrivateProperty(thread, lexicalEnv, levelIndex, slotIndex, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::StPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv,
|
|
|
|
uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj, JSTaggedValue value)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, StPrivateProperty);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
return RuntimeStubs::RuntimeStPrivateProperty(thread, lexicalEnv, levelIndex, slotIndex, obj, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSTaggedValue SlowRuntimeStub::TestIn(JSThread *thread, JSTaggedValue lexicalEnv,
|
|
|
|
uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj)
|
|
|
|
{
|
|
|
|
INTERPRETER_TRACE(thread, TestIn);
|
|
|
|
[[maybe_unused]] EcmaHandleScope handleScope(thread);
|
|
|
|
return RuntimeStubs::RuntimeTestIn(thread, lexicalEnv, levelIndex, slotIndex, obj);
|
|
|
|
}
|
2022-02-10 13:57:57 +00:00
|
|
|
} // namespace panda::ecmascript
|