please help understanding what's the relationship of hotspot compiler c1 and c2 ?

恶灵骑士 1072213404 at
Wed Nov 2 08:48:30 UTC 2016

Thank you ,Krystal !
i think i need some time to make these things light,

which part of  code  link HIR and LIR together in openjdk ?

c1 matches client   mode,
c2 matches server  mode,
when some code running, just one of them work or both do?

------------------ 原始邮件 ------------------
发件人: "Krystal Mok";<rednaxelafx at>;
发送时间: 2016年11月2日(星期三) 下午4:28
收件人: "恶灵骑士"<1072213404 at>; 
抄送: "hotspot-dev"<hotspot-dev at>; 
主题: Re: please help understanding what's the function and diffrence between hotspot compiler c1 and c2 ?


I don't think I understand your question, but I'll take a shot.
Are you trying to ask what the differences are between C1 and C2, with regards to how they handle volatile field accesses?

For C1, yes, all Java fields accesses (load/store) are represented in the HIR with LoadField and StoreField instructions. The ciField in these instructions would carry the information about whether the field is volatile or not.
When lowering HIR to LIR, the LIRGenerator::do_LoadField() and do_StoreField() functions are called. What is it that you're trying to learn about these functions?

For C2, it's a bit complicated, because volatile semantics involve the memory graph portion of C2's Sea-of-nodes IR. You may want to refer to [1] and [2] for some background information before you dive into the code.

Hope it helps,


On Wed, Nov 2, 2016 at 1:19 AM, 恶灵骑士 <1072213404 at> wrote:
what's the function and diffrence between hotspot compiler c1 and c2 ?
 about c1,
 i have found something about ‘voaltile’ and
 methods  LIRGenerator::do_StoreField(StoreField* x)  and  LIRGenerator::do_LoadField(LoadField* x) in   ‘share/vm/c1/c1_LIRGenerator.cpp‘,
 when operating a  variable with a volatile qualifier,will it finally invoke do_StoreField or do_LoadField method?
 if true, then method do_LoadField or do_StoreField  by  which method?

More information about the hotspot-dev mailing list