< prev index next >

src/share/vm/c1/c1_GraphBuilder.cpp

Print this page




1523       assert(state()->locks_size() == 1, "receiver must be locked here");
1524       monitorexit(state()->lock_at(0), SynchronizationEntryBCI);
1525     }
1526 
1527     if (need_mem_bar) {
1528       append(new MemBar(lir_membar_storestore));
1529     }
1530 
1531     // State at end of inlined method is the state of the caller
1532     // without the method parameters on stack, including the
1533     // return value, if any, of the inlined method on operand stack.
1534     set_state(state()->caller_state()->copy_for_parsing());
1535     if (x != NULL) {
1536       if (!ignore_return) {
1537         state()->push(x->type(), x);
1538       }
1539       if (profile_return() && x->type()->is_object_kind()) {
1540         ciMethod* caller = state()->scope()->method();
1541         ciMethodData* md = caller->method_data_or_null();
1542         ciProfileData* data = md->bci_to_data(invoke_bci);
1543         if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
1544           bool has_return = data->is_CallTypeData() ? ((ciCallTypeData*)data)->has_return() : ((ciVirtualCallTypeData*)data)->has_return();
1545           // May not be true in case of an inlined call through a method handle intrinsic.
1546           if (has_return) {
1547             profile_return_type(x, method(), caller, invoke_bci);
1548           }
1549         }
1550       }
1551     }
1552     Goto* goto_callee = new Goto(continuation(), false);
1553 
1554     // See whether this is the first return; if so, store off some
1555     // of the state for later examination
1556     if (num_returns() == 0) {
1557       set_inline_cleanup_info();
1558     }
1559 
1560     // The current bci() is in the wrong scope, so use the bci() of
1561     // the continuation point.
1562     append_with_bci(goto_callee, scope_data()->continuation()->bci());
1563     incr_num_returns();
1564     return;
1565   }
1566 
1567   state()->truncate_stack(0);
1568   if (method()->is_synchronized()) {
1569     // perform the unlocking before exiting the method
1570     Value receiver;
1571     if (!method()->is_static()) {


4349   if (known_holder != NULL) {
4350     if (known_holder->exact_klass() == NULL) {
4351       known_holder = compilation()->cha_exact_type(known_holder);
4352     }
4353   }
4354 
4355   append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined));
4356 }
4357 
4358 void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m, int invoke_bci) {
4359   assert((m == NULL) == (invoke_bci < 0), "invalid method and invalid bci together");
4360   if (m == NULL) {
4361     m = method();
4362   }
4363   if (invoke_bci < 0) {
4364     invoke_bci = bci();
4365   }
4366   ciMethodData* md = m->method_data_or_null();
4367   ciProfileData* data = md->bci_to_data(invoke_bci);
4368   if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {


4369     append(new ProfileReturnType(m , invoke_bci, callee, ret));

4370   }
4371 }
4372 
4373 void GraphBuilder::profile_invocation(ciMethod* callee, ValueStack* state) {
4374   append(new ProfileInvoke(callee, state));
4375 }


1523       assert(state()->locks_size() == 1, "receiver must be locked here");
1524       monitorexit(state()->lock_at(0), SynchronizationEntryBCI);
1525     }
1526 
1527     if (need_mem_bar) {
1528       append(new MemBar(lir_membar_storestore));
1529     }
1530 
1531     // State at end of inlined method is the state of the caller
1532     // without the method parameters on stack, including the
1533     // return value, if any, of the inlined method on operand stack.
1534     set_state(state()->caller_state()->copy_for_parsing());
1535     if (x != NULL) {
1536       if (!ignore_return) {
1537         state()->push(x->type(), x);
1538       }
1539       if (profile_return() && x->type()->is_object_kind()) {
1540         ciMethod* caller = state()->scope()->method();
1541         ciMethodData* md = caller->method_data_or_null();
1542         ciProfileData* data = md->bci_to_data(invoke_bci);




1543         profile_return_type(x, method(), caller, invoke_bci);
1544       }
1545     }


1546     Goto* goto_callee = new Goto(continuation(), false);
1547 
1548     // See whether this is the first return; if so, store off some
1549     // of the state for later examination
1550     if (num_returns() == 0) {
1551       set_inline_cleanup_info();
1552     }
1553 
1554     // The current bci() is in the wrong scope, so use the bci() of
1555     // the continuation point.
1556     append_with_bci(goto_callee, scope_data()->continuation()->bci());
1557     incr_num_returns();
1558     return;
1559   }
1560 
1561   state()->truncate_stack(0);
1562   if (method()->is_synchronized()) {
1563     // perform the unlocking before exiting the method
1564     Value receiver;
1565     if (!method()->is_static()) {


4343   if (known_holder != NULL) {
4344     if (known_holder->exact_klass() == NULL) {
4345       known_holder = compilation()->cha_exact_type(known_holder);
4346     }
4347   }
4348 
4349   append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined));
4350 }
4351 
4352 void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m, int invoke_bci) {
4353   assert((m == NULL) == (invoke_bci < 0), "invalid method and invalid bci together");
4354   if (m == NULL) {
4355     m = method();
4356   }
4357   if (invoke_bci < 0) {
4358     invoke_bci = bci();
4359   }
4360   ciMethodData* md = m->method_data_or_null();
4361   ciProfileData* data = md->bci_to_data(invoke_bci);
4362   if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
4363     bool has_return = data->is_CallTypeData() ? ((ciCallTypeData*)data)->has_return() : ((ciVirtualCallTypeData*)data)->has_return();
4364     if (has_return) {
4365       append(new ProfileReturnType(m , invoke_bci, callee, ret));
4366     }
4367   }
4368 }
4369 
4370 void GraphBuilder::profile_invocation(ciMethod* callee, ValueStack* state) {
4371   append(new ProfileInvoke(callee, state));
4372 }
< prev index next >