comparison src/share/vm/opto/parse1.cpp @ 17810:62c54fcc0a35

Merge
author kvn
date Tue, 25 Mar 2014 17:07:36 -0700
parents 752ba2e5f6d0 606acabe7b5c
children 78bbf4d43a14
comparison
equal deleted inserted replaced
17809:a433eb716ce1 17810:62c54fcc0a35
562 set_map(entry_map); 562 set_map(entry_map);
563 load_interpreter_state(osr_buf); 563 load_interpreter_state(osr_buf);
564 } else { 564 } else {
565 set_map(entry_map); 565 set_map(entry_map);
566 do_method_entry(); 566 do_method_entry();
567 }
568 if (depth() == 1) {
569 // Add check to deoptimize the nmethod if RTM state was changed
570 rtm_deopt();
567 } 571 }
568 572
569 // Check for bailouts during method entry. 573 // Check for bailouts during method entry.
570 if (failing()) { 574 if (failing()) {
571 if (log) log->done("parse"); 575 if (log) log->done("parse");
1980 } 1984 }
1981 1985
1982 set_control( _gvn.transform(result_rgn) ); 1986 set_control( _gvn.transform(result_rgn) );
1983 } 1987 }
1984 1988
1989 // Add check to deoptimize if RTM state is not ProfileRTM
1990 void Parse::rtm_deopt() {
1991 #if INCLUDE_RTM_OPT
1992 if (C->profile_rtm()) {
1993 assert(C->method() != NULL, "only for normal compilations");
1994 assert(!C->method()->method_data()->is_empty(), "MDO is needed to record RTM state");
1995 assert(depth() == 1, "generate check only for main compiled method");
1996
1997 // Set starting bci for uncommon trap.
1998 set_parse_bci(is_osr_parse() ? osr_bci() : 0);
1999
2000 // Load the rtm_state from the MethodData.
2001 const TypePtr* adr_type = TypeMetadataPtr::make(C->method()->method_data());
2002 Node* mdo = makecon(adr_type);
2003 int offset = MethodData::rtm_state_offset_in_bytes();
2004 Node* adr_node = basic_plus_adr(mdo, mdo, offset);
2005 Node* rtm_state = make_load(control(), adr_node, TypeInt::INT, T_INT, adr_type, MemNode::unordered);
2006
2007 // Separate Load from Cmp by Opaque.
2008 // In expand_macro_nodes() it will be replaced either
2009 // with this load when there are locks in the code
2010 // or with ProfileRTM (cmp->in(2)) otherwise so that
2011 // the check will fold.
2012 Node* profile_state = makecon(TypeInt::make(ProfileRTM));
2013 Node* opq = _gvn.transform( new (C) Opaque3Node(C, rtm_state, Opaque3Node::RTM_OPT) );
2014 Node* chk = _gvn.transform( new (C) CmpINode(opq, profile_state) );
2015 Node* tst = _gvn.transform( new (C) BoolNode(chk, BoolTest::eq) );
2016 // Branch to failure if state was changed
2017 { BuildCutout unless(this, tst, PROB_ALWAYS);
2018 uncommon_trap(Deoptimization::Reason_rtm_state_change,
2019 Deoptimization::Action_make_not_entrant);
2020 }
2021 }
2022 #endif
2023 }
2024
1985 //------------------------------return_current--------------------------------- 2025 //------------------------------return_current---------------------------------
1986 // Append current _map to _exit_return 2026 // Append current _map to _exit_return
1987 void Parse::return_current(Node* value) { 2027 void Parse::return_current(Node* value) {
1988 if (RegisterFinalizersAtInit && 2028 if (RegisterFinalizersAtInit &&
1989 method()->intrinsic_id() == vmIntrinsics::_Object_init) { 2029 method()->intrinsic_id() == vmIntrinsics::_Object_init) {