comparison src/share/vm/opto/callnode.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 89152779163c 0bf37f737702
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
109 }; 109 };
110 110
111 #ifndef PRODUCT 111 #ifndef PRODUCT
112 void ParmNode::dump_spec(outputStream *st) const { 112 void ParmNode::dump_spec(outputStream *st) const {
113 if( _con < TypeFunc::Parms ) { 113 if( _con < TypeFunc::Parms ) {
114 st->print(names[_con]); 114 st->print("%s", names[_con]);
115 } else { 115 } else {
116 st->print("Parm%d: ",_con-TypeFunc::Parms); 116 st->print("Parm%d: ",_con-TypeFunc::Parms);
117 // Verbose and WizardMode dump bottom_type for all nodes 117 // Verbose and WizardMode dump bottom_type for all nodes
118 if( !Verbose && !WizardMode ) bottom_type()->dump_on(st); 118 if( !Verbose && !WizardMode ) bottom_type()->dump_on(st);
119 } 119 }
340 switch (t->base()) { 340 switch (t->base()) {
341 case Type::Int: 341 case Type::Int:
342 st->print(" %s%d]=#"INT32_FORMAT,msg,i,t->is_int()->get_con()); 342 st->print(" %s%d]=#"INT32_FORMAT,msg,i,t->is_int()->get_con());
343 break; 343 break;
344 case Type::AnyPtr: 344 case Type::AnyPtr:
345 assert( t == TypePtr::NULL_PTR, "" ); 345 assert( t == TypePtr::NULL_PTR || n->in_dump(), "" );
346 st->print(" %s%d]=#NULL",msg,i); 346 st->print(" %s%d]=#NULL",msg,i);
347 break; 347 break;
348 case Type::AryPtr: 348 case Type::AryPtr:
349 case Type::InstPtr: 349 case Type::InstPtr:
350 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->isa_oopptr()->const_oop()); 350 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->isa_oopptr()->const_oop()));
351 break; 351 break;
352 case Type::KlassPtr: 352 case Type::KlassPtr:
353 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_klassptr()->klass()); 353 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_klassptr()->klass()));
354 break; 354 break;
355 case Type::MetadataPtr: 355 case Type::MetadataPtr:
356 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_metadataptr()->metadata()); 356 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_metadataptr()->metadata()));
357 break; 357 break;
358 case Type::NarrowOop: 358 case Type::NarrowOop:
359 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_oopptr()->const_oop()); 359 st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_oopptr()->const_oop()));
360 break; 360 break;
361 case Type::RawPtr: 361 case Type::RawPtr:
362 st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,t->is_rawptr()); 362 st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,p2i(t->is_rawptr()));
363 break; 363 break;
364 case Type::DoubleCon: 364 case Type::DoubleCon:
365 st->print(" %s%d]=#%fD",msg,i,t->is_double_constant()->_d); 365 st->print(" %s%d]=#%fD",msg,i,t->is_double_constant()->_d);
366 break; 366 break;
367 case Type::FloatCon: 367 case Type::FloatCon:
368 st->print(" %s%d]=#%fF",msg,i,t->is_float_constant()->_f); 368 st->print(" %s%d]=#%fF",msg,i,t->is_float_constant()->_f);
369 break; 369 break;
370 case Type::Long: 370 case Type::Long:
371 st->print(" %s%d]=#"INT64_FORMAT,msg,i,t->is_long()->get_con()); 371 st->print(" %s%d]=#"INT64_FORMAT,msg,i,(int64_t)(t->is_long()->get_con()));
372 break; 372 break;
373 case Type::Half: 373 case Type::Half:
374 case Type::Top: 374 case Type::Top:
375 st->print(" %s%d]=_",msg,i); 375 st->print(" %s%d]=_",msg,i);
376 break; 376 break;
425 format_helper(regalloc, st, obj, obj_msg, i, &scobjs); 425 format_helper(regalloc, st, obj, obj_msg, i, &scobjs);
426 } 426 }
427 427
428 for (i = 0; i < (uint)scobjs.length(); i++) { 428 for (i = 0; i < (uint)scobjs.length(); i++) {
429 // Scalar replaced objects. 429 // Scalar replaced objects.
430 st->print_cr(""); 430 st->cr();
431 st->print(" # ScObj" INT32_FORMAT " ", i); 431 st->print(" # ScObj" INT32_FORMAT " ", i);
432 SafePointScalarObjectNode* spobj = scobjs.at(i); 432 SafePointScalarObjectNode* spobj = scobjs.at(i);
433 ciKlass* cik = spobj->bottom_type()->is_oopptr()->klass(); 433 ciKlass* cik = spobj->bottom_type()->is_oopptr()->klass();
434 assert(cik->is_instance_klass() || 434 assert(cik->is_instance_klass() ||
435 cik->is_array_klass(), "Not supported allocation."); 435 cik->is_array_klass(), "Not supported allocation.");
482 } 482 }
483 } 483 }
484 st->print(" }"); 484 st->print(" }");
485 } 485 }
486 } 486 }
487 st->print_cr(""); 487 st->cr();
488 if (caller() != NULL) caller()->format(regalloc, n, st); 488 if (caller() != NULL) caller()->format(regalloc, n, st);
489 } 489 }
490 490
491 491
492 void JVMState::dump_spec(outputStream *st) const { 492 void JVMState::dump_spec(outputStream *st) const {
591 */ 591 */
592 void JVMState::set_map_deep(SafePointNode* map) { 592 void JVMState::set_map_deep(SafePointNode* map) {
593 for (JVMState* p = this; p->_caller != NULL; p = p->_caller) { 593 for (JVMState* p = this; p->_caller != NULL; p = p->_caller) {
594 p->set_map(map); 594 p->set_map(map);
595 } 595 }
596 }
597
598 // Adapt offsets in in-array after adding or removing an edge.
599 // Prerequisite is that the JVMState is used by only one node.
600 void JVMState::adapt_position(int delta) {
601 for (JVMState* jvms = this; jvms != NULL; jvms = jvms->caller()) {
602 jvms->set_locoff(jvms->locoff() + delta);
603 jvms->set_stkoff(jvms->stkoff() + delta);
604 jvms->set_monoff(jvms->monoff() + delta);
605 jvms->set_scloff(jvms->scloff() + delta);
606 jvms->set_endoff(jvms->endoff() + delta);
607 }
608 }
609
610 // Mirror the stack size calculation in the deopt code
611 // How much stack space would we need at this point in the program in
612 // case of deoptimization?
613 int JVMState::interpreter_frame_size() const {
614 const JVMState* jvms = this;
615 int size = 0;
616 int callee_parameters = 0;
617 int callee_locals = 0;
618 int extra_args = method()->max_stack() - stk_size();
619
620 while (jvms != NULL) {
621 int locks = jvms->nof_monitors();
622 int temps = jvms->stk_size();
623 bool is_top_frame = (jvms == this);
624 ciMethod* method = jvms->method();
625
626 int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(),
627 temps + callee_parameters,
628 extra_args,
629 locks,
630 callee_parameters,
631 callee_locals,
632 is_top_frame);
633 size += frame_size;
634
635 callee_parameters = method->size_of_parameters();
636 callee_locals = method->max_locals();
637 extra_args = 0;
638 jvms = jvms->caller();
639 }
640 return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord;
596 } 641 }
597 642
598 //============================================================================= 643 //=============================================================================
599 uint CallNode::cmp( const Node &n ) const 644 uint CallNode::cmp( const Node &n ) const
600 { return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; } 645 { return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; }
885 int CallStaticJavaNode::extract_uncommon_trap_request(const Node* call) { 930 int CallStaticJavaNode::extract_uncommon_trap_request(const Node* call) {
886 #ifndef PRODUCT 931 #ifndef PRODUCT
887 if (!(call->req() > TypeFunc::Parms && 932 if (!(call->req() > TypeFunc::Parms &&
888 call->in(TypeFunc::Parms) != NULL && 933 call->in(TypeFunc::Parms) != NULL &&
889 call->in(TypeFunc::Parms)->is_Con())) { 934 call->in(TypeFunc::Parms)->is_Con())) {
890 assert(_in_dump_cnt != 0, "OK if dumping"); 935 assert(in_dump() != 0, "OK if dumping");
891 tty->print("[bad uncommon trap]"); 936 tty->print("[bad uncommon trap]");
892 return 0; 937 return 0;
893 } 938 }
894 #endif 939 #endif
895 return call->in(TypeFunc::Parms)->bottom_type()->is_int()->get_con(); 940 return call->in(TypeFunc::Parms)->bottom_type()->is_int()->get_con();
933 return CallNode::cmp(call) && !strcmp(_name,call._name); 978 return CallNode::cmp(call) && !strcmp(_name,call._name);
934 } 979 }
935 #ifndef PRODUCT 980 #ifndef PRODUCT
936 void CallRuntimeNode::dump_spec(outputStream *st) const { 981 void CallRuntimeNode::dump_spec(outputStream *st) const {
937 st->print("# "); 982 st->print("# ");
938 st->print(_name); 983 st->print("%s", _name);
939 CallNode::dump_spec(st); 984 CallNode::dump_spec(st);
940 } 985 }
941 #endif 986 #endif
942 987
943 //------------------------------calling_convention----------------------------- 988 //------------------------------calling_convention-----------------------------
951 996
952 //============================================================================= 997 //=============================================================================
953 #ifndef PRODUCT 998 #ifndef PRODUCT
954 void CallLeafNode::dump_spec(outputStream *st) const { 999 void CallLeafNode::dump_spec(outputStream *st) const {
955 st->print("# "); 1000 st->print("# ");
956 st->print(_name); 1001 st->print("%s", _name);
957 CallNode::dump_spec(st); 1002 CallNode::dump_spec(st);
958 } 1003 }
959 #endif 1004 #endif
960 1005
961 //============================================================================= 1006 //=============================================================================