src/share/vm/opto/callnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6934604 Cdiff src/share/vm/opto/callnode.cpp

src/share/vm/opto/callnode.cpp

Print this page

        

*** 521,540 **** if (caller() != NULL) caller()->dump_spec(st); } void JVMState::dump_on(outputStream* st) const { ! if (_map && !((uintptr_t)_map & 1)) { if (_map->len() > _map->req()) { // _map->has_exceptions() Node* ex = _map->in(_map->req()); // _map->next_exception() // skip the first one; it's already being printed while (ex != NULL && ex->len() > ex->req()) { ex = ex->in(ex->req()); // ex->next_exception() ex->dump(1); } } ! _map->dump(2); } st->print("JVMS depth=%d loc=%d stk=%d arg=%d mon=%d scalar=%d end=%d mondepth=%d sp=%d bci=%d reexecute=%s method=", depth(), locoff(), stkoff(), argoff(), monoff(), scloff(), endoff(), monitor_depth(), sp(), bci(), should_reexecute()?"true":"false"); if (_method == NULL) { st->print_cr("(none)"); --- 521,545 ---- if (caller() != NULL) caller()->dump_spec(st); } void JVMState::dump_on(outputStream* st) const { ! bool print_map = _map && !((uintptr_t)_map & 1) && ! ((caller() == NULL) || (caller()->map() != _map)); ! if (print_map) { if (_map->len() > _map->req()) { // _map->has_exceptions() Node* ex = _map->in(_map->req()); // _map->next_exception() // skip the first one; it's already being printed while (ex != NULL && ex->len() > ex->req()) { ex = ex->in(ex->req()); // ex->next_exception() ex->dump(1); } } ! _map->dump(Verbose ? 2 : 1); ! } ! if (caller() != NULL) { ! caller()->dump_on(st); } st->print("JVMS depth=%d loc=%d stk=%d arg=%d mon=%d scalar=%d end=%d mondepth=%d sp=%d bci=%d reexecute=%s method=", depth(), locoff(), stkoff(), argoff(), monoff(), scloff(), endoff(), monitor_depth(), sp(), bci(), should_reexecute()?"true":"false"); if (_method == NULL) { st->print_cr("(none)");
*** 544,556 **** if (bci() >= 0 && bci() < _method->code_size()) { st->print(" bc: "); _method->print_codes_on(bci(), bci()+1, st); } } - if (caller() != NULL) { - caller()->dump_on(st); - } } // Extra way to dump a jvms from the debugger, // to avoid a bug with C++ member function calls. void dump_jvms(JVMState* jvms) { --- 549,558 ----
*** 582,591 **** --- 584,600 ---- assert(n->depth() == depth(), "sanity"); assert(n->debug_depth() == debug_depth(), "sanity"); return n; } + //---------------------------clone_deep---------------------------------------- + void JVMState::set_map_deep(SafePointNode* map) { + for (JVMState* p = this; p->_caller != NULL; p = p->_caller) { + p->set_map(map); + } + } + //============================================================================= uint CallNode::cmp( const Node &n ) const { return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; } #ifndef PRODUCT void CallNode::dump_req(outputStream *st) const {
*** 661,681 **** // // Determine whether the call could modify the field of the specified // instance at the specified offset. // ! bool CallNode::may_modify(const TypePtr *addr_t, PhaseTransform *phase) { ! const TypeOopPtr *adrInst_t = addr_t->isa_oopptr(); ! ! // If not an OopPtr or not an instance type, assume the worst. ! // Note: currently this method is called only for instance types. ! if (adrInst_t == NULL || !adrInst_t->is_known_instance()) { ! return true; ! } // The instance_id is set only for scalar-replaceable allocations which // are not passed as arguments according to Escape Analysis. return false; } // Does this call have a direct reference to n other than debug information? bool CallNode::has_non_debug_use(Node *n) { const TypeTuple * d = tf()->domain(); --- 670,722 ---- // // Determine whether the call could modify the field of the specified // instance at the specified offset. // ! bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) { ! assert((t_oop != NULL), "sanity"); ! if (t_oop->is_known_instance()) { // The instance_id is set only for scalar-replaceable allocations which // are not passed as arguments according to Escape Analysis. return false; + } + if (t_oop->is_ptr_to_boxed_value()) { + ciKlass* boxing_klass = t_oop->klass(); + if (is_CallStaticJava() && as_CallStaticJava()->is_autoboxing()) { + // Skip unrelated boxing methods. + Node* proj = proj_out(TypeFunc::Parms); + if ((proj == NULL) || (phase->type(proj)->is_instptr()->klass() != boxing_klass)) { + return false; + } + } + if (is_CallJava() && as_CallJava()->method() != NULL) { + ciMethod* meth = as_CallJava()->method(); + if (meth->is_accessor()) { + return false; + } + // May modify (by reflection) if an boxing object is passed + // as argument or returned. + if (returns_pointer() && (proj_out(TypeFunc::Parms) != NULL)) { + Node* proj = proj_out(TypeFunc::Parms); + const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr(); + if ((inst_t != NULL) && (!inst_t->klass_is_exact() || + (inst_t->klass() == boxing_klass))) { + return true; + } + } + const TypeTuple* d = tf()->domain(); + for (uint i = TypeFunc::Parms; i < d->cnt(); i++) { + const TypeInstPtr* inst_t = d->field_at(i)->isa_instptr(); + if ((inst_t != NULL) && (!inst_t->klass_is_exact() || + (inst_t->klass() == boxing_klass))) { + return true; + } + } + return false; + } + } + return true; } // Does this call have a direct reference to n other than debug information? bool CallNode::has_non_debug_use(Node *n) { const TypeTuple * d = tf()->domain();
*** 1018,1027 **** --- 1059,1069 ---- assert((int)grow_by > 0, "sanity"); int monoff = jvms->monoff(); int scloff = jvms->scloff(); int endoff = jvms->endoff(); assert(endoff == (int)req(), "no other states or debug info after me"); + assert(jvms->scl_size() == 0, "parsed code should not have scalar objects"); Node* top = Compile::current()->top(); for (uint i = 0; i < grow_by; i++) { ins_req(monoff, top); } jvms->set_monoff(monoff + grow_by);
*** 1033,1042 **** --- 1075,1085 ---- // Add a LockNode, which points to both the original BoxLockNode (the // stack space for the monitor) and the Object being locked. const int MonitorEdges = 2; assert(JVMState::logMonitorEdges == exact_log2(MonitorEdges), "correct MonitorEdges"); assert(req() == jvms()->endoff(), "correct sizing"); + assert((jvms()->scl_size() == 0), "parsed code should not have scalar objects"); int nextmon = jvms()->scloff(); if (GenerateSynchronizationCode) { add_req(lock->box_node()); add_req(lock->obj_node()); } else {
*** 1048,1057 **** --- 1091,1101 ---- jvms()->set_endoff(req()); } void SafePointNode::pop_monitor() { // Delete last monitor from debug info + assert((jvms()->scl_size() == 0), "parsed code should not have scalar objects"); debug_only(int num_before_pop = jvms()->nof_monitors()); const int MonitorEdges = (1<<JVMState::logMonitorEdges); int scloff = jvms()->scloff(); int endoff = jvms()->endoff(); int new_scloff = scloff - MonitorEdges;
*** 1152,1161 **** --- 1196,1206 ---- : CallNode(atype, NULL, TypeRawPtr::BOTTOM) { init_class_id(Class_Allocate); init_flags(Flag_is_macro); _is_scalar_replaceable = false; + _is_non_escaping = false; Node *topnode = C->top(); init_req( TypeFunc::Control , ctrl ); init_req( TypeFunc::I_O , abio ); init_req( TypeFunc::Memory , mem );
*** 1167,1178 **** init_req( ALength , topnode); C->add_macro_node(this); } //============================================================================= - uint AllocateArrayNode::size_of() const { return sizeof(*this); } - Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) { if (remove_dead_region(phase, can_reshape)) return this; // Don't bother trying to transform a dead node if (in(0) && in(0)->is_top()) return NULL; --- 1212,1221 ----
*** 1233,1242 **** --- 1276,1287 ---- if (narrow_length_type != length_type) { // Assert one of: // - the narrow_length is 0 // - the narrow_length is not wider than length assert(narrow_length_type == TypeInt::ZERO || + length_type->is_con() && narrow_length_type->is_con() && + (narrow_length_type->_hi <= length_type->_lo) || (narrow_length_type->_hi <= length_type->_hi && narrow_length_type->_lo >= length_type->_lo), "narrow type must be narrower than length type"); // Return NULL if new nodes are not allowed
src/share/vm/opto/callnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File