replacements and getHostProviders

Doug Simon doug.simon at oracle.com
Tue Nov 19 16:14:34 PST 2013



On 11/20/2013 12:30 AM, Deneau, Tom wrote:
> Doug or others --
>
> Currently the HSAIL backend lazily delegates all replacements to the host.
> And in HSAILHotSpotBackendFactory we also define our backend registers to be
>          HotSpotRegisters registers = new HotSpotRegisters(Register.None, Register.None, Register.None);
>
> expecting that to hit an assert if anything tries to get the threadRegister, heapBaseRegister or stackPointerRegister.
>
> But if the method we are compiling in the HSAIL backend starts expanding a snippet that might use the threadRegister,
> I see that HotSpotReplacementsUtil defines threadRegister() as
>
>      public static Register threadRegister() {
>          return runtime().getHostProviders().getRegisters().getThreadRegister();
>      }
>
> which always goes to the host rather than the backend's registers.  So we don't catch an error at compile time but
> instead at runtime.
>
> Is it a mistake that HotSpotReplacementsUtil goes thru the HostProviders?

No - these utils are for host-only snippets. This is why I explained previously that for HSAIL you cannot re-use the snippets that use these utils.

-Doug


More information about the graal-dev mailing list