Mercurial > hg > truffle
comparison src/share/vm/opto/parseHelper.cpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | 2113136690bc |
children | 52b4284cb496 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
220 _gvn.set_type(merge, Type::CONTROL); | 220 _gvn.set_type(merge, Type::CONTROL); |
221 Node* kls = makecon(TypeKlassPtr::make(klass)); | 221 Node* kls = makecon(TypeKlassPtr::make(klass)); |
222 | 222 |
223 Node* init_thread_offset = _gvn.MakeConX(in_bytes(InstanceKlass::init_thread_offset())); | 223 Node* init_thread_offset = _gvn.MakeConX(in_bytes(InstanceKlass::init_thread_offset())); |
224 Node* adr_node = basic_plus_adr(kls, kls, init_thread_offset); | 224 Node* adr_node = basic_plus_adr(kls, kls, init_thread_offset); |
225 Node* init_thread = make_load(NULL, adr_node, TypeRawPtr::BOTTOM, T_ADDRESS, MemNode::unordered); | 225 Node* init_thread = make_load(NULL, adr_node, TypeRawPtr::BOTTOM, T_ADDRESS); |
226 Node *tst = Bool( CmpP( init_thread, cur_thread), BoolTest::eq); | 226 Node *tst = Bool( CmpP( init_thread, cur_thread), BoolTest::eq); |
227 IfNode* iff = create_and_map_if(control(), tst, PROB_ALWAYS, COUNT_UNKNOWN); | 227 IfNode* iff = create_and_map_if(control(), tst, PROB_ALWAYS, COUNT_UNKNOWN); |
228 set_control(IfTrue(iff)); | 228 set_control(IfTrue(iff)); |
229 merge->set_req(1, IfFalse(iff)); | 229 merge->set_req(1, IfFalse(iff)); |
230 | 230 |
231 Node* init_state_offset = _gvn.MakeConX(in_bytes(InstanceKlass::init_state_offset())); | 231 Node* init_state_offset = _gvn.MakeConX(in_bytes(InstanceKlass::init_state_offset())); |
232 adr_node = basic_plus_adr(kls, kls, init_state_offset); | 232 adr_node = basic_plus_adr(kls, kls, init_state_offset); |
233 // Use T_BOOLEAN for InstanceKlass::_init_state so the compiler | 233 // Use T_BOOLEAN for InstanceKlass::_init_state so the compiler |
234 // can generate code to load it as unsigned byte. | 234 // can generate code to load it as unsigned byte. |
235 Node* init_state = make_load(NULL, adr_node, TypeInt::UBYTE, T_BOOLEAN, MemNode::unordered); | 235 Node* init_state = make_load(NULL, adr_node, TypeInt::UBYTE, T_BOOLEAN); |
236 Node* being_init = _gvn.intcon(InstanceKlass::being_initialized); | 236 Node* being_init = _gvn.intcon(InstanceKlass::being_initialized); |
237 tst = Bool( CmpI( init_state, being_init), BoolTest::eq); | 237 tst = Bool( CmpI( init_state, being_init), BoolTest::eq); |
238 iff = create_and_map_if(control(), tst, PROB_ALWAYS, COUNT_UNKNOWN); | 238 iff = create_and_map_if(control(), tst, PROB_ALWAYS, COUNT_UNKNOWN); |
239 set_control(IfTrue(iff)); | 239 set_control(IfTrue(iff)); |
240 merge->set_req(2, IfFalse(iff)); | 240 merge->set_req(2, IfFalse(iff)); |
352 Node* ctrl = control(); | 352 Node* ctrl = control(); |
353 const TypePtr* adr_type = TypeRawPtr::make((address) counters_adr); | 353 const TypePtr* adr_type = TypeRawPtr::make((address) counters_adr); |
354 Node *counters_node = makecon(adr_type); | 354 Node *counters_node = makecon(adr_type); |
355 Node* adr_iic_node = basic_plus_adr(counters_node, counters_node, | 355 Node* adr_iic_node = basic_plus_adr(counters_node, counters_node, |
356 MethodCounters::interpreter_invocation_counter_offset_in_bytes()); | 356 MethodCounters::interpreter_invocation_counter_offset_in_bytes()); |
357 Node* cnt = make_load(ctrl, adr_iic_node, TypeInt::INT, T_INT, adr_type, MemNode::unordered); | 357 Node* cnt = make_load(ctrl, adr_iic_node, TypeInt::INT, T_INT, adr_type); |
358 | 358 |
359 test_counter_against_threshold(cnt, limit); | 359 test_counter_against_threshold(cnt, limit); |
360 | 360 |
361 // Add one to the counter and store | 361 // Add one to the counter and store |
362 Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(1))); | 362 Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(1))); |
363 store_to_memory(ctrl, adr_iic_node, incr, T_INT, adr_type, MemNode::unordered); | 363 store_to_memory( ctrl, adr_iic_node, incr, T_INT, adr_type ); |
364 } | 364 } |
365 | 365 |
366 //----------------------------method_data_addressing--------------------------- | 366 //----------------------------method_data_addressing--------------------------- |
367 Node* Parse::method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) { | 367 Node* Parse::method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) { |
368 // Get offset within MethodData* of the data array | 368 // Get offset within MethodData* of the data array |
390 //--------------------------increment_md_counter_at---------------------------- | 390 //--------------------------increment_md_counter_at---------------------------- |
391 void Parse::increment_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) { | 391 void Parse::increment_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) { |
392 Node* adr_node = method_data_addressing(md, data, counter_offset, idx, stride); | 392 Node* adr_node = method_data_addressing(md, data, counter_offset, idx, stride); |
393 | 393 |
394 const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); | 394 const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); |
395 Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type, MemNode::unordered); | 395 Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); |
396 Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(DataLayout::counter_increment))); | 396 Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(DataLayout::counter_increment))); |
397 store_to_memory(NULL, adr_node, incr, T_INT, adr_type, MemNode::unordered); | 397 store_to_memory(NULL, adr_node, incr, T_INT, adr_type ); |
398 } | 398 } |
399 | 399 |
400 //--------------------------test_for_osr_md_counter_at------------------------- | 400 //--------------------------test_for_osr_md_counter_at------------------------- |
401 void Parse::test_for_osr_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, int limit) { | 401 void Parse::test_for_osr_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, int limit) { |
402 Node* adr_node = method_data_addressing(md, data, counter_offset); | 402 Node* adr_node = method_data_addressing(md, data, counter_offset); |
403 | 403 |
404 const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); | 404 const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); |
405 Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type, MemNode::unordered); | 405 Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); |
406 | 406 |
407 test_counter_against_threshold(cnt, limit); | 407 test_counter_against_threshold(cnt, limit); |
408 } | 408 } |
409 | 409 |
410 //-------------------------------set_md_flag_at-------------------------------- | 410 //-------------------------------set_md_flag_at-------------------------------- |
411 void Parse::set_md_flag_at(ciMethodData* md, ciProfileData* data, int flag_constant) { | 411 void Parse::set_md_flag_at(ciMethodData* md, ciProfileData* data, int flag_constant) { |
412 Node* adr_node = method_data_addressing(md, data, DataLayout::flags_offset()); | 412 Node* adr_node = method_data_addressing(md, data, DataLayout::flags_offset()); |
413 | 413 |
414 const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); | 414 const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); |
415 Node* flags = make_load(NULL, adr_node, TypeInt::BYTE, T_BYTE, adr_type, MemNode::unordered); | 415 Node* flags = make_load(NULL, adr_node, TypeInt::BYTE, T_BYTE, adr_type); |
416 Node* incr = _gvn.transform(new (C) OrINode(flags, _gvn.intcon(flag_constant))); | 416 Node* incr = _gvn.transform(new (C) OrINode(flags, _gvn.intcon(flag_constant))); |
417 store_to_memory(NULL, adr_node, incr, T_BYTE, adr_type, MemNode::unordered); | 417 store_to_memory(NULL, adr_node, incr, T_BYTE, adr_type); |
418 } | 418 } |
419 | 419 |
420 //----------------------------profile_taken_branch----------------------------- | 420 //----------------------------profile_taken_branch----------------------------- |
421 void Parse::profile_taken_branch(int target_bci, bool force_update) { | 421 void Parse::profile_taken_branch(int target_bci, bool force_update) { |
422 // This is a potential osr_site if we have a backedge. | 422 // This is a potential osr_site if we have a backedge. |