< prev index next >

src/share/vm/c1/c1_GraphBuilder.cpp

Print this page




4210   append_split(result);
4211   push(result_type, result);
4212   compilation()->set_has_unsafe_access(true);
4213 }
4214 
4215 void GraphBuilder::append_char_access(ciMethod* callee, bool is_store) {
4216   // This intrinsic accesses byte[] array as char[] array. Computing the offsets
4217   // correctly requires matched array shapes.
4218   assert (arrayOopDesc::base_offset_in_bytes(T_CHAR) == arrayOopDesc::base_offset_in_bytes(T_BYTE),
4219           "sanity: byte[] and char[] bases agree");
4220   assert (type2aelembytes(T_CHAR) == type2aelembytes(T_BYTE)*2,
4221           "sanity: byte[] and char[] scales agree");
4222 
4223   ValueStack* state_before = copy_state_indexed_access();
4224   compilation()->set_has_access_indexed(true);
4225   Values* args = state()->pop_arguments(callee->arg_size());
4226   Value array = args->at(0);
4227   Value index = args->at(1);
4228   if (is_store) {
4229     Value value = args->at(2);
4230     Instruction* store = append(new StoreIndexed(array, index, NULL, T_CHAR, value, state_before, false));
4231     store->set_flag(Instruction::NeedsRangeCheckFlag, false);
4232     _memory->store_value(value);
4233   } else {
4234     Instruction* load = append(new LoadIndexed(array, index, NULL, T_CHAR, state_before));
4235     load->set_flag(Instruction::NeedsRangeCheckFlag, false);
4236     push(load->type(), load);
4237   }
4238 }
4239 
4240 void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) {
4241   CompileLog* log = compilation()->log();
4242   if (log != NULL) {
4243     if (success) {
4244       if (msg != NULL)
4245         log->inline_success(msg);
4246       else
4247         log->inline_success("receiver is statically known");
4248     } else {
4249       if (msg != NULL)
4250         log->inline_fail(msg);
4251       else
4252         log->inline_fail("reason unknown");
4253     }
4254   }




4210   append_split(result);
4211   push(result_type, result);
4212   compilation()->set_has_unsafe_access(true);
4213 }
4214 
4215 void GraphBuilder::append_char_access(ciMethod* callee, bool is_store) {
4216   // This intrinsic accesses byte[] array as char[] array. Computing the offsets
4217   // correctly requires matched array shapes.
4218   assert (arrayOopDesc::base_offset_in_bytes(T_CHAR) == arrayOopDesc::base_offset_in_bytes(T_BYTE),
4219           "sanity: byte[] and char[] bases agree");
4220   assert (type2aelembytes(T_CHAR) == type2aelembytes(T_BYTE)*2,
4221           "sanity: byte[] and char[] scales agree");
4222 
4223   ValueStack* state_before = copy_state_indexed_access();
4224   compilation()->set_has_access_indexed(true);
4225   Values* args = state()->pop_arguments(callee->arg_size());
4226   Value array = args->at(0);
4227   Value index = args->at(1);
4228   if (is_store) {
4229     Value value = args->at(2);
4230     Instruction* store = append(new StoreIndexed(array, index, NULL, T_CHAR, value, state_before, false, true));
4231     store->set_flag(Instruction::NeedsRangeCheckFlag, false);
4232     _memory->store_value(value);
4233   } else {
4234     Instruction* load = append(new LoadIndexed(array, index, NULL, T_CHAR, state_before, true));
4235     load->set_flag(Instruction::NeedsRangeCheckFlag, false);
4236     push(load->type(), load);
4237   }
4238 }
4239 
4240 void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) {
4241   CompileLog* log = compilation()->log();
4242   if (log != NULL) {
4243     if (success) {
4244       if (msg != NULL)
4245         log->inline_success(msg);
4246       else
4247         log->inline_success("receiver is statically known");
4248     } else {
4249       if (msg != NULL)
4250         log->inline_fail(msg);
4251       else
4252         log->inline_fail("reason unknown");
4253     }
4254   }


< prev index next >