Lines Matching full:thread
48 JSTaggedValue SlowRuntimeStub::CallSpreadDyn(JSThread *thread, JSTaggedValue func, JSTaggedValue ob… in CallSpreadDyn() argument
51 INTERPRETER_TRACE(thread, CallSpreadDyn); in CallSpreadDyn()
53 THROW_TYPE_ERROR_AND_RETURN(thread, "cannot Callspread", JSTaggedValue::Exception()); in CallSpreadDyn()
55 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CallSpreadDyn()
57 JSHandle<JSFunction> jsFunc(thread, func); in CallSpreadDyn()
58 JSHandle<JSTaggedValue> jsArray(thread, array); in CallSpreadDyn()
59 JSHandle<JSTaggedValue> taggedObj(thread, obj); in CallSpreadDyn()
61 … JSHandle<TaggedArray> coretypesArray(thread, GetCallSpreadArgs(thread, jsArray.GetTaggedValue())); in CallSpreadDyn()
62 InternalCallParams *params = thread->GetInternalCallParams(); in CallSpreadDyn()
64 JSHandle<JSTaggedValue> newTarget(thread, JSTaggedValue::Undefined()); in CallSpreadDyn()
65 JSTaggedValue res = InvokeJsFunction(thread, jsFunc, taggedObj, newTarget, params); in CallSpreadDyn()
70 JSTaggedValue SlowRuntimeStub::NegDyn(JSThread *thread, JSTaggedValue value) in NegDyn() argument
72 INTERPRETER_TRACE(thread, NegDyn); in NegDyn()
73 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NegDyn()
75 JSHandle<JSTaggedValue> input(thread, value); in NegDyn()
76 JSHandle<JSTaggedValue> inputVal(thread, JSTaggedValue::ToNumeric(thread, input)); in NegDyn()
77 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in NegDyn()
80 return BigInt::UnaryMinus(thread, bigValue).GetTaggedValue(); in NegDyn()
96 JSTaggedValue SlowRuntimeStub::AsyncFunctionEnter(JSThread *thread) in AsyncFunctionEnter() argument
98 INTERPRETER_TRACE(thread, AsyncFunctionEnter); in AsyncFunctionEnter()
99 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in AsyncFunctionEnter()
100 [[maybe_unused]] EcmaHandleScope handleScope(thread); in AsyncFunctionEnter()
102 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in AsyncFunctionEnter()
110 asyncFuncObj->SetPromise(thread, promiseObject); in AsyncFunctionEnter()
113 context->SetGeneratorObject(thread, asyncFuncObj); in AsyncFunctionEnter()
117 asyncFuncObj->SetGeneratorContext(thread, context); in AsyncFunctionEnter()
120 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in AsyncFunctionEnter()
124 JSTaggedValue SlowRuntimeStub::ToNumber(JSThread *thread, JSTaggedValue value) in ToNumber() argument
126 INTERPRETER_TRACE(thread, Tonumber); in ToNumber()
127 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ToNumber()
129 JSHandle<JSTaggedValue> number(thread, value); in ToNumber()
131 return JSTaggedValue::ToNumeric(thread, number); in ToNumber()
134 JSTaggedValue SlowRuntimeStub::NotDyn(JSThread *thread, JSTaggedValue value) in NotDyn() argument
136 INTERPRETER_TRACE(thread, NotDyn); in NotDyn()
137 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NotDyn()
138 JSHandle<JSTaggedValue> input(thread, value); in NotDyn()
139 JSHandle<JSTaggedValue> inputVal(thread, JSTaggedValue::ToNumeric(thread, input)); in NotDyn()
140 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in NotDyn()
143 return BigInt::BitwiseNOT(thread, bigValue).GetTaggedValue(); in NotDyn()
145 int32_t number = JSTaggedValue::ToInt32(thread, inputVal); in NotDyn()
149 JSTaggedValue SlowRuntimeStub::IncDyn(JSThread *thread, JSTaggedValue value) in IncDyn() argument
151 INTERPRETER_TRACE(thread, IncDyn); in IncDyn()
152 [[maybe_unused]] EcmaHandleScope handleScope(thread); in IncDyn()
154 JSHandle<JSTaggedValue> input(thread, value); in IncDyn()
155 JSHandle<JSTaggedValue> inputVal(thread, JSTaggedValue::ToNumeric(thread, input)); in IncDyn()
156 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IncDyn()
159 return BigInt::BigintAddOne(thread, bigValue).GetTaggedValue(); in IncDyn()
165 JSTaggedValue SlowRuntimeStub::DecDyn(JSThread *thread, JSTaggedValue value) in DecDyn() argument
167 INTERPRETER_TRACE(thread, DecDyn); in DecDyn()
168 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DecDyn()
170 JSHandle<JSTaggedValue> input(thread, value); in DecDyn()
171 JSHandle<JSTaggedValue> inputVal(thread, JSTaggedValue::ToNumeric(thread, input)); in DecDyn()
172 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in DecDyn()
175 return BigInt::BigintSubOne(thread, bigValue).GetTaggedValue(); in DecDyn()
181 void SlowRuntimeStub::ThrowDyn(JSThread *thread, JSTaggedValue value) in ThrowDyn() argument
183 INTERPRETER_TRACE(thread, ThrowDyn); in ThrowDyn()
184 thread->SetException(value); in ThrowDyn()
187 JSTaggedValue SlowRuntimeStub::GetPropIterator(JSThread *thread, JSTaggedValue value) in GetPropIterator() argument
189 INTERPRETER_TRACE(thread, GetPropIterator); in GetPropIterator()
190 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GetPropIterator()
192 JSHandle<JSTaggedValue> objHandle(thread, value); in GetPropIterator()
193 … JSHandle<JSForInIterator> iteratorHandle = JSObject::EnumerateObjectProperties(thread, objHandle); in GetPropIterator()
194 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetPropIterator()
198 void SlowRuntimeStub::ThrowConstAssignment(JSThread *thread, JSTaggedValue value) in ThrowConstAssignment() argument
200 INTERPRETER_TRACE(thread, ThrowConstAssignment); in ThrowConstAssignment()
201 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowConstAssignment()
203 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in ThrowConstAssignment()
205 JSHandle<EcmaString> name(thread, value.GetTaggedObject()); in ThrowConstAssignment()
209 …THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::TYPE_ERROR, msg).GetTagged… in ThrowConstAssignment()
212 JSTaggedValue SlowRuntimeStub::Add2Dyn(JSThread *thread, EcmaVM *ecma_vm, JSTaggedValue left, JSTag… in Add2Dyn() argument
214 INTERPRETER_TRACE(thread, Add2Dyn); in Add2Dyn()
215 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Add2Dyn()
217 JSHandle<JSTaggedValue> leftValue(thread, left); in Add2Dyn()
218 JSHandle<JSTaggedValue> rightValue(thread, right); in Add2Dyn()
220 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Add2Dyn()
225 JSHandle<JSTaggedValue> primitiveA0(thread, JSTaggedValue::ToPrimitive(thread, leftValue)); in Add2Dyn()
226 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Add2Dyn()
227 JSHandle<JSTaggedValue> primitiveA1(thread, JSTaggedValue::ToPrimitive(thread, rightValue)); in Add2Dyn()
228 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Add2Dyn()
231 JSHandle<EcmaString> stringA0 = JSTaggedValue::ToString(thread, primitiveA0); in Add2Dyn()
232 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Add2Dyn()
233 JSHandle<EcmaString> stringA1 = JSTaggedValue::ToString(thread, primitiveA1); in Add2Dyn()
234 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Add2Dyn()
235 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Add2Dyn()
239 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, primitiveA0)); in Add2Dyn()
240 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Add2Dyn()
241 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, primitiveA1)); in Add2Dyn()
242 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Add2Dyn()
246 return BigInt::Add(thread, bigLeft, bigRight).GetTaggedValue(); in Add2Dyn()
249 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Add2Dyn()
256 JSTaggedValue SlowRuntimeStub::Sub2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Sub2Dyn() argument
258 INTERPRETER_TRACE(thread, Sub2Dyn); in Sub2Dyn()
259 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Sub2Dyn()
261 JSHandle<JSTaggedValue> leftHandle(thread, left); in Sub2Dyn()
262 JSHandle<JSTaggedValue> rightHandle(thread, right); in Sub2Dyn()
263 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Sub2Dyn()
264 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sub2Dyn()
265 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Sub2Dyn()
266 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sub2Dyn()
270 return BigInt::Subtract(thread, bigLeft, bigRight).GetTaggedValue(); in Sub2Dyn()
273 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Sub2Dyn()
280 JSTaggedValue SlowRuntimeStub::Mul2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Mul2Dyn() argument
282 INTERPRETER_TRACE(thread, Mul2Dyn); in Mul2Dyn()
283 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Mul2Dyn()
285 JSHandle<JSTaggedValue> leftHandle(thread, left); in Mul2Dyn()
286 JSHandle<JSTaggedValue> rightHandle(thread, right); in Mul2Dyn()
287 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Mul2Dyn()
288 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Mul2Dyn()
289 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Mul2Dyn()
290 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Mul2Dyn()
295 return BigInt::Multiply(thread, bigLeft, bigRight).GetTaggedValue(); in Mul2Dyn()
298 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Mul2Dyn()
306 JSTaggedValue SlowRuntimeStub::Div2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Div2Dyn() argument
308 INTERPRETER_TRACE(thread, Div2Dyn); in Div2Dyn()
309 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Div2Dyn()
311 JSHandle<JSTaggedValue> leftHandle(thread, left); in Div2Dyn()
312 JSHandle<JSTaggedValue> rightHandle(thread, right); in Div2Dyn()
313 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Div2Dyn()
314 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Div2Dyn()
315 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Div2Dyn()
316 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Div2Dyn()
320 return BigInt::Divide(thread, bigLeft, bigRight).GetTaggedValue(); in Div2Dyn()
323 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Div2Dyn()
338 JSTaggedValue SlowRuntimeStub::Mod2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Mod2Dyn() argument
340 INTERPRETER_TRACE(thread, Mod2Dyn); in Mod2Dyn()
341 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Mod2Dyn()
343 JSHandle<JSTaggedValue> leftHandle(thread, left); in Mod2Dyn()
344 JSHandle<JSTaggedValue> rightHandle(thread, right); in Mod2Dyn()
345 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Mod2Dyn()
346 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Mod2Dyn()
347 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Mod2Dyn()
348 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Mod2Dyn()
354 return BigInt::Remainder(thread, leftBigint, rightBigint).GetTaggedValue(); in Mod2Dyn()
357 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Mod2Dyn()
371 JSTaggedValue SlowRuntimeStub::EqDyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in EqDyn() argument
373 INTERPRETER_TRACE(thread, EqDyn); in EqDyn()
374 [[maybe_unused]] EcmaHandleScope handleScope(thread); in EqDyn()
376 JSHandle<JSTaggedValue> leftValue(thread, left); in EqDyn()
377 JSHandle<JSTaggedValue> rightValue(thread, right); in EqDyn()
378 bool ret = JSTaggedValue::Equal(thread, leftValue, rightValue); in EqDyn()
379 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in EqDyn()
383 JSTaggedValue SlowRuntimeStub::NotEqDyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in NotEqDyn() argument
385 INTERPRETER_TRACE(thread, NotEqDyn); in NotEqDyn()
386 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NotEqDyn()
388 JSHandle<JSTaggedValue> leftValue(thread, left); in NotEqDyn()
389 JSHandle<JSTaggedValue> rightValue(thread, right); in NotEqDyn()
390 bool ret = JSTaggedValue::Equal(thread, leftValue, rightValue); in NotEqDyn()
391 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in NotEqDyn()
395 JSTaggedValue SlowRuntimeStub::LessDyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in LessDyn() argument
397 INTERPRETER_TRACE(thread, LessDyn); in LessDyn()
398 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LessDyn()
400 JSHandle<JSTaggedValue> leftValue(thread, left); in LessDyn()
401 JSHandle<JSTaggedValue> rightValue(thread, right); in LessDyn()
402 bool ret = JSTaggedValue::Compare(thread, leftValue, rightValue) == ComparisonResult::LESS; in LessDyn()
403 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LessDyn()
407 JSTaggedValue SlowRuntimeStub::LessEqDyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in LessEqDyn() argument
409 INTERPRETER_TRACE(thread, LessEqDyn); in LessEqDyn()
410 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LessEqDyn()
412 JSHandle<JSTaggedValue> leftValue(thread, left); in LessEqDyn()
413 JSHandle<JSTaggedValue> rightValue(thread, right); in LessEqDyn()
414 bool ret = JSTaggedValue::Compare(thread, leftValue, rightValue) <= ComparisonResult::EQUAL; in LessEqDyn()
415 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LessEqDyn()
419 JSTaggedValue SlowRuntimeStub::GreaterDyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in GreaterDyn() argument
421 INTERPRETER_TRACE(thread, GreaterDyn); in GreaterDyn()
422 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GreaterDyn()
424 JSHandle<JSTaggedValue> leftValue(thread, left); in GreaterDyn()
425 JSHandle<JSTaggedValue> rightValue(thread, right); in GreaterDyn()
426 bool ret = JSTaggedValue::Compare(thread, leftValue, rightValue) == ComparisonResult::GREAT; in GreaterDyn()
427 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GreaterDyn()
431 JSTaggedValue SlowRuntimeStub::GreaterEqDyn(JSThread *thread, JSTaggedValue left, JSTaggedValue rig… in GreaterEqDyn() argument
433 INTERPRETER_TRACE(thread, GreaterEqDyn); in GreaterEqDyn()
434 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GreaterEqDyn()
436 JSHandle<JSTaggedValue> leftValue(thread, left); in GreaterEqDyn()
437 JSHandle<JSTaggedValue> rightValue(thread, right); in GreaterEqDyn()
438 ComparisonResult comparison = JSTaggedValue::Compare(thread, leftValue, rightValue); in GreaterEqDyn()
440 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GreaterEqDyn()
444 JSTaggedValue SlowRuntimeStub::Shl2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Shl2Dyn() argument
446 INTERPRETER_TRACE(thread, Shl2Dyn); in Shl2Dyn()
447 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Shl2Dyn()
448 JSHandle<JSTaggedValue> leftHandle(thread, left); in Shl2Dyn()
449 JSHandle<JSTaggedValue> rightHandle(thread, right); in Shl2Dyn()
450 JSHandle<JSTaggedValue> leftValue(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Shl2Dyn()
451 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shl2Dyn()
452 JSHandle<JSTaggedValue> rightValue(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Shl2Dyn()
453 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shl2Dyn()
457 return BigInt::LeftShift(thread, leftBigint, rightBigint).GetTaggedValue(); in Shl2Dyn()
460 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Shl2Dyn()
462 …JSTaggedValue taggedNumber0 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, leftValue.GetTagge… in Shl2Dyn()
463 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shl2Dyn()
464 …JSTaggedValue taggedNumber1 = SlowRuntimeStub::ToJSTaggedValueWithUint32(thread, rightValue.GetTag… in Shl2Dyn()
465 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shl2Dyn()
476 JSTaggedValue SlowRuntimeStub::Shr2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Shr2Dyn() argument
478 INTERPRETER_TRACE(thread, Shr2Dyn); in Shr2Dyn()
479 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Shr2Dyn()
481 JSHandle<JSTaggedValue> leftHandle(thread, left); in Shr2Dyn()
482 JSHandle<JSTaggedValue> rightHandle(thread, right); in Shr2Dyn()
483 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Shr2Dyn()
484 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shr2Dyn()
485 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Shr2Dyn()
486 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shr2Dyn()
490 return BigInt::SignedRightShift(thread, bigLeft, bigRight).GetTaggedValue(); in Shr2Dyn()
493 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Shr2Dyn()
495 …JSTaggedValue taggedNumber0 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, valLeft.GetTaggedV… in Shr2Dyn()
496 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shr2Dyn()
497 …JSTaggedValue taggedNumber1 = SlowRuntimeStub::ToJSTaggedValueWithUint32(thread, valRight.GetTagge… in Shr2Dyn()
498 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shr2Dyn()
507 JSTaggedValue SlowRuntimeStub::Ashr2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Ashr2Dyn() argument
509 INTERPRETER_TRACE(thread, Ashr2Dyn); in Ashr2Dyn()
510 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Ashr2Dyn()
512 JSHandle<JSTaggedValue> leftHandle(thread, left); in Ashr2Dyn()
513 JSHandle<JSTaggedValue> rightHandle(thread, right); in Ashr2Dyn()
514 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Ashr2Dyn()
515 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Ashr2Dyn()
516 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Ashr2Dyn()
517 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Ashr2Dyn()
519 return BigInt::UnsignedRightShift(thread); in Ashr2Dyn()
522 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Ashr2Dyn()
524 …JSTaggedValue taggedNumber0 = SlowRuntimeStub::ToJSTaggedValueWithUint32(thread, valLeft.GetTagged… in Ashr2Dyn()
525 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Ashr2Dyn()
526 …JSTaggedValue taggedNumber1 = SlowRuntimeStub::ToJSTaggedValueWithUint32(thread, valRight.GetTagge… in Ashr2Dyn()
527 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Ashr2Dyn()
538 JSTaggedValue SlowRuntimeStub::And2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in And2Dyn() argument
540 INTERPRETER_TRACE(thread, And2Dyn); in And2Dyn()
541 [[maybe_unused]] EcmaHandleScope handleScope(thread); in And2Dyn()
543 JSHandle<JSTaggedValue> leftHandle(thread, left); in And2Dyn()
544 JSHandle<JSTaggedValue> rightHandle(thread, right); in And2Dyn()
545 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in And2Dyn()
546 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in And2Dyn()
547 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in And2Dyn()
548 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in And2Dyn()
552 return BigInt::BitwiseAND(thread, leftBigint, rightBigint).GetTaggedValue(); in And2Dyn()
555 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in And2Dyn()
557 …JSTaggedValue taggedNumber0 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, valLeft.GetTaggedV… in And2Dyn()
558 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in And2Dyn()
559 …JSTaggedValue taggedNumber1 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, valRight.GetTagged… in And2Dyn()
560 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in And2Dyn()
568 JSTaggedValue SlowRuntimeStub::Or2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Or2Dyn() argument
570 INTERPRETER_TRACE(thread, Or2Dyn); in Or2Dyn()
571 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Or2Dyn()
573 JSHandle<JSTaggedValue> leftHandle(thread, left); in Or2Dyn()
574 JSHandle<JSTaggedValue> rightHandle(thread, right); in Or2Dyn()
575 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Or2Dyn()
576 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Or2Dyn()
577 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Or2Dyn()
578 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Or2Dyn()
582 return BigInt::BitwiseOR(thread, leftBigint, rightBigint).GetTaggedValue(); in Or2Dyn()
585 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Or2Dyn()
587 …JSTaggedValue taggedNumber0 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, valLeft.GetTaggedV… in Or2Dyn()
588 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Or2Dyn()
589 …JSTaggedValue taggedNumber1 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, valRight.GetTagged… in Or2Dyn()
590 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Or2Dyn()
598 JSTaggedValue SlowRuntimeStub::Xor2Dyn(JSThread *thread, JSTaggedValue left, JSTaggedValue right) in Xor2Dyn() argument
600 INTERPRETER_TRACE(thread, Xor2Dyn); in Xor2Dyn()
601 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Xor2Dyn()
603 JSHandle<JSTaggedValue> leftHandle(thread, left); in Xor2Dyn()
604 JSHandle<JSTaggedValue> rightHandle(thread, right); in Xor2Dyn()
605 JSHandle<JSTaggedValue> valLeft(thread, JSTaggedValue::ToNumeric(thread, leftHandle)); in Xor2Dyn()
606 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Xor2Dyn()
607 JSHandle<JSTaggedValue> valRight(thread, JSTaggedValue::ToNumeric(thread, rightHandle)); in Xor2Dyn()
608 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Xor2Dyn()
612 return BigInt::BitwiseXOR(thread, leftBigint, rightBigint).GetTaggedValue(); in Xor2Dyn()
615 … return ThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"); in Xor2Dyn()
617 …JSTaggedValue taggedNumber0 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, valLeft.GetTaggedV… in Xor2Dyn()
618 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Xor2Dyn()
619 …JSTaggedValue taggedNumber1 = SlowRuntimeStub::ToJSTaggedValueWithInt32(thread, valRight.GetTagged… in Xor2Dyn()
620 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Xor2Dyn()
628 JSTaggedValue SlowRuntimeStub::ToJSTaggedValueWithInt32(JSThread *thread, JSTaggedValue value) in ToJSTaggedValueWithInt32() argument
630 INTERPRETER_TRACE(thread, ToJSTaggedValueWithInt32); in ToJSTaggedValueWithInt32()
631 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ToJSTaggedValueWithInt32()
632 JSHandle<JSTaggedValue> valueHandle(thread, value); in ToJSTaggedValueWithInt32()
633 int32_t res = JSTaggedValue::ToInt32(thread, valueHandle); in ToJSTaggedValueWithInt32()
634 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToJSTaggedValueWithInt32()
638 JSTaggedValue SlowRuntimeStub::ToJSTaggedValueWithUint32(JSThread *thread, JSTaggedValue value) in ToJSTaggedValueWithUint32() argument
640 INTERPRETER_TRACE(thread, ToJSTaggedValueWithUint32); in ToJSTaggedValueWithUint32()
641 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ToJSTaggedValueWithUint32()
642 JSHandle<JSTaggedValue> valueHandle(thread, value); in ToJSTaggedValueWithUint32()
643 int32_t res = JSTaggedValue::ToUint32(thread, valueHandle); in ToJSTaggedValueWithUint32()
644 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToJSTaggedValueWithUint32()
648 JSTaggedValue SlowRuntimeStub::DelObjProp(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop) in DelObjProp() argument
650 INTERPRETER_TRACE(thread, Delobjprop); in DelObjProp()
651 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DelObjProp()
653 JSHandle<JSTaggedValue> objHandle(thread, obj); in DelObjProp()
654 JSHandle<JSTaggedValue> propHandle(thread, prop); in DelObjProp()
655 JSHandle<JSTaggedValue> jsObj(JSTaggedValue::ToObject(thread, objHandle)); in DelObjProp()
656 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in DelObjProp()
657 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, propHandle); in DelObjProp()
658 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in DelObjProp()
659 bool ret = JSTaggedValue::DeletePropertyOrThrow(thread, jsObj, propKey); in DelObjProp()
660 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in DelObjProp()
664 JSTaggedValue SlowRuntimeStub::NewObjDynRange(JSThread *thread, JSTaggedValue func, JSTaggedValue n… in NewObjDynRange() argument
667 INTERPRETER_TRACE(thread, NewobjDynrange); in NewObjDynRange()
668 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NewObjDynRange()
670 JSHandle<JSTaggedValue> funcHandle(thread, func); in NewObjDynRange()
671 JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); in NewObjDynRange()
673 JSHandle<JSTaggedValue> preArgs(thread, JSTaggedValue::Undefined()); in NewObjDynRange()
674 …auto tagged = SlowRuntimeHelper::Construct(thread, funcHandle, newTargetHandle, preArgs, length, f… in NewObjDynRange()
675 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in NewObjDynRange()
679 JSTaggedValue SlowRuntimeStub::CreateObjectWithExcludedKeys(JSThread *thread, uint16_t numKeys, JST… in CreateObjectWithExcludedKeys() argument
682 INTERPRETER_TRACE(thread, CreateObjectWithExcludedKeys); in CreateObjectWithExcludedKeys()
683 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateObjectWithExcludedKeys()
685 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateObjectWithExcludedKeys()
688 JSHandle<JSObject> obj(thread, objVal); in CreateObjectWithExcludedKeys()
691 InterpretedFrameHandler frameHandler(thread); in CreateObjectWithExcludedKeys()
695 excludedKeys->Set(thread, 0, excludedKey); in CreateObjectWithExcludedKeys()
698 excludedKeys->Set(thread, i, excludedKey); in CreateObjectWithExcludedKeys()
704 JSObject::GetAllKeys(thread, obj, 0, allKeys); in CreateObjectWithExcludedKeys()
707 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in CreateObjectWithExcludedKeys()
712 … if (JSTaggedValue::Equal(thread, key, JSHandle<JSTaggedValue>(thread, excludedKeys->Get(j)))) { in CreateObjectWithExcludedKeys()
718 PropertyDescriptor desc(thread); in CreateObjectWithExcludedKeys()
719 bool success = JSObject::GetOwnProperty(thread, obj, key, desc); in CreateObjectWithExcludedKeys()
720 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateObjectWithExcludedKeys()
722 JSHandle<JSTaggedValue> value = JSObject::GetProperty(thread, obj, key).GetValue(); in CreateObjectWithExcludedKeys()
723 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateObjectWithExcludedKeys()
724 JSObject::SetProperty(thread, restObj, key, value, true); in CreateObjectWithExcludedKeys()
725 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateObjectWithExcludedKeys()
732 JSTaggedValue SlowRuntimeStub::ExpDyn(JSThread *thread, JSTaggedValue base, JSTaggedValue exponent) in ExpDyn() argument
734 INTERPRETER_TRACE(thread, ExpDyn); in ExpDyn()
735 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ExpDyn()
737 …JSTaggedNumber baseNumber = JSTaggedValue::ToNumber(thread, JSHandle<JSTaggedValue>(thread, base)); in ExpDyn()
738 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ExpDyn()
740 …JSTaggedNumber exponentNumber = JSTaggedValue::ToNumber(thread, JSHandle<JSTaggedValue>(thread, ex… in ExpDyn()
741 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ExpDyn()
760 JSTaggedValue SlowRuntimeStub::IsInDyn(JSThread *thread, JSTaggedValue prop, JSTaggedValue obj) in IsInDyn() argument
762 INTERPRETER_TRACE(thread, IsInDyn); in IsInDyn()
763 [[maybe_unused]] EcmaHandleScope handleScope(thread); in IsInDyn()
765 JSHandle<JSTaggedValue> propHandle(thread, prop); in IsInDyn()
766 JSHandle<JSTaggedValue> objHandle(thread, obj); in IsInDyn()
768 return ThrowTypeError(thread, "Cannot use 'in' operator in Non-Object"); in IsInDyn()
770 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, propHandle); in IsInDyn()
771 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IsInDyn()
772 bool ret = JSTaggedValue::HasProperty(thread, objHandle, propKey); in IsInDyn()
773 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IsInDyn()
777 JSTaggedValue SlowRuntimeStub::InstanceofDyn(JSThread *thread, JSTaggedValue obj, JSTaggedValue tar… in InstanceofDyn() argument
779 INTERPRETER_TRACE(thread, InstanceofDyn); in InstanceofDyn()
780 [[maybe_unused]] EcmaHandleScope handleScope(thread); in InstanceofDyn()
782 JSHandle<JSTaggedValue> objHandle(thread, obj); in InstanceofDyn()
783 JSHandle<JSTaggedValue> targetHandle(thread, target); in InstanceofDyn()
784 bool ret = JSObject::InstanceOf(thread, objHandle, targetHandle); in InstanceofDyn()
785 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in InstanceofDyn()
789 JSTaggedValue SlowRuntimeStub::NewLexicalEnvDyn(JSThread *thread, uint16_t numVars) in NewLexicalEnvDyn() argument
791 INTERPRETER_TRACE(thread, NewlexenvDyn); in NewLexicalEnvDyn()
792 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NewLexicalEnvDyn()
794 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewLexicalEnvDyn()
797 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in NewLexicalEnvDyn()
798 newEnv->SetParentEnv(thread, currentLexenv); in NewLexicalEnvDyn()
799 newEnv->SetScopeInfo(thread, JSTaggedValue::Hole()); in NewLexicalEnvDyn()
800 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in NewLexicalEnvDyn()
804 JSTaggedValue SlowRuntimeStub::NewLexicalEnvWithNameDyn(JSThread *thread, uint16_t numVars, uint16_… in NewLexicalEnvWithNameDyn() argument
806 INTERPRETER_TRACE(thread, NewlexenvwithNameDyn); in NewLexicalEnvWithNameDyn()
807 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NewLexicalEnvWithNameDyn()
809 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewLexicalEnvWithNameDyn()
812 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in NewLexicalEnvWithNameDyn()
813 newEnv->SetParentEnv(thread, currentLexenv); in NewLexicalEnvWithNameDyn()
814 JSTaggedValue scopeInfo = ScopeInfoExtractor::GenerateScopeInfo(thread, scopeId); in NewLexicalEnvWithNameDyn()
815 newEnv->SetScopeInfo(thread, scopeInfo); in NewLexicalEnvWithNameDyn()
816 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in NewLexicalEnvWithNameDyn()
820 JSTaggedValue SlowRuntimeStub::CreateIterResultObj(JSThread *thread, JSTaggedValue value, JSTaggedV… in CreateIterResultObj() argument
822 INTERPRETER_TRACE(thread, CreateIterResultObj); in CreateIterResultObj()
823 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateIterResultObj()
825 JSHandle<JSTaggedValue> valueHandle(thread, value); in CreateIterResultObj()
828 JSHandle<JSObject> iter = JSIterator::CreateIterResultObject(thread, valueHandle, done); in CreateIterResultObj()
829 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateIterResultObj()
833 JSTaggedValue SlowRuntimeStub::CreateGeneratorObj(JSThread *thread, JSTaggedValue genFunc) in CreateGeneratorObj() argument
835 INTERPRETER_TRACE(thread, CreateGeneratorObj); in CreateGeneratorObj()
836 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateGeneratorObj()
838 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateGeneratorObj()
839 JSHandle<JSTaggedValue> generatorFunction(thread, genFunc); in CreateGeneratorObj()
842 context->SetGeneratorObject(thread, obj.GetTaggedValue()); in CreateGeneratorObj()
846 obj->SetGeneratorContext(thread, context); in CreateGeneratorObj()
848 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateGeneratorObj()
852 JSTaggedValue SlowRuntimeStub::SuspendGenerator(JSThread *thread, JSTaggedValue genObj, JSTaggedVal… in SuspendGenerator() argument
854 INTERPRETER_TRACE(thread, SuspendGenerator); in SuspendGenerator()
855 [[maybe_unused]] EcmaHandleScope handleScope(thread); in SuspendGenerator()
857 JSHandle<JSGeneratorObject> generatorObjectHandle(thread, genObj); in SuspendGenerator()
858 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in SuspendGenerator()
859 JSHandle<JSTaggedValue> valueHandle(thread, value); in SuspendGenerator()
861 SlowRuntimeHelper::SaveFrameToContext(thread, genContextHandle); in SuspendGenerator()
866 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in SuspendGenerator()
869 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in SuspendGenerator()
873 JSTaggedValue SlowRuntimeStub::AsyncFunctionAwaitUncaught(JSThread *thread, JSTaggedValue asyncFunc… in AsyncFunctionAwaitUncaught() argument
876 INTERPRETER_TRACE(thread, AsyncFunctionAwaitUncaught); in AsyncFunctionAwaitUncaught()
877 [[maybe_unused]] EcmaHandleScope handleScope(thread); in AsyncFunctionAwaitUncaught()
879 JSHandle<JSAsyncFuncObject> asyncFuncObjHandle(thread, asyncFuncObj); in AsyncFunctionAwaitUncaught()
880 JSHandle<JSTaggedValue> valueHandle(thread, value); in AsyncFunctionAwaitUncaught()
881 JSAsyncFunction::AsyncFunctionAwait(thread, asyncFuncObjHandle, valueHandle); in AsyncFunctionAwaitUncaught()
882 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in AsyncFunctionAwaitUncaught()
884 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in AsyncFunctionAwaitUncaught()
888 JSTaggedValue SlowRuntimeStub::AsyncFunctionResolveOrReject(JSThread *thread, JSTaggedValue asyncFu… in AsyncFunctionResolveOrReject() argument
891 INTERPRETER_TRACE(thread, AsyncFunctionResolveOrReject); in AsyncFunctionResolveOrReject()
892 [[maybe_unused]] EcmaHandleScope handleScope(thread); in AsyncFunctionResolveOrReject()
894 JSHandle<JSAsyncFuncObject> asyncFuncObjHandle(thread, asyncFuncObj); in AsyncFunctionResolveOrReject()
895 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in AsyncFunctionResolveOrReject()
896 JSHandle<JSTaggedValue> valueHandle(thread, value); in AsyncFunctionResolveOrReject()
899 …JSHandle<ResolvingFunctionsRecord> reactions = JSPromise::CreateResolvingFunctions(thread, promise… in AsyncFunctionResolveOrReject()
900 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in AsyncFunctionResolveOrReject()
904 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetResolveFunction()); in AsyncFunctionResolveOrReject()
906 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetRejectFunction()); in AsyncFunctionResolveOrReject()
908 InternalCallParams *arguments = thread->GetInternalCallParams(); in AsyncFunctionResolveOrReject()
910 …[[maybe_unused]] JSTaggedValue res = JSFunction::Call(thread, activeFunc, thisArg, 1, arguments->G… in AsyncFunctionResolveOrReject()
912 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in AsyncFunctionResolveOrReject()
916 JSTaggedValue SlowRuntimeStub::NewObjSpreadDyn(JSThread *thread, JSTaggedValue func, JSTaggedValue … in NewObjSpreadDyn() argument
919 INTERPRETER_TRACE(thread, NewobjspreadDyn); in NewObjSpreadDyn()
920 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NewObjSpreadDyn()
922 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewObjSpreadDyn()
923 JSHandle<JSTaggedValue> funcHandle(thread, func); in NewObjSpreadDyn()
924 JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); in NewObjSpreadDyn()
925 JSHandle<JSTaggedValue> jsArray(thread, array); in NewObjSpreadDyn()
927 return ThrowTypeError(thread, "Cannot Newobjspread"); in NewObjSpreadDyn()
933 auto prop = JSTaggedValue::GetProperty(thread, jsArray, i).GetValue(); in NewObjSpreadDyn()
934 argsArray->Set(thread, i, prop); in NewObjSpreadDyn()
935 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in NewObjSpreadDyn()
937 InternalCallParams *arguments = thread->GetInternalCallParams(); in NewObjSpreadDyn()
939 …auto tagged = SlowRuntimeHelper::NewObject(thread, funcHandle, newTargetHandle, length, arguments-… in NewObjSpreadDyn()
943 void SlowRuntimeStub::ThrowUndefinedIfHole(JSThread *thread, JSTaggedValue obj) in ThrowUndefinedIfHole() argument
945 INTERPRETER_TRACE(thread, ThrowUndefinedIfHole); in ThrowUndefinedIfHole()
946 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowUndefinedIfHole()
948 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in ThrowUndefinedIfHole()
949 JSHandle<EcmaString> name(thread, obj); in ThrowUndefinedIfHole()
953 …THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::REFERENCE_ERROR, msg).GetT… in ThrowUndefinedIfHole()
956 JSTaggedValue SlowRuntimeStub::ThrowIfSuperNotCorrectCall(JSThread *thread, uint16_t index, JSTagge… in ThrowIfSuperNotCorrectCall() argument
958 INTERPRETER_TRACE(thread, ThrowIfSuperNotCorrectCall); in ThrowIfSuperNotCorrectCall()
959 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowIfSuperNotCorrectCall()
962 …return ThrowReferenceError(thread, JSTaggedValue::Undefined(), "sub-class must call super before u… in ThrowIfSuperNotCorrectCall()
965 …return ThrowReferenceError(thread, JSTaggedValue::Undefined(), "super() forbidden re-bind 'this'"); in ThrowIfSuperNotCorrectCall()
970 void SlowRuntimeStub::ThrowIfNotObject(JSThread *thread) in ThrowIfNotObject() argument
972 INTERPRETER_TRACE(thread, ThrowIfNotObject); in ThrowIfNotObject()
973 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowIfNotObject()
975 THROW_TYPE_ERROR(thread, "Inner return result is not object"); in ThrowIfNotObject()
978 void SlowRuntimeStub::ThrowThrowNotExists(JSThread *thread) in ThrowThrowNotExists() argument
980 INTERPRETER_TRACE(thread, ThrowThrowNotExists); in ThrowThrowNotExists()
981 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowThrowNotExists()
983 THROW_TYPE_ERROR(thread, "Throw method is not defined"); in ThrowThrowNotExists()
986 void SlowRuntimeStub::ThrowPatternNonCoercible(JSThread *thread) in ThrowPatternNonCoercible() argument
988 INTERPRETER_TRACE(thread, ThrowPatternNonCoercible); in ThrowPatternNonCoercible()
989 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowPatternNonCoercible()
991 JSHandle<EcmaString> msg(thread->GlobalConstants()->GetHandledObjNotCoercibleString()); in ThrowPatternNonCoercible()
992 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in ThrowPatternNonCoercible()
993 …THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::TYPE_ERROR, msg).GetTagged… in ThrowPatternNonCoercible()
996 JSTaggedValue SlowRuntimeStub::StOwnByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop,… in StOwnByName() argument
998 INTERPRETER_TRACE(thread, StOwnByNameDyn); in StOwnByName()
999 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StOwnByName()
1001 JSHandle<JSTaggedValue> objHandle(thread, obj); in StOwnByName()
1002 JSHandle<JSTaggedValue> propHandle(thread, prop); in StOwnByName()
1003 JSHandle<JSTaggedValue> valueHandle(thread, value); in StOwnByName()
1009 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in StOwnByName()
1010 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propHandle, desc); in StOwnByName()
1012 return ThrowTypeError(thread, "SetOwnByName failed"); in StOwnByName()
1017 JSTaggedValue SlowRuntimeStub::StOwnByNameWithNameSet(JSThread *thread, JSTaggedValue obj, JSTagged… in StOwnByNameWithNameSet() argument
1020 INTERPRETER_TRACE(thread, StOwnByNameDyn); in StOwnByNameWithNameSet()
1021 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StOwnByNameWithNameSet()
1023 JSHandle<JSTaggedValue> objHandle(thread, obj); in StOwnByNameWithNameSet()
1024 JSHandle<JSTaggedValue> propHandle(thread, prop); in StOwnByNameWithNameSet()
1025 JSHandle<JSTaggedValue> valueHandle(thread, value); in StOwnByNameWithNameSet()
1028 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, propHandle); in StOwnByNameWithNameSet()
1033 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in StOwnByNameWithNameSet()
1034 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propHandle, desc); in StOwnByNameWithNameSet()
1036 return ThrowTypeError(thread, "SetOwnByNameWithNameSet failed"); in StOwnByNameWithNameSet()
1038 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(valueHandle), propKey, in StOwnByNameWithNameSet()
1039 JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in StOwnByNameWithNameSet()
1043 JSTaggedValue SlowRuntimeStub::StOwnByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, JSTa… in StOwnByIndex() argument
1045 INTERPRETER_TRACE(thread, StOwnByIdDyn); in StOwnByIndex()
1046 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StOwnByIndex()
1048 JSHandle<JSTaggedValue> objHandle(thread, obj); in StOwnByIndex()
1049 JSHandle<JSTaggedValue> idxHandle(thread, JSTaggedValue(idx)); in StOwnByIndex()
1050 JSHandle<JSTaggedValue> valueHandle(thread, value); in StOwnByIndex()
1055 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in StOwnByIndex()
1056 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, idxHandle, desc); in StOwnByIndex()
1058 return ThrowTypeError(thread, "SetOwnByIndex failed"); in StOwnByIndex()
1063 JSTaggedValue SlowRuntimeStub::StOwnByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue key,… in StOwnByValue() argument
1065 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StOwnByValue()
1067 INTERPRETER_TRACE(thread, StOwnByValueDyn); in StOwnByValue()
1068 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in StOwnByValue()
1069 JSHandle<JSTaggedValue> objHandle(thread, obj); in StOwnByValue()
1070 JSHandle<JSTaggedValue> keyHandle(thread, key); in StOwnByValue()
1071 JSHandle<JSTaggedValue> valueHandle(thread, value); in StOwnByValue()
1075 … return ThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeError"); in StOwnByValue()
1081 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in StOwnByValue()
1082 JSMutableHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, keyHandle)); in StOwnByValue()
1083 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propKey, desc); in StOwnByValue()
1085 return ThrowTypeError(thread, "StOwnByValue failed"); in StOwnByValue()
1090 JSTaggedValue SlowRuntimeStub::StOwnByValueWithNameSet(JSThread *thread, JSTaggedValue obj, JSTagge… in StOwnByValueWithNameSet() argument
1093 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StOwnByValueWithNameSet()
1094 INTERPRETER_TRACE(thread, StOwnByValueDyn); in StOwnByValueWithNameSet()
1095 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in StOwnByValueWithNameSet()
1096 JSHandle<JSTaggedValue> objHandle(thread, obj); in StOwnByValueWithNameSet()
1097 JSHandle<JSTaggedValue> keyHandle(thread, key); in StOwnByValueWithNameSet()
1098 JSHandle<JSTaggedValue> valueHandle(thread, value); in StOwnByValueWithNameSet()
1102 … return ThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeError"); in StOwnByValueWithNameSet()
1108 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in StOwnByValueWithNameSet()
1109 JSMutableHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, keyHandle)); in StOwnByValueWithNameSet()
1110 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propKey, desc); in StOwnByValueWithNameSet()
1112 return ThrowTypeError(thread, "StOwnByValueWithNameSet failed"); in StOwnByValueWithNameSet()
1116 …propKey.Update(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue()).GetTaggedValue… in StOwnByValueWithNameSet()
1118 … JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(valueHandle), propKey, in StOwnByValueWithNameSet()
1119 … JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in StOwnByValueWithNameSet()
1124 JSTaggedValue SlowRuntimeStub::CreateEmptyArray(JSThread *thread, ObjectFactory *factory, JSHandle<… in CreateEmptyArray() argument
1126 INTERPRETER_TRACE(thread, CreateEmptyArray); in CreateEmptyArray()
1127 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateEmptyArray()
1134 JSTaggedValue SlowRuntimeStub::CreateEmptyObject(JSThread *thread, ObjectFactory *factory, in CreateEmptyObject() argument
1137 INTERPRETER_TRACE(thread, CreateEmptyObject); in CreateEmptyObject()
1138 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateEmptyObject()
1145 JSTaggedValue SlowRuntimeStub::CreateObjectWithBuffer(JSThread *thread, ObjectFactory *factory, JSO… in CreateObjectWithBuffer() argument
1147 INTERPRETER_TRACE(thread, CreateObjectWithBuffer); in CreateObjectWithBuffer()
1148 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateObjectWithBuffer()
1150 JSHandle<JSObject> obj(thread, literal); in CreateObjectWithBuffer()
1152 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateObjectWithBuffer()
1157 JSTaggedValue SlowRuntimeStub::CreateObjectHavingMethod(JSThread *thread, ObjectFactory *factory, J… in CreateObjectHavingMethod() argument
1160 INTERPRETER_TRACE(thread, CreateObjectHavingMethod); in CreateObjectHavingMethod()
1161 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateObjectHavingMethod()
1163 JSHandle<JSObject> obj(thread, literal); in CreateObjectHavingMethod()
1165 …obj, JSHandle<JSTaggedValue>(thread, env), JSHandle<JSTaggedValue>(thread, JSTaggedValue(constpool… in CreateObjectHavingMethod()
1166 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateObjectHavingMethod()
1171 JSTaggedValue SlowRuntimeStub::SetObjectWithProto(JSThread *thread, JSTaggedValue proto, JSTaggedVa… in SetObjectWithProto() argument
1173 INTERPRETER_TRACE(thread, SetObjectWithProto); in SetObjectWithProto()
1174 [[maybe_unused]] EcmaHandleScope handleScope(thread); in SetObjectWithProto()
1179 JSHandle<JSTaggedValue> protoHandle(thread, proto); in SetObjectWithProto()
1180 JSHandle<JSObject> objHandle(thread, obj); in SetObjectWithProto()
1181 JSObject::SetPrototype(thread, objHandle, protoHandle); in SetObjectWithProto()
1182 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in SetObjectWithProto()
1186 JSTaggedValue SlowRuntimeStub::IterNext(JSThread *thread, JSTaggedValue iter) in IterNext() argument
1188 INTERPRETER_TRACE(thread, IterNext); in IterNext()
1189 [[maybe_unused]] EcmaHandleScope handleScope(thread); in IterNext()
1191 JSHandle<JSTaggedValue> iterHandle(thread, iter); in IterNext()
1192 JSHandle<JSObject> resultObj = JSIterator::IteratorNext(thread, iterHandle); in IterNext()
1193 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IterNext()
1197 JSTaggedValue SlowRuntimeStub::CloseIterator(JSThread *thread, JSTaggedValue iter) in CloseIterator() argument
1199 INTERPRETER_TRACE(thread, CloseIterator); in CloseIterator()
1200 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CloseIterator()
1202 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CloseIterator()
1203 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in CloseIterator()
1205 JSHandle<JSTaggedValue> iterHandle(thread, iter); in CloseIterator()
1207 if (thread->HasPendingException()) { in CloseIterator()
1209 CompletionRecordType::THROW, JSHandle<JSTaggedValue>(thread, thread->GetException()))); in CloseIterator()
1214 JSHandle<JSTaggedValue> result = JSIterator::IteratorClose(thread, iterHandle, record); in CloseIterator()
1221 JSTaggedValue SlowRuntimeStub::ImportModule([[maybe_unused]] JSThread *thread, in ImportModule() argument
1224 INTERPRETER_TRACE(thread, ImportModule); in ImportModule()
1225 [[maybe_unused]] EcmaHandleScope scope(thread); in ImportModule()
1226 JSHandle<JSTaggedValue> name(thread, moduleName); in ImportModule()
1227 JSHandle<JSTaggedValue> module = thread->GetEcmaVM()->GetModuleByName(name); in ImportModule()
1231 void SlowRuntimeStub::StModuleVar([[maybe_unused]] JSThread *thread, [[maybe_unused]] JSTaggedValue… in StModuleVar() argument
1234 INTERPRETER_TRACE(thread, StModuleVar); in StModuleVar()
1235 [[maybe_unused]] EcmaHandleScope scope(thread); in StModuleVar()
1236 JSHandle<JSTaggedValue> name(thread, exportName); in StModuleVar()
1237 JSHandle<JSTaggedValue> value(thread, exportObj); in StModuleVar()
1238 thread->GetEcmaVM()->GetModuleManager()->AddModuleItem(thread, name, value); in StModuleVar()
1241 void SlowRuntimeStub::CopyModule(JSThread *thread, JSTaggedValue srcModule) in CopyModule() argument
1243 INTERPRETER_TRACE(thread, CopyModule); in CopyModule()
1244 [[maybe_unused]] EcmaHandleScope scope(thread); in CopyModule()
1245 JSHandle<JSTaggedValue> srcModuleObj(thread, srcModule); in CopyModule()
1246 thread->GetEcmaVM()->GetModuleManager()->CopyModule(thread, srcModuleObj); in CopyModule()
1249 JSTaggedValue SlowRuntimeStub::LdModvarByName([[maybe_unused]] JSThread *thread, in LdModvarByName() argument
1253 INTERPRETER_TRACE(thread, LdModvarByName); in LdModvarByName()
1254 [[maybe_unused]] EcmaHandleScope scope(thread); in LdModvarByName()
1255 JSHandle<JSTaggedValue> module(thread, moduleObj); in LdModvarByName()
1256 JSHandle<JSTaggedValue> item(thread, itemName); in LdModvarByName()
1257 …JSHandle<JSTaggedValue> moduleVar = thread->GetEcmaVM()->GetModuleManager()->GetModuleItem(thread,… in LdModvarByName()
1261 JSTaggedValue SlowRuntimeStub::CreateRegExpWithLiteral(JSThread *thread, JSTaggedValue pattern, uin… in CreateRegExpWithLiteral() argument
1263 INTERPRETER_TRACE(thread, CreateRegExpWithLiteral); in CreateRegExpWithLiteral()
1264 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateRegExpWithLiteral()
1266 JSHandle<JSTaggedValue> patternHandle(thread, pattern); in CreateRegExpWithLiteral()
1267 JSHandle<JSTaggedValue> flagsHandle(thread, JSTaggedValue(flags)); in CreateRegExpWithLiteral()
1269 return builtins::BuiltinsRegExp::RegExpCreate(thread, patternHandle, flagsHandle); in CreateRegExpWithLiteral()
1272 JSTaggedValue SlowRuntimeStub::CreateArrayWithBuffer(JSThread *thread, ObjectFactory *factory, JSAr… in CreateArrayWithBuffer() argument
1274 INTERPRETER_TRACE(thread, CreateArrayWithBuffer); in CreateArrayWithBuffer()
1275 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CreateArrayWithBuffer()
1277 JSHandle<JSArray> array(thread, literal); in CreateArrayWithBuffer()
1279 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CreateArrayWithBuffer()
1284 JSTaggedValue SlowRuntimeStub::GetTemplateObject(JSThread *thread, JSTaggedValue literal) in GetTemplateObject() argument
1286 INTERPRETER_TRACE(thread, GetTemplateObject); in GetTemplateObject()
1287 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GetTemplateObject()
1289 JSHandle<JSTaggedValue> templateLiteral(thread, literal); in GetTemplateObject()
1290 … JSHandle<JSTaggedValue> templateObj = TemplateString::GetTemplateObject(thread, templateLiteral); in GetTemplateObject()
1291 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetTemplateObject()
1295 JSTaggedValue SlowRuntimeStub::GetNextPropName(JSThread *thread, JSTaggedValue iter) in GetNextPropName() argument
1297 INTERPRETER_TRACE(thread, GetNextPropName); in GetNextPropName()
1298 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GetNextPropName()
1300 JSHandle<JSTaggedValue> iterator(thread, iter); in GetNextPropName()
1303 JSForInIterator::NextInternal(thread, JSHandle<JSForInIterator>::Cast(iterator)); in GetNextPropName()
1304 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetNextPropName()
1308 JSTaggedValue SlowRuntimeStub::CopyDataProperties(JSThread *thread, JSTaggedValue dst, JSTaggedValu… in CopyDataProperties() argument
1310 INTERPRETER_TRACE(thread, CopyDataProperties); in CopyDataProperties()
1311 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CopyDataProperties()
1313 JSHandle<JSTaggedValue> dstHandle(thread, dst); in CopyDataProperties()
1314 JSHandle<JSTaggedValue> srcHandle(thread, src); in CopyDataProperties()
1316 JSHandle<TaggedArray> keys = JSTaggedValue::GetOwnPropertyKeys(thread, srcHandle); in CopyDataProperties()
1317 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyDataProperties()
1319 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in CopyDataProperties()
1322 PropertyDescriptor desc(thread); in CopyDataProperties()
1324 bool success = JSTaggedValue::GetOwnProperty(thread, srcHandle, key, desc); in CopyDataProperties()
1325 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyDataProperties()
1328 JSTaggedValue::DefineOwnProperty(thread, dstHandle, key, desc); in CopyDataProperties()
1329 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyDataProperties()
1336 JSTaggedValue SlowRuntimeStub::GetIteratorNext(JSThread *thread, JSTaggedValue obj, JSTaggedValue m… in GetIteratorNext() argument
1338 INTERPRETER_TRACE(thread, GetIteratorNext); in GetIteratorNext()
1339 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GetIteratorNext()
1341 JSHandle<JSTaggedValue> iter(thread, obj); in GetIteratorNext()
1342 JSHandle<JSTaggedValue> next(thread, method); in GetIteratorNext()
1345 JSTaggedValue ret = JSFunction::Call(thread, next, iter, 0, nullptr); in GetIteratorNext()
1346 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetIteratorNext()
1348 return ThrowTypeError(thread, "the Iterator is not an ecmaobject."); in GetIteratorNext()
1353 JSTaggedValue SlowRuntimeStub::GetUnmapedArgs(JSThread *thread, JSTaggedType *sp, uint32_t actualNu… in GetUnmapedArgs() argument
1356 INTERPRETER_TRACE(thread, GetUnmapedArgs); in GetUnmapedArgs()
1357 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GetUnmapedArgs()
1359 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in GetUnmapedArgs()
1360 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in GetUnmapedArgs()
1363 argumentsList->Set(thread, i, in GetUnmapedArgs()
1373 …obj->SetPropertyInlinedProps(thread, JSArguments::LENGTH_INLINE_PROPERTY_INDEX, JSTaggedValue(len)… in GetUnmapedArgs()
1379 obj->SetElements(thread, argumentsList.GetTaggedValue()); in GetUnmapedArgs()
1383 obj->SetPropertyInlinedProps(thread, JSArguments::ITERATOR_INLINE_PROPERTY_INDEX, in GetUnmapedArgs()
1389 accessor->SetGetter(thread, throwFunction); in GetUnmapedArgs()
1390 accessor->SetSetter(thread, throwFunction); in GetUnmapedArgs()
1391 …obj->SetPropertyInlinedProps(thread, JSArguments::CALLER_INLINE_PROPERTY_INDEX, accessor.GetTagged… in GetUnmapedArgs()
1395 accessor->SetGetter(thread, throwFunction); in GetUnmapedArgs()
1396 accessor->SetSetter(thread, throwFunction); in GetUnmapedArgs()
1397 …obj->SetPropertyInlinedProps(thread, JSArguments::CALLEE_INLINE_PROPERTY_INDEX, accessor.GetTagged… in GetUnmapedArgs()
1398 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetUnmapedArgs()
1403 JSTaggedValue SlowRuntimeStub::CopyRestArgs(JSThread *thread, JSTaggedType *sp, uint32_t restNumArg… in CopyRestArgs() argument
1405 INTERPRETER_TRACE(thread, Copyrestargs); in CopyRestArgs()
1406 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CopyRestArgs()
1408 JSHandle<JSTaggedValue> restArray = JSArray::ArrayCreate(thread, JSTaggedNumber(restNumArgs)); in CopyRestArgs()
1410 JSMutableHandle<JSTaggedValue> element(thread, JSTaggedValue::Undefined()); in CopyRestArgs()
1414 JSObject::SetProperty(thread, restArray, i, element, true); in CopyRestArgs()
1416 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyRestArgs()
1420 JSTaggedValue SlowRuntimeStub::GetIterator(JSThread *thread, JSTaggedValue obj) in GetIterator() argument
1422 INTERPRETER_TRACE(thread, GetIterator); in GetIterator()
1423 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GetIterator()
1424 EcmaVM *vm = thread->GetEcmaVM(); in GetIterator()
1426 JSHandle<JSTaggedValue> objHandle(thread, obj); in GetIterator()
1428 JSTaggedValue::GetProperty(thread, objHandle, env->GetIteratorSymbol()).GetValue(); in GetIterator()
1429 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetIterator()
1433 JSHandle<JSTaggedValue> newTarget(thread, JSTaggedValue::Undefined()); in GetIterator()
1434 InternalCallParams *params = thread->GetInternalCallParams(); in GetIterator()
1436 …JSTaggedValue res = InvokeJsFunction(thread, JSHandle<JSFunction>(valuesFunc), objHandle, newTarge… in GetIterator()
1441 JSTaggedValue SlowRuntimeStub::DefineGetterSetterByValue(JSThread *thread, JSTaggedValue obj, JSTag… in DefineGetterSetterByValue() argument
1444 INTERPRETER_TRACE(thread, DefineGetterSetterByValue); in DefineGetterSetterByValue()
1445 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DefineGetterSetterByValue()
1446 JSHandle<JSObject> objHandle(thread, obj); in DefineGetterSetterByValue()
1447 JSHandle<JSTaggedValue> propHandle(thread, prop); in DefineGetterSetterByValue()
1449 JSHandle<JSTaggedValue> getterHandle(thread, getter); in DefineGetterSetterByValue()
1450 JSHandle<JSTaggedValue> setterHandle(thread, setter); in DefineGetterSetterByValue()
1451 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, propHandle); in DefineGetterSetterByValue()
1453 auto globalConst = thread->GlobalConstants(); in DefineGetterSetterByValue()
1457 thread, in DefineGetterSetterByValue()
1465 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in DefineGetterSetterByValue()
1467 … JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(getterHandle), propKey, in DefineGetterSetterByValue()
1468 … JSHandle<JSTaggedValue>(thread, globalConst->GetGetString())); in DefineGetterSetterByValue()
1474 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in DefineGetterSetterByValue()
1476 … JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(setterHandle), propKey, in DefineGetterSetterByValue()
1477 … JSHandle<JSTaggedValue>(thread, globalConst->GetSetString())); in DefineGetterSetterByValue()
1484 PropertyDescriptor desc(thread, true, enumerable, true); in DefineGetterSetterByValue()
1493 JSObject::DefineOwnProperty(thread, objHandle, propKey, desc); in DefineGetterSetterByValue()
1498 JSTaggedValue SlowRuntimeStub::LdObjByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, bool… in LdObjByIndex() argument
1501 INTERPRETER_TRACE(thread, LdObjByIndexDyn); in LdObjByIndex()
1502 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LdObjByIndex()
1505 JSHandle<JSTaggedValue> objHandle(thread, obj); in LdObjByIndex()
1507 … res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), objHandle); in LdObjByIndex()
1509 res = JSTaggedValue::GetProperty(thread, objHandle, idx).GetValue().GetTaggedValue(); in LdObjByIndex()
1511 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LdObjByIndex()
1515 JSTaggedValue SlowRuntimeStub::StObjByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, JSTa… in StObjByIndex() argument
1517 INTERPRETER_TRACE(thread, StObjByIndexDyn); in StObjByIndex()
1518 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StObjByIndex()
1520 JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>(thread, obj), idx, in StObjByIndex()
1521 JSHandle<JSTaggedValue>(thread, value), true); in StObjByIndex()
1522 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StObjByIndex()
1526 JSTaggedValue SlowRuntimeStub::LdObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop,… in LdObjByName() argument
1529 INTERPRETER_TRACE(thread, LdObjByNameDyn); in LdObjByName()
1530 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LdObjByName()
1532 JSHandle<JSTaggedValue> objHandle(thread, obj); in LdObjByName()
1535 … res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), objHandle); in LdObjByName()
1537 JSHandle<JSTaggedValue> propHandle(thread, prop); in LdObjByName()
1538 res = JSTaggedValue::GetProperty(thread, objHandle, propHandle).GetValue().GetTaggedValue(); in LdObjByName()
1540 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LdObjByName()
1544 JSTaggedValue SlowRuntimeStub::StObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop,… in StObjByName() argument
1546 INTERPRETER_TRACE(thread, StObjByNameDyn); in StObjByName()
1547 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StObjByName()
1549 JSHandle<JSTaggedValue> objHandle(thread, obj); in StObjByName()
1550 JSHandle<JSTaggedValue> propHandle(thread, prop); in StObjByName()
1551 JSHandle<JSTaggedValue> valueHandle(thread, value); in StObjByName()
1552 JSTaggedValue::SetProperty(thread, objHandle, propHandle, valueHandle, true); in StObjByName()
1553 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StObjByName()
1557 JSTaggedValue SlowRuntimeStub::LdObjByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop… in LdObjByValue() argument
1560 INTERPRETER_TRACE(thread, LdObjByValueDyn); in LdObjByValue()
1561 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LdObjByValue()
1563 JSHandle<JSTaggedValue> objHandle(thread, obj); in LdObjByValue()
1566 … res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), objHandle); in LdObjByValue()
1568 …le<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, JSHandle<JSTaggedValue>(thread, p… in LdObjByValue()
1569 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LdObjByValue()
1570 res = JSTaggedValue::GetProperty(thread, objHandle, propKey).GetValue().GetTaggedValue(); in LdObjByValue()
1572 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LdObjByValue()
1576 JSTaggedValue SlowRuntimeStub::StObjByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, in StObjByValue() argument
1579 INTERPRETER_TRACE(thread, StObjByValueDyn); in StObjByValue()
1580 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StObjByValue()
1582 JSHandle<JSTaggedValue> objHandle(thread, obj); in StObjByValue()
1583 JSHandle<JSTaggedValue> propHandle(thread, prop); in StObjByValue()
1584 JSHandle<JSTaggedValue> valueHandle(thread, value); in StObjByValue()
1585 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, propHandle)); in StObjByValue()
1588 JSTaggedValue::SetProperty(thread, objHandle, propKey, valueHandle, true); in StObjByValue()
1589 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StObjByValue()
1593 JSTaggedValue SlowRuntimeStub::TryLdGlobalByName(JSThread *thread, JSTaggedValue global, JSTaggedVa… in TryLdGlobalByName() argument
1595 INTERPRETER_TRACE(thread, Trygetobjprop); in TryLdGlobalByName()
1596 [[maybe_unused]] EcmaHandleScope handleScope(thread); in TryLdGlobalByName()
1598 JSHandle<JSTaggedValue> obj(thread, global.GetTaggedObject()->GetClass()->GetPrototype()); in TryLdGlobalByName()
1599 JSHandle<JSTaggedValue> propHandle(thread, prop); in TryLdGlobalByName()
1600 OperationResult res = JSTaggedValue::GetProperty(thread, obj, propHandle); in TryLdGlobalByName()
1602 return ThrowReferenceError(thread, prop, " is not defined"); in TryLdGlobalByName()
1607 JSTaggedValue SlowRuntimeStub::TryStGlobalByName(JSThread *thread, JSTaggedValue prop) in TryStGlobalByName() argument
1609 INTERPRETER_TRACE(thread, TryStGlobalByName); in TryStGlobalByName()
1611 return ThrowReferenceError(thread, prop, " is not defined"); in TryStGlobalByName()
1614 JSTaggedValue SlowRuntimeStub::LdGlobalVar(JSThread *thread, JSTaggedValue global, JSTaggedValue pr… in LdGlobalVar() argument
1616 INTERPRETER_TRACE(thread, LdGlobalVar); in LdGlobalVar()
1617 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LdGlobalVar()
1619 JSHandle<JSTaggedValue> objHandle(thread, global.GetTaggedObject()->GetClass()->GetPrototype()); in LdGlobalVar()
1620 JSHandle<JSTaggedValue> propHandle(thread, prop); in LdGlobalVar()
1621 OperationResult res = JSTaggedValue::GetProperty(thread, objHandle, propHandle); in LdGlobalVar()
1622 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LdGlobalVar()
1626 JSTaggedValue SlowRuntimeStub::StGlobalVar(JSThread *thread, JSTaggedValue prop, JSTaggedValue valu… in StGlobalVar() argument
1628 INTERPRETER_TRACE(thread, StGlobalVar); in StGlobalVar()
1629 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StGlobalVar()
1631 JSHandle<JSTaggedValue> global(thread, thread->GetEcmaVM()->GetGlobalEnv()->GetGlobalObject()); in StGlobalVar()
1632 JSHandle<JSTaggedValue> propHandle(thread, prop); in StGlobalVar()
1633 JSHandle<JSTaggedValue> valueHandle(thread, value); in StGlobalVar()
1635 JSObject::GlobalSetProperty(thread, propHandle, valueHandle, true); in StGlobalVar()
1636 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StGlobalVar()
1640 JSTaggedValue SlowRuntimeStub::TryUpdateGlobalRecord(JSThread *thread, JSTaggedValue prop, JSTagged… in TryUpdateGlobalRecord() argument
1642 INTERPRETER_TRACE(thread, TryUpdateGlobalRecord); in TryUpdateGlobalRecord()
1643 [[maybe_unused]] EcmaHandleScope handleScope(thread); in TryUpdateGlobalRecord()
1645 EcmaVM *vm = thread->GetEcmaVM(); in TryUpdateGlobalRecord()
1652 return ThrowSyntaxError(thread, "const variable can not be modified"); in TryUpdateGlobalRecord()
1656 box->SetValue(thread, value); in TryUpdateGlobalRecord()
1657 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in TryUpdateGlobalRecord()
1662 JSTaggedValue SlowRuntimeStub::LdGlobalRecord(JSThread *thread, JSTaggedValue key) in LdGlobalRecord() argument
1664 INTERPRETER_TRACE(thread, LdGlobalRecord); in LdGlobalRecord()
1665 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LdGlobalRecord()
1667 EcmaVM *vm = thread->GetEcmaVM(); in LdGlobalRecord()
1677 JSTaggedValue SlowRuntimeStub::StGlobalRecord(JSThread *thread, JSTaggedValue prop, JSTaggedValue v… in StGlobalRecord() argument
1679 INTERPRETER_TRACE(thread, StGlobalRecord); in StGlobalRecord()
1680 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StGlobalRecord()
1682 EcmaVM *vm = thread->GetEcmaVM(); in StGlobalRecord()
1689 return ThrowSyntaxError(thread, "Duplicate identifier"); in StGlobalRecord()
1696 JSHandle<JSTaggedValue> propHandle(thread, prop); in StGlobalRecord()
1697 JSHandle<JSTaggedValue> valueHandle(thread, value); in StGlobalRecord()
1698 JSHandle<GlobalDictionary> dictHandle(thread, dict); in StGlobalRecord()
1700 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in StGlobalRecord()
1705 …dict = *GlobalDictionary::PutIfAbsent(thread, dictHandle, propHandle, JSHandle<JSTaggedValue>(box)… in StGlobalRecord()
1706 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StGlobalRecord()
1707 env->SetGlobalRecord(thread, JSTaggedValue(dict)); in StGlobalRecord()
1711 JSTaggedValue SlowRuntimeStub::ThrowReferenceError(JSThread *thread, JSTaggedValue prop, const char… in ThrowReferenceError() argument
1713 INTERPRETER_TRACE(thread, ThrowReferenceError); in ThrowReferenceError()
1714 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowReferenceError()
1715 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in ThrowReferenceError()
1716 …JSHandle<EcmaString> propName = JSTaggedValue::ToString(thread, JSHandle<JSTaggedValue>(thread, pr… in ThrowReferenceError()
1717 ASSERT_NO_ABRUPT_COMPLETION(thread); in ThrowReferenceError()
1720 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, in ThrowReferenceError()
1725 JSTaggedValue SlowRuntimeStub::ThrowTypeError(JSThread *thread, const char *message) in ThrowTypeError() argument
1727 INTERPRETER_TRACE(thread, ThrowTypeError); in ThrowTypeError()
1728 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowTypeError()
1729 ASSERT_NO_ABRUPT_COMPLETION(thread); in ThrowTypeError()
1730 THROW_TYPE_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in ThrowTypeError()
1733 JSTaggedValue SlowRuntimeStub::ThrowSyntaxError(JSThread *thread, const char *message) in ThrowSyntaxError() argument
1735 INTERPRETER_TRACE(thread, ThrowSyntaxError); in ThrowSyntaxError()
1736 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowSyntaxError()
1737 ASSERT_NO_ABRUPT_COMPLETION(thread); in ThrowSyntaxError()
1738 THROW_SYNTAX_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in ThrowSyntaxError()
1741 JSTaggedValue SlowRuntimeStub::StArraySpread(JSThread *thread, JSTaggedValue dst, JSTaggedValue ind… in StArraySpread() argument
1744 INTERPRETER_TRACE(thread, StArraySpread); in StArraySpread()
1745 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StArraySpread()
1747 JSHandle<JSTaggedValue> dstHandle(thread, dst); in StArraySpread()
1748 JSHandle<JSTaggedValue> srcHandle(thread, src); in StArraySpread()
1749 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in StArraySpread()
1752 JSHandle<EcmaString> srcString = JSTaggedValue::ToString(thread, srcHandle); in StArraySpread()
1753 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StArraySpread()
1759 JSTaggedValue::SetProperty(thread, dstHandle, dstLen + i, strValue, true); in StArraySpread()
1760 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StArraySpread()
1766 auto globalConst = thread->GlobalConstants(); in StArraySpread()
1772 JSHandle<JSTaggedValue> valuesMethod = JSObject::GetMethod(thread, srcHandle, valuesStr); in StArraySpread()
1773 iter = JSIterator::GetIterator(thread, srcHandle, valuesMethod); in StArraySpread()
1774 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StArraySpread()
1776 iter = JSIterator::GetIterator(thread, srcHandle); in StArraySpread()
1777 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StArraySpread()
1780 JSMutableHandle<JSTaggedValue> indexHandle(thread, index); in StArraySpread()
1782 PropertyDescriptor desc(thread); in StArraySpread()
1785 iterResult = JSIterator::IteratorStep(thread, iter); in StArraySpread()
1786 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StArraySpread()
1790 bool success = JSTaggedValue::GetOwnProperty(thread, iterResult, valueStr, desc); in StArraySpread()
1792 JSTaggedValue::DefineOwnProperty(thread, dstHandle, indexHandle, desc); in StArraySpread()
1801 JSTaggedValue SlowRuntimeStub::DefineGeneratorFunc(JSThread *thread, JSFunction *func) in DefineGeneratorFunc() argument
1803 INTERPRETER_TRACE(thread, DefineGeneratorFunc); in DefineGeneratorFunc()
1804 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DefineGeneratorFunc()
1807 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in DefineGeneratorFunc()
1808 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in DefineGeneratorFunc()
1810 ASSERT_NO_ABRUPT_COMPLETION(thread); in DefineGeneratorFunc()
1818 JSObject::SetPrototype(thread, initialGeneratorFuncPrototype, env->GetGeneratorPrototype()); in DefineGeneratorFunc()
1819 ASSERT_NO_ABRUPT_COMPLETION(thread); in DefineGeneratorFunc()
1820 jsFunc->SetProtoOrDynClass(thread, initialGeneratorFuncPrototype); in DefineGeneratorFunc()
1825 JSTaggedValue SlowRuntimeStub::DefineAsyncFunc(JSThread *thread, JSFunction *func) in DefineAsyncFunc() argument
1827 INTERPRETER_TRACE(thread, DefineAsyncFunc); in DefineAsyncFunc()
1828 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DefineAsyncFunc()
1831 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in DefineAsyncFunc()
1832 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in DefineAsyncFunc()
1835 ASSERT_NO_ABRUPT_COMPLETION(thread); in DefineAsyncFunc()
1839 JSTaggedValue SlowRuntimeStub::DefineNCFuncDyn(JSThread *thread, JSFunction *func) in DefineNCFuncDyn() argument
1841 INTERPRETER_TRACE(thread, DefineNCFuncDyn); in DefineNCFuncDyn()
1842 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DefineNCFuncDyn()
1845 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in DefineNCFuncDyn()
1846 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in DefineNCFuncDyn()
1849 ASSERT_NO_ABRUPT_COMPLETION(thread); in DefineNCFuncDyn()
1853 JSTaggedValue SlowRuntimeStub::DefinefuncDyn(JSThread *thread, JSFunction *func) in DefinefuncDyn() argument
1855 INTERPRETER_TRACE(thread, DefinefuncDyn); in DefinefuncDyn()
1856 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DefinefuncDyn()
1859 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in DefinefuncDyn()
1860 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in DefinefuncDyn()
1863 ASSERT_NO_ABRUPT_COMPLETION(thread); in DefinefuncDyn()
1867 JSTaggedValue SlowRuntimeStub::SuperCall(JSThread *thread, JSTaggedValue func, JSTaggedValue newTar… in SuperCall() argument
1870 INTERPRETER_TRACE(thread, SuperCall); in SuperCall()
1871 [[maybe_unused]] EcmaHandleScope handleScope(thread); in SuperCall()
1872 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SuperCall()
1873 InterpretedFrameHandler frameHandler(thread); in SuperCall()
1875 JSHandle<JSTaggedValue> funcHandle(thread, func); in SuperCall()
1876 JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); in SuperCall()
1878 …JSHandle<JSTaggedValue> superFunc(thread, JSHandle<JSObject>::Cast(funcHandle)->GetPrototype(threa… in SuperCall()
1883 argv->Set(thread, i, frameHandler.GetVRegValue(firstVRegIdx + i)); in SuperCall()
1885 InternalCallParams *arguments = thread->GetInternalCallParams(); in SuperCall()
1887 …JSTaggedValue result = JSFunction::Construct(thread, superFunc, length, arguments->GetArgv(), newT… in SuperCall()
1888 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in SuperCall()
1893 JSTaggedValue SlowRuntimeStub::SuperCallSpread(JSThread *thread, JSTaggedValue func, JSTaggedValue … in SuperCallSpread() argument
1896 INTERPRETER_TRACE(thread, SuperCallSpread); in SuperCallSpread()
1897 [[maybe_unused]] EcmaHandleScope handleScope(thread); in SuperCallSpread()
1898 InterpretedFrameHandler frameHandler(thread); in SuperCallSpread()
1900 JSHandle<JSTaggedValue> funcHandle(thread, func); in SuperCallSpread()
1901 JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); in SuperCallSpread()
1902 JSHandle<JSTaggedValue> jsArray(thread, array); in SuperCallSpread()
1904 …JSHandle<JSTaggedValue> superFunc(thread, JSHandle<JSObject>::Cast(funcHandle)->GetPrototype(threa… in SuperCallSpread()
1907 JSHandle<TaggedArray> argv(thread, GetCallSpreadArgs(thread, jsArray.GetTaggedValue())); in SuperCallSpread()
1908 InternalCallParams *arguments = thread->GetInternalCallParams(); in SuperCallSpread()
1911 …JSFunction::Construct(thread, superFunc, argv->GetLength(), arguments->GetArgv(), newTargetHandle); in SuperCallSpread()
1912 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in SuperCallSpread()
1917 JSTaggedValue SlowRuntimeStub::DefineMethod(JSThread *thread, JSFunction *func, JSTaggedValue homeO… in DefineMethod() argument
1919 INTERPRETER_TRACE(thread, DefineMethod); in DefineMethod()
1920 [[maybe_unused]] EcmaHandleScope handleScope(thread); in DefineMethod()
1922 JSHandle<JSTaggedValue> homeObjectHandle(thread, homeObject); in DefineMethod()
1925 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in DefineMethod()
1926 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in DefineMethod()
1929 jsFunc->SetHomeObject(thread, homeObjectHandle); in DefineMethod()
1930 ASSERT_NO_ABRUPT_COMPLETION(thread); in DefineMethod()
1934 JSTaggedValue SlowRuntimeStub::LdSuperByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue ke… in LdSuperByValue() argument
1937 INTERPRETER_TRACE(thread, LdSuperByValue); in LdSuperByValue()
1938 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LdSuperByValue()
1941 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in LdSuperByValue()
1944 return ThrowReferenceError(thread, obj, "this is uninitialized."); in LdSuperByValue()
1946 JSHandle<JSTaggedValue> objHandle(thread, obj); in LdSuperByValue()
1947 JSHandle<JSTaggedValue> propHandle(thread, key); in LdSuperByValue()
1949 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, propHandle)); in LdSuperByValue()
1950 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in LdSuperByValue()
1951 JSTaggedValue::RequireObjectCoercible(thread, superBase); in LdSuperByValue()
1952 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LdSuperByValue()
1954 …JSTaggedValue res = JSTaggedValue::GetProperty(thread, superBase, propKey, objHandle).GetValue().G… in LdSuperByValue()
1955 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LdSuperByValue()
1959 JSTaggedValue SlowRuntimeStub::StSuperByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue ke… in StSuperByValue() argument
1962 INTERPRETER_TRACE(thread, StSuperByValue); in StSuperByValue()
1963 [[maybe_unused]] EcmaHandleScope handleScope(thread); in StSuperByValue()
1966 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in StSuperByValue()
1969 return ThrowReferenceError(thread, obj, "this is uninitialized."); in StSuperByValue()
1971 JSHandle<JSTaggedValue> objHandle(thread, obj); in StSuperByValue()
1972 JSHandle<JSTaggedValue> propHandle(thread, key); in StSuperByValue()
1973 JSHandle<JSTaggedValue> valueHandle(thread, value); in StSuperByValue()
1975 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, propHandle)); in StSuperByValue()
1976 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in StSuperByValue()
1977 JSTaggedValue::RequireObjectCoercible(thread, superBase); in StSuperByValue()
1978 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StSuperByValue()
1981 JSTaggedValue::SetProperty(thread, superBase, propKey, valueHandle, objHandle, true); in StSuperByValue()
1982 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in StSuperByValue()
1986 JSTaggedValue SlowRuntimeStub::GetCallSpreadArgs(JSThread *thread, JSTaggedValue array) in GetCallSpreadArgs() argument
1988 INTERPRETER_TRACE(thread, GetCallSpreadArgs); in GetCallSpreadArgs()
1989 [[maybe_unused]] EcmaHandleScope handleScope(thread); in GetCallSpreadArgs()
1990 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in GetCallSpreadArgs()
1992 JSHandle<JSTaggedValue> jsArray(thread, array); in GetCallSpreadArgs()
1995 JSHandle<JSTaggedValue> itor = JSIterator::GetIterator(thread, jsArray); in GetCallSpreadArgs()
1996 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetCallSpreadArgs()
1997 JSMutableHandle<JSTaggedValue> next(thread, JSTaggedValue::Undefined()); in GetCallSpreadArgs()
1998 JSMutableHandle<JSTaggedValue> nextArg(thread, JSTaggedValue::Undefined()); in GetCallSpreadArgs()
2001 next.Update(JSIterator::IteratorStep(thread, itor).GetTaggedValue()); in GetCallSpreadArgs()
2002 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetCallSpreadArgs()
2006 nextArg.Update(JSIterator::IteratorValue(thread, next).GetTaggedValue()); in GetCallSpreadArgs()
2007 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetCallSpreadArgs()
2008 argv->Set(thread, argvIndex++, nextArg); in GetCallSpreadArgs()
2015 void SlowRuntimeStub::ThrowDeleteSuperProperty(JSThread *thread) in ThrowDeleteSuperProperty() argument
2017 INTERPRETER_TRACE(thread, ThrowDeleteSuperProperty); in ThrowDeleteSuperProperty()
2018 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ThrowDeleteSuperProperty()
2020 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in ThrowDeleteSuperProperty()
2023 THROW_NEW_ERROR_AND_RETURN(thread, errorObj.GetTaggedValue()); in ThrowDeleteSuperProperty()
2026 JSTaggedValue SlowRuntimeStub::NotifyInlineCache(JSThread *thread, JSFunction *func, JSMethod *meth… in NotifyInlineCache() argument
2028 INTERPRETER_TRACE(thread, NotifyInlineCache); in NotifyInlineCache()
2031 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NotifyInlineCache()
2032 [[maybe_unused]] EcmaHandleScope handleScope(thread); in NotifyInlineCache()
2034 JSHandle<JSFunction> funcHandle(thread, func); in NotifyInlineCache()
2036 funcHandle->SetProfileTypeInfo(thread, profileTypeInfo.GetTaggedValue()); in NotifyInlineCache()
2042 JSTaggedValue SlowRuntimeStub::ResolveClass(JSThread *thread, JSTaggedValue ctor, TaggedArray *lite… in ResolveClass() argument
2046 JSHandle<JSFunction> cls(thread, ctor); in ResolveClass()
2047 JSHandle<TaggedArray> literalBuffer(thread, literal); in ResolveClass()
2048 JSHandle<JSTaggedValue> lexicalEnv(thread, lexenv); in ResolveClass()
2049 JSHandle<ConstantPool> constpoolHandle(thread, constpool); in ResolveClass()
2051 SetClassInheritanceRelationship(thread, ctor, base); in ResolveClass()
2052 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ResolveClass()
2060 … JSFunction::Cast(value.GetTaggedObject())->SetLexicalEnv(thread, lexicalEnv.GetTaggedValue()); in ResolveClass()
2061 …JSFunction::Cast(value.GetTaggedObject())->SetConstantPool(thread, constpoolHandle.GetTaggedValue(… in ResolveClass()
2070 JSTaggedValue SlowRuntimeStub::CloneClassFromTemplate(JSThread *thread, JSTaggedValue ctor, JSTagge… in CloneClassFromTemplate() argument
2073 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CloneClassFromTemplate()
2074 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CloneClassFromTemplate()
2075 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in CloneClassFromTemplate()
2078 JSHandle<JSTaggedValue> lexenvHandle(thread, lexenv); in CloneClassFromTemplate()
2079 JSHandle<JSTaggedValue> constpoolHandle(thread, JSTaggedValue(constpool)); in CloneClassFromTemplate()
2080 JSHandle<JSTaggedValue> baseHandle(thread, base); in CloneClassFromTemplate()
2082 JSHandle<JSFunction> cls(thread, ctor); in CloneClassFromTemplate()
2084 JSHandle<JSObject> clsPrototype(thread, cls->GetFunctionPrototype()); in CloneClassFromTemplate()
2089 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CloneClassFromTemplate()
2092 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CloneClassFromTemplate()
2095 cloneClass->SetFunctionPrototype(thread, cloneClassPrototype.GetTaggedValue()); in CloneClassFromTemplate()
2096 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CloneClassFromTemplate()
2098 PropertyDescriptor ctorDesc(thread, JSHandle<JSTaggedValue>(cloneClass), true, false, true); in CloneClassFromTemplate()
2099 JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(cloneClassPrototype), in CloneClassFromTemplate()
2101 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CloneClassFromTemplate()
2103 cloneClass->SetHomeObject(thread, cloneClassPrototype); in CloneClassFromTemplate()
2106 … SetClassInheritanceRelationship(thread, cloneClass.GetTaggedValue(), baseHandle.GetTaggedValue()); in CloneClassFromTemplate()
2107 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CloneClassFromTemplate()
2113 JSTaggedValue SlowRuntimeStub::SetClassInheritanceRelationship(JSThread *thread, JSTaggedValue ctor… in SetClassInheritanceRelationship() argument
2115 [[maybe_unused]] EcmaHandleScope handleScope(thread); in SetClassInheritanceRelationship()
2116 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in SetClassInheritanceRelationship()
2117 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in SetClassInheritanceRelationship()
2119 JSHandle<JSTaggedValue> cls(thread, ctor); in SetClassInheritanceRelationship()
2121 JSMutableHandle<JSTaggedValue> parent(thread, base); in SetClassInheritanceRelationship()
2144 parentPrototype = JSHandle<JSTaggedValue>(thread, JSTaggedValue::Null()); in SetClassInheritanceRelationship()
2147 return ThrowTypeError(thread, "parent class is not constructor"); in SetClassInheritanceRelationship()
2150 parentPrototype = JSTaggedValue::GetProperty(thread, parent, in SetClassInheritanceRelationship()
2153 return ThrowTypeError(thread, "parent class have no valid prototype"); in SetClassInheritanceRelationship()
2157 cls->GetTaggedObject()->GetClass()->SetPrototype(thread, parent); in SetClassInheritanceRelationship()
2159 JSHandle<JSObject> clsPrototype(thread, JSHandle<JSFunction>(cls)->GetFunctionPrototype()); in SetClassInheritanceRelationship()
2160 clsPrototype->GetClass()->SetPrototype(thread, parentPrototype); in SetClassInheritanceRelationship()
2165 JSTaggedValue SlowRuntimeStub::SetClassConstructorLength(JSThread *thread, JSTaggedValue ctor, JSTa… in SetClassConstructorLength() argument
2171 cls->SetPropertyInlinedProps(thread, JSFunction::LENGTH_INLINE_PROPERTY_INDEX, length); in SetClassConstructorLength()
2173 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in SetClassConstructorLength()
2174 cls->UpdatePropertyInDictionary(thread, globalConst->GetLengthString(), length); in SetClassConstructorLength()
2179 JSTaggedValue SlowRuntimeStub::LdBigInt(JSThread *thread, JSTaggedValue numberBigInt) in LdBigInt() argument
2181 INTERPRETER_TRACE(thread, LdBigInt); in LdBigInt()
2182 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LdBigInt()
2183 JSHandle<JSTaggedValue> bigint(thread, numberBigInt); in LdBigInt()
2184 return JSTaggedValue::ToBigInt(thread, bigint); in LdBigInt()