60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
return GetBuiltinIntrinsicFuncWrapper( preparedCallee )( c, move( typeCheckedArgs ) );
auto ft = *FromValue< FuncType >( *EIRToValue( preparedCallee.type() ) );
if( ft.intrinsic() )
{
// Intrinsic call: we insert the code builder wrapper as first param,
// wrap all args with ValueWrapper, and execute the function directly.
auto argList = BuildArgListForIntrinsicCall( c, ft, typeCheckedArgs );
if( !argList )
return PoisonValue();
execute::VM vm;
auto result = vm.execute( cir::Call( preparedCallee, move( *argList ) ) );
if( ft.returnType() == GetValueType< void >() )
return Value( GetValueType< void >(), 0U );
if( !result )
return PoisonValue();
// Unwrap the returned value
auto unwrapped = FromValue< ValueWrapper >( *result );
return unwrapped ? *unwrapped : PoisonValue();
}
auto argList = BuildArgListForCall( c, ft, typeCheckedArgs );
if( !argList )
return PoisonValue();
|
|
|
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
return GetBuiltinIntrinsicFuncWrapper( preparedCallee )( c, move( typeCheckedArgs ) );
auto ft = *FromValue< FuncType >( *EIRToValue( preparedCallee.type() ) );
if( ft.intrinsic() )
{
// Intrinsic call: we insert the code builder wrapper as first param,
// wrap all args with TypeWrapper< Value >, and execute the function directly.
auto argList = BuildArgListForIntrinsicCall( c, ft, typeCheckedArgs );
if( !argList )
return PoisonValue();
execute::VM vm;
auto result = vm.execute( cir::Call( preparedCallee, move( *argList ) ) );
if( ft.returnType() == GetValueType< void >() )
return Value( GetValueType< void >(), 0U );
if( !result )
return PoisonValue();
// Unwrap the returned value
auto unwrapped = FromValue< TypeWrapper< Value > >( *result );
return unwrapped ? *unwrapped : PoisonValue();
}
auto argList = BuildArgListForCall( c, ft, typeCheckedArgs );
if( !argList )
return PoisonValue();
|