diff --git a/runtime/builtins/builtins_global.cpp b/runtime/builtins/builtins_global.cpp index 4ba8aa69211150f2dc5e07d91d2ce4ba1066027c..d3ba3be6d1a69c9bba4153b07da92c9bc9522774 100644 --- a/runtime/builtins/builtins_global.cpp +++ b/runtime/builtins/builtins_global.cpp @@ -1004,6 +1004,7 @@ JSTaggedValue BuiltinsGlobal::MarkObjectRecursively(EcmaRuntimeCallInfo *msg) mem::GC *gc = thread->GetEcmaVM()->GetGC(); JSHandle arg = GetCallArg(msg, 0); if (!arg->IsHeapObject()) { + [[maybe_unused]] EcmaHandleScope handle_scope(thread); THROW_TYPE_ERROR_AND_RETURN(thread, "Argument is not an object", JSTaggedValue::Exception()); } @@ -1029,12 +1030,12 @@ JSTaggedValue BuiltinsGlobal::GCObjectSpaceType(EcmaRuntimeCallInfo *msg) ASSERT(msg != nullptr); JSThread *thread = msg->GetThread(); ASSERT(thread != nullptr); - [[maybe_unused]] EcmaHandleScope handle_scope(thread); BUILTINS_API_TRACE(thread, Global, GCObjectSpaceType); JSHandle obj_handle = GetCallArg(msg, 0); auto global_constants = thread->GlobalConstants(); if (!obj_handle.GetTaggedValue().IsHeapObject()) { + [[maybe_unused]] EcmaHandleScope handle_scope(thread); JSHandle err = thread->GetEcmaVM()->GetFactory()->GetJSError(ErrorType::TYPE_ERROR, "Non Heap Object"); THROW_NEW_ERROR_AND_RETURN_VALUE(thread, err.GetTaggedValue(), JSTaggedValue::Exception()); @@ -1084,6 +1085,7 @@ JSTaggedValue BuiltinsGlobal::PinObject(EcmaRuntimeCallInfo *msg) } obj_allocator->PinObject(arg->GetHeapObject()); } else { + [[maybe_unused]] EcmaHandleScope handleScope(thread); JSHandle err = vm->GetFactory()->GetJSError(ErrorType::TYPE_ERROR, "The value must be an object"); THROW_NEW_ERROR_AND_RETURN_VALUE(thread, err.GetTaggedValue(), JSTaggedValue::Exception()); } @@ -1099,6 +1101,7 @@ JSTaggedValue BuiltinsGlobal::UnpinObject(EcmaRuntimeCallInfo *msg) if (arg->IsHeapObject()) { vm->GetHeapManager()->GetObjectAllocator().AsObjectAllocator()->UnpinObject(arg->GetHeapObject()); } else { + [[maybe_unused]] EcmaHandleScope handleScope(thread); JSHandle err = vm->GetFactory()->GetJSError(ErrorType::TYPE_ERROR, "The value must be an object"); THROW_NEW_ERROR_AND_RETURN_VALUE(thread, err.GetTaggedValue(), JSTaggedValue::Exception()); } @@ -1109,6 +1112,7 @@ JSTaggedValue BuiltinsGlobal::GetObjectAddress(EcmaRuntimeCallInfo *msg) { JSThread *thread = msg->GetThread(); BUILTINS_API_TRACE(thread, Global, GetObjectAddress); + [[maybe_unused]] EcmaHandleScope handleScope(thread); PandaStringStream addr_stream; addr_stream << GetCallArg(msg, 0)->GetHeapObject(); return thread->GetEcmaVM()->GetFactory()->NewFromString(addr_stream.str()).GetTaggedValue();