FastR: Inlining failing

Christian Wimmer christian.wimmer at oracle.com
Fri Jul 1 15:03:48 UTC 2016


There is a missing @TruffleBoundary or 
CompilerDiretives.transferToInterpreter.  String formatting (the call to 
String.format) must not be reachable during partial evaluation. It is 
probably called from the RInternalError constructor.

-Christian


On 7/1/2016 2:39 AM, Juan Fumero wrote:
> Hi all,
>
>  Within FastR,  I am working now Tuples (RList with fixed types) in R
> for the GPU. I get a runtime error when I am trying to compile the
> function through the Partial Evaluator.
>
> <code>
> # Simple test case
> Tuple2 <- function(x, y) {
>     t <- list(name="tuple2", a=x, b=y)
>     attr(t, "class") <- "tuple2"
>     return(t)
> }
>
> gpuFunction <- function(x) {
>      return(Tuple2(x, x))
> }
>
> # R sapply for GPUs
> result <- marawacc.sapply(1:1000, gpuFunction)
>
> </code>
>
> When Graal tries to compile the gpuFunction through the
> OptimzedCallTarget, I get the following error in FastR. Any idea? I do
> not get why this is a recursive inlining,
>
> [truffle] opt
> fail         gpuFunction
>   |Reason jdk.vm.ci.code.BailoutException: Too deep inlining, probably
> caused by recursive inlining. Inlined methods ordered by inlining
> frequency:
> java.util.ResourceBundle.getObject(String) [488]
> java.text.DecimalFormatSymbols.getInstance(Locale) [1]
> java.util.Formatter.<init>(Locale, Appendable) [1]
> com.oracle.graal.truffle.OptimizedCallTarget.callRoot(Object[]) [1]
> java.lang.String.format(String, Object[]) [1]
> com.oracle.graal.truffle.OptimizedCallTarget.callProxy(VirtualFrame)
> [1]
> java.text.DecimalFormatSymbols.<init>(Locale) [1]
> java.util.Formatter.getZero(Locale) [1]
> com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.gpuExecution
> (VirtualFrame) [1]
> java.text.DecimalFormatSymbols.initialize(Locale) [1]
> com.oracle.truffle.r.runtime.RInternalError.<init>(Throwable, String,
> Object[]) [1]
> java.util.Formatter.<init>() [1]
> com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(Virt
> ualFrame) [1]
> sun.util.locale.provider.LocaleResources.getDecimalFormatSymbolsData()
> [1]
> sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(L
> ocale) [1]
>
>
> It does work if, instead of returning as S3 object, I return an RList.
>
> <code>
> gpuFunction <- function(x) {
>      list(name="tuple2",x,x)
> }
> </code>
>
> As a work around I am working with RList directly, but I would like to return an S3 object. Any idea is welcome.
>
> Cheers
> Juan
>
>
>
>
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>


More information about the graal-dev mailing list