< prev index next >

src/hotspot/share/opto/library_call.cpp

Print this page

4523   Node *lock_mask      = _gvn.MakeConX(markWord::lock_mask_in_place);
4524   Node *lmasked_header = _gvn.transform(new AndXNode(header, lock_mask));
4525   if (LockingMode == LM_LIGHTWEIGHT) {
4526     Node *monitor_val   = _gvn.MakeConX(markWord::monitor_value);
4527     Node *chk_monitor   = _gvn.transform(new CmpXNode(lmasked_header, monitor_val));
4528     Node *test_monitor  = _gvn.transform(new BoolNode(chk_monitor, BoolTest::eq));
4529 
4530     generate_slow_guard(test_monitor, slow_region);
4531   } else {
4532     Node *unlocked_val      = _gvn.MakeConX(markWord::unlocked_value);
4533     Node *chk_unlocked      = _gvn.transform(new CmpXNode(lmasked_header, unlocked_val));
4534     Node *test_not_unlocked = _gvn.transform(new BoolNode(chk_unlocked, BoolTest::ne));
4535 
4536     generate_slow_guard(test_not_unlocked, slow_region);
4537   }
4538 
4539   // Get the hash value and check to see that it has been properly assigned.
4540   // We depend on hash_mask being at most 32 bits and avoid the use of
4541   // hash_mask_in_place because it could be larger than 32 bits in a 64-bit
4542   // vm: see markWord.hpp.
4543   Node *hash_mask      = _gvn.intcon(markWord::hash_mask);
4544   Node *hash_shift     = _gvn.intcon(markWord::hash_shift);
4545   Node *hshifted_header= _gvn.transform(new URShiftXNode(header, hash_shift));
4546   // This hack lets the hash bits live anywhere in the mark object now, as long
4547   // as the shift drops the relevant bits into the low 32 bits.  Note that
4548   // Java spec says that HashCode is an int so there's no point in capturing
4549   // an 'X'-sized hashcode (32 in 32-bit build or 64 in 64-bit build).
4550   hshifted_header      = ConvX2I(hshifted_header);
4551   Node *hash_val       = _gvn.transform(new AndINode(hshifted_header, hash_mask));
4552 
4553   Node *no_hash_val    = _gvn.intcon(markWord::no_hash);
4554   Node *chk_assigned   = _gvn.transform(new CmpINode( hash_val, no_hash_val));
4555   Node *test_assigned  = _gvn.transform(new BoolNode( chk_assigned, BoolTest::eq));
4556 
4557   generate_slow_guard(test_assigned, slow_region);
4558 
4559   Node* init_mem = reset_memory();
4560   // fill in the rest of the null path:
4561   result_io ->init_req(_null_path, i_o());
4562   result_mem->init_req(_null_path, init_mem);
4563 
4564   result_val->init_req(_fast_path, hash_val);

4523   Node *lock_mask      = _gvn.MakeConX(markWord::lock_mask_in_place);
4524   Node *lmasked_header = _gvn.transform(new AndXNode(header, lock_mask));
4525   if (LockingMode == LM_LIGHTWEIGHT) {
4526     Node *monitor_val   = _gvn.MakeConX(markWord::monitor_value);
4527     Node *chk_monitor   = _gvn.transform(new CmpXNode(lmasked_header, monitor_val));
4528     Node *test_monitor  = _gvn.transform(new BoolNode(chk_monitor, BoolTest::eq));
4529 
4530     generate_slow_guard(test_monitor, slow_region);
4531   } else {
4532     Node *unlocked_val      = _gvn.MakeConX(markWord::unlocked_value);
4533     Node *chk_unlocked      = _gvn.transform(new CmpXNode(lmasked_header, unlocked_val));
4534     Node *test_not_unlocked = _gvn.transform(new BoolNode(chk_unlocked, BoolTest::ne));
4535 
4536     generate_slow_guard(test_not_unlocked, slow_region);
4537   }
4538 
4539   // Get the hash value and check to see that it has been properly assigned.
4540   // We depend on hash_mask being at most 32 bits and avoid the use of
4541   // hash_mask_in_place because it could be larger than 32 bits in a 64-bit
4542   // vm: see markWord.hpp.
4543   Node *hash_mask      = _gvn.intcon(UseCompactObjectHeaders ? markWord::hash_mask_compact  : markWord::hash_mask);
4544   Node *hash_shift     = _gvn.intcon(UseCompactObjectHeaders ? markWord::hash_shift_compact : markWord::hash_shift);
4545   Node *hshifted_header= _gvn.transform(new URShiftXNode(header, hash_shift));
4546   // This hack lets the hash bits live anywhere in the mark object now, as long
4547   // as the shift drops the relevant bits into the low 32 bits.  Note that
4548   // Java spec says that HashCode is an int so there's no point in capturing
4549   // an 'X'-sized hashcode (32 in 32-bit build or 64 in 64-bit build).
4550   hshifted_header      = ConvX2I(hshifted_header);
4551   Node *hash_val       = _gvn.transform(new AndINode(hshifted_header, hash_mask));
4552 
4553   Node *no_hash_val    = _gvn.intcon(markWord::no_hash);
4554   Node *chk_assigned   = _gvn.transform(new CmpINode( hash_val, no_hash_val));
4555   Node *test_assigned  = _gvn.transform(new BoolNode( chk_assigned, BoolTest::eq));
4556 
4557   generate_slow_guard(test_assigned, slow_region);
4558 
4559   Node* init_mem = reset_memory();
4560   // fill in the rest of the null path:
4561   result_io ->init_req(_null_path, i_o());
4562   result_mem->init_req(_null_path, init_mem);
4563 
4564   result_val->init_req(_fast_path, hash_val);
< prev index next >