本文整理汇总了C++中CLR_RT_HeapBlock::PerformBoxing方法的典型用法代码示例。如果您正苦于以下问题:C++ CLR_RT_HeapBlock::PerformBoxing方法的具体用法?C++ CLR_RT_HeapBlock::PerformBoxing怎么用?C++ CLR_RT_HeapBlock::PerformBoxing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLR_RT_HeapBlock
的用法示例。
在下文中一共展示了CLR_RT_HeapBlock::PerformBoxing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Pop
//.........这里部分代码省略.........
{
//Do nothing here. Pushing return values onto stack frames that don't expect them are a bad idea.
}
#if defined(TINYCLR_APPDOMAINS)
else if((m_flags & CLR_RT_StackFrame::c_AppDomainTransition) != 0)
{
(void)PopAppDomainTransition();
}
#endif
}
else //!c_moreFlagsToCheck
{
//
// Push the return, if any.
//
if(m_call.m_target->retVal != DATATYPE_VOID)
{
if(m_owningThread->m_currentException.Dereference() == NULL)
{
CLR_RT_HeapBlock& src = this ->TopValue ( );
CLR_RT_HeapBlock& dst = caller->PushValueAndAssign( src );
dst.Promote();
}
}
}
}
}
#if defined(TINYCLR_ENABLE_SOURCELEVELDEBUGGING)
else
{
int idx = m_owningThread->m_scratchPad;
if(idx >= 0)
{
CLR_RT_HeapBlock_Array* array = g_CLR_RT_ExecutionEngine.m_scratchPadArray;
if(array && array->m_numOfElements > (CLR_UINT32)idx)
{
CLR_RT_HeapBlock* dst = (CLR_RT_HeapBlock*)array->GetElement( (CLR_UINT32)idx );
CLR_RT_HeapBlock* exception = m_owningThread->m_currentException.Dereference();
dst->SetObjectReference( NULL );
if(exception != NULL)
{
dst->SetObjectReference( exception );
}
else if(m_call.m_target->retVal != DATATYPE_VOID)
{
CLR_RT_SignatureParser sig;
sig.Initialize_MethodSignature( this->m_call.m_assm, this->m_call.m_target );
CLR_RT_SignatureParser::Element res;
CLR_RT_TypeDescriptor desc;
dst->Assign( this->TopValue() );
//Perform boxing, if needed.
//Box to the return value type
_SIDE_ASSERTE(SUCCEEDED(sig.Advance( res )));
_SIDE_ASSERTE(SUCCEEDED(desc.InitializeFromType( res.m_cls )));
if(c_CLR_RT_DataTypeLookup[ this->DataType() ].m_flags & CLR_RT_DataTypeLookup::c_OptimizedValueType
|| desc.m_handlerCls.m_target->IsEnum()
)
{
if(FAILED(dst->PerformBoxing( desc.m_handlerCls )))
{
dst->SetObjectReference( NULL );
}
}
}
}
}
}
#endif
//
// We could be jumping outside of a nested exception handler.
//
m_owningThread->PopEH( this, NULL );
//
// If this StackFrame owns a SubThread, kill it.
//
{
CLR_RT_SubThread* sth = (CLR_RT_SubThread*)m_owningSubThread->Next();
if(sth->Next() && sth->m_owningStackFrame == this)
{
CLR_RT_SubThread::DestroyInstance( sth->m_owningThread, sth, CLR_RT_SubThread::MODE_IncludeSelf );
}
}
g_CLR_RT_EventCache.Append_Node( this );
}