本文整理汇总了C++中CodeGen::vmiSYS_CALL方法的典型用法代码示例。如果您正苦于以下问题:C++ CodeGen::vmiSYS_CALL方法的具体用法?C++ CodeGen::vmiSYS_CALL怎么用?C++ CodeGen::vmiSYS_CALL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGen
的用法示例。
在下文中一共展示了CodeGen::vmiSYS_CALL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeSysFn
Ref makeSysFn( CodeGen codegen, std::string fn_name, Ref default_value ) {
SysMap::iterator smit = SysMap::systemFunctionsMap().find( fn_name );
if ( smit == SysMap::systemFunctionsMap().end() ) {
return default_value;
}
SysInfo & info = smit->second;
Ref x = info.coreFunctionObject;
if ( x != NULL ) return x;
codegen->vmiFUNCTION( fn_name, info.in_arity.count(), info.out_arity.count() );
// We have two different kinds of system functions. Those that are
// implemented as native instructions and those that are implemented
// by hand-written functions.
//
// The test that distinguishes them is unsatisfactory because it fails
// to distinguish an omitted something from a genuine choice.
// REFACTOR.
//
if ( info.isSysCall() ) {
// Hand-written function.
codegen->vmiSYS_CALL( info.syscall );
} else if ( info.isVMOp() ) {
// Native instruction.
codegen->vmiINSTRUCTION( info.instruction );
} else {
throw SystemError( "Internal error" );
}
codegen->vmiSYS_RETURN();
Ref r = codegen->vmiENDFUNCTION( false );
info.coreFunctionObject = r;
return r;
}