RFR(M): 8200303: C2 should leverage profiling for lookupswitch/tableswitch

Vladimir Kozlov vladimir.kozlov at oracle.com
Fri Apr 6 23:09:19 UTC 2018

On 4/6/18 6:56 AM, Roland Westrelin wrote:
> Hi Vladimir,
>> Roland, did you perform any performance testing?
> I ran specjvm2008 to verify that there's no regression with profiling on
> and off over the unmodified code. The only noticeable thing is that the
> score for Serial improved by ~9% when profiling is enabled. I also have
> some micro-benchmarks I wrote to check that the various strategies do
> bring an improvement over the current implementation (binary search) in
> some scenarios.

Yes, I ran our performance testing and Serial indeed improved.
In general it looks good.

>>>> I don't understand how the MachIfNode class in the SA is supposed to be
>>>> used. I tried dumping a graph that has a MachIfNode from clhsdb and the
>>>> MachIfNode shows up as unknown:
>>>>    7      UnknownNode<0x00007fe79787c428> ===  9  8    [[ 6  28 ]]
>>>>    28     IfFalse ===  7  [[ 27 ]]
>>>> So I'm not sure it's worth the trouble of adding a MachJumpNode.
>>> I agree. If so, we should fix this altogether (i.e. for existing nodes as well) but I'm not sure if
>>> anyone is using graph dumping via the SA.
>> I think we should fix it - it is good starter task for community.
>> Please, file a bug.
> What part? The missing MachJumpNode? Or the output from the SA with the
> UnknownNode that should be displayed as a MachIfNode instead?

I meant general problem with UnknownNode output.

But in your case I thouight just add MachJumpNode class and its supers 
MachConstantNode and MachTypeNode.

Actually description of MachIfNode is incorrect. It is subclass of 
MachBranchNode and MachIdealNode which are missing in SA.

You don't need check virtual table - you can use _class_id field for 
class id.


> Is the second part that easy? for an If, the class of the MachNode is a
> platform specific class that is a subclass of MachIfNode. How would the
> SA know it's a subclass of MachIfNode? I suppose the SA finds the class
> of an object by looking at the vtable pointer and comparing it with a
> list that is exported by vmStructs. That only works for an exact class
> check. How do you implement a subclass check?
> Roland.

More information about the hotspot-compiler-dev mailing list