comparison src/share/vm/opto/parse2.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 78bbf4d43a14
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1 /* 1 /*
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1998, 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.
48 const Type* elem = Type::TOP; 48 const Type* elem = Type::TOP;
49 Node* adr = array_addressing(elem_type, 0, &elem); 49 Node* adr = array_addressing(elem_type, 0, &elem);
50 if (stopped()) return; // guaranteed null or range check 50 if (stopped()) return; // guaranteed null or range check
51 dec_sp(2); // Pop array and index 51 dec_sp(2); // Pop array and index
52 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); 52 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
53 Node* ld = make_load(control(), adr, elem, elem_type, adr_type); 53 Node* ld = make_load(control(), adr, elem, elem_type, adr_type, MemNode::unordered);
54 push(ld); 54 push(ld);
55 } 55 }
56 56
57 57
58 //--------------------------------array_store---------------------------------- 58 //--------------------------------array_store----------------------------------
60 Node* adr = array_addressing(elem_type, 1); 60 Node* adr = array_addressing(elem_type, 1);
61 if (stopped()) return; // guaranteed null or range check 61 if (stopped()) return; // guaranteed null or range check
62 Node* val = pop(); 62 Node* val = pop();
63 dec_sp(2); // Pop array and index 63 dec_sp(2); // Pop array and index
64 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); 64 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type);
65 store_to_memory(control(), adr, val, elem_type, adr_type); 65 store_to_memory(control(), adr, val, elem_type, adr_type, StoreNode::release_if_reference(elem_type));
66 } 66 }
67 67
68 68
69 //------------------------------array_addressing------------------------------- 69 //------------------------------array_addressing-------------------------------
70 // Pull array and index from the stack. Compute pointer-to-element. 70 // Pull array and index from the stack. Compute pointer-to-element.
86 if (el && el->isa_instptr()) { 86 if (el && el->isa_instptr()) {
87 const TypeInstPtr* toop = el->is_instptr(); 87 const TypeInstPtr* toop = el->is_instptr();
88 if (toop->klass()->as_instance_klass()->unique_concrete_subklass()) { 88 if (toop->klass()->as_instance_klass()->unique_concrete_subklass()) {
89 // If we load from "AbstractClass[]" we must see "ConcreteSubClass". 89 // If we load from "AbstractClass[]" we must see "ConcreteSubClass".
90 const Type* subklass = Type::get_const_type(toop->klass()); 90 const Type* subklass = Type::get_const_type(toop->klass());
91 elemtype = subklass->join(el); 91 elemtype = subklass->join_speculative(el);
92 } 92 }
93 } 93 }
94 } 94 }
95 95
96 // Check for big class initializers with all constant offsets 96 // Check for big class initializers with all constant offsets
624 } 624 }
625 tty->print(">>> "); 625 tty->print(">>> ");
626 _method->print_short_name(); 626 _method->print_short_name();
627 tty->print_cr(" switch decision tree"); 627 tty->print_cr(" switch decision tree");
628 tty->print_cr(" %d ranges (%d singletons), max_depth=%d, est_depth=%d", 628 tty->print_cr(" %d ranges (%d singletons), max_depth=%d, est_depth=%d",
629 hi-lo+1, nsing, _max_switch_depth, _est_switch_depth); 629 (int) (hi-lo+1), nsing, _max_switch_depth, _est_switch_depth);
630 if (_max_switch_depth > _est_switch_depth) { 630 if (_max_switch_depth > _est_switch_depth) {
631 tty->print_cr("******** BAD SWITCH DEPTH ********"); 631 tty->print_cr("******** BAD SWITCH DEPTH ********");
632 } 632 }
633 tty->print(" "); 633 tty->print(" ");
634 for( r = lo; r <= hi; r++ ) { 634 for( r = lo; r <= hi; r++ ) {
635 r->print(); 635 r->print();
636 } 636 }
637 tty->print_cr(""); 637 tty->cr();
638 } 638 }
639 #endif 639 #endif
640 } 640 }
641 641
642 void Parse::modf() { 642 void Parse::modf() {
1276 if (obj != NULL && (con_type->isa_instptr() || con_type->isa_aryptr())) { 1276 if (obj != NULL && (con_type->isa_instptr() || con_type->isa_aryptr())) {
1277 // Found: 1277 // Found:
1278 // Bool(CmpP(LoadKlass(obj._klass), ConP(Foo.klass)), [eq]) 1278 // Bool(CmpP(LoadKlass(obj._klass), ConP(Foo.klass)), [eq])
1279 // or the narrowOop equivalent. 1279 // or the narrowOop equivalent.
1280 const Type* obj_type = _gvn.type(obj); 1280 const Type* obj_type = _gvn.type(obj);
1281 const TypeOopPtr* tboth = obj_type->join(con_type)->isa_oopptr(); 1281 const TypeOopPtr* tboth = obj_type->join_speculative(con_type)->isa_oopptr();
1282 if (tboth != NULL && tboth->klass_is_exact() && tboth != obj_type && 1282 if (tboth != NULL && tboth->klass_is_exact() && tboth != obj_type &&
1283 tboth->higher_equal(obj_type)) { 1283 tboth->higher_equal(obj_type)) {
1284 // obj has to be of the exact type Foo if the CmpP succeeds. 1284 // obj has to be of the exact type Foo if the CmpP succeeds.
1285 int obj_in_map = map()->find_edge(obj); 1285 int obj_in_map = map()->find_edge(obj);
1286 JVMState* jvms = this->jvms(); 1286 JVMState* jvms = this->jvms();
1287 if (obj_in_map >= 0 && 1287 if (obj_in_map >= 0 &&
1288 (jvms->is_loc(obj_in_map) || jvms->is_stk(obj_in_map))) { 1288 (jvms->is_loc(obj_in_map) || jvms->is_stk(obj_in_map))) {
1289 TypeNode* ccast = new (C) CheckCastPPNode(control(), obj, tboth); 1289 TypeNode* ccast = new (C) CheckCastPPNode(control(), obj, tboth);
1290 const Type* tcc = ccast->as_Type()->type(); 1290 const Type* tcc = ccast->as_Type()->type();
1291 assert(tcc != obj_type && tcc->higher_equal(obj_type), "must improve"); 1291 assert(tcc != obj_type && tcc->higher_equal_speculative(obj_type), "must improve");
1292 // Delay transform() call to allow recovery of pre-cast value 1292 // Delay transform() call to allow recovery of pre-cast value
1293 // at the control merge. 1293 // at the control merge.
1294 _gvn.set_type_bottom(ccast); 1294 _gvn.set_type_bottom(ccast);
1295 record_for_igvn(ccast); 1295 record_for_igvn(ccast);
1296 // Here's the payoff. 1296 // Here's the payoff.
1316 Node* cast = NULL; 1316 Node* cast = NULL;
1317 1317
1318 switch (btest) { 1318 switch (btest) {
1319 case BoolTest::eq: // Constant test? 1319 case BoolTest::eq: // Constant test?
1320 { 1320 {
1321 const Type* tboth = tcon->join(tval); 1321 const Type* tboth = tcon->join_speculative(tval);
1322 if (tboth == tval) break; // Nothing to gain. 1322 if (tboth == tval) break; // Nothing to gain.
1323 if (tcon->isa_int()) { 1323 if (tcon->isa_int()) {
1324 ccast = new (C) CastIINode(val, tboth); 1324 ccast = new (C) CastIINode(val, tboth);
1325 } else if (tcon == TypePtr::NULL_PTR) { 1325 } else if (tcon == TypePtr::NULL_PTR) {
1326 // Cast to null, but keep the pointer identity temporarily live. 1326 // Cast to null, but keep the pointer identity temporarily live.
1350 break; 1350 break;
1351 } 1351 }
1352 1352
1353 if (ccast != NULL) { 1353 if (ccast != NULL) {
1354 const Type* tcc = ccast->as_Type()->type(); 1354 const Type* tcc = ccast->as_Type()->type();
1355 assert(tcc != tval && tcc->higher_equal(tval), "must improve"); 1355 assert(tcc != tval && tcc->higher_equal_speculative(tval), "must improve");
1356 // Delay transform() call to allow recovery of pre-cast value 1356 // Delay transform() call to allow recovery of pre-cast value
1357 // at the control merge. 1357 // at the control merge.
1358 ccast->set_req(0, control()); 1358 ccast->set_req(0, control());
1359 _gvn.set_type_bottom(ccast); 1359 _gvn.set_type_bottom(ccast);
1360 record_for_igvn(ccast); 1360 record_for_igvn(ccast);
1718 case Bytecodes::_aaload: array_load(T_OBJECT); break; 1718 case Bytecodes::_aaload: array_load(T_OBJECT); break;
1719 case Bytecodes::_laload: { 1719 case Bytecodes::_laload: {
1720 a = array_addressing(T_LONG, 0); 1720 a = array_addressing(T_LONG, 0);
1721 if (stopped()) return; // guaranteed null or range check 1721 if (stopped()) return; // guaranteed null or range check
1722 dec_sp(2); // Pop array and index 1722 dec_sp(2); // Pop array and index
1723 push_pair(make_load(control(), a, TypeLong::LONG, T_LONG, TypeAryPtr::LONGS)); 1723 push_pair(make_load(control(), a, TypeLong::LONG, T_LONG, TypeAryPtr::LONGS, MemNode::unordered));
1724 break; 1724 break;
1725 } 1725 }
1726 case Bytecodes::_daload: { 1726 case Bytecodes::_daload: {
1727 a = array_addressing(T_DOUBLE, 0); 1727 a = array_addressing(T_DOUBLE, 0);
1728 if (stopped()) return; // guaranteed null or range check 1728 if (stopped()) return; // guaranteed null or range check
1729 dec_sp(2); // Pop array and index 1729 dec_sp(2); // Pop array and index
1730 push_pair(make_load(control(), a, Type::DOUBLE, T_DOUBLE, TypeAryPtr::DOUBLES)); 1730 push_pair(make_load(control(), a, Type::DOUBLE, T_DOUBLE, TypeAryPtr::DOUBLES, MemNode::unordered));
1731 break; 1731 break;
1732 } 1732 }
1733 case Bytecodes::_bastore: array_store(T_BYTE); break; 1733 case Bytecodes::_bastore: array_store(T_BYTE); break;
1734 case Bytecodes::_castore: array_store(T_CHAR); break; 1734 case Bytecodes::_castore: array_store(T_CHAR); break;
1735 case Bytecodes::_iastore: array_store(T_INT); break; 1735 case Bytecodes::_iastore: array_store(T_INT); break;
1742 c = pop(); // Oop to store 1742 c = pop(); // Oop to store
1743 b = pop(); // index (already used) 1743 b = pop(); // index (already used)
1744 a = pop(); // the array itself 1744 a = pop(); // the array itself
1745 const TypeOopPtr* elemtype = _gvn.type(a)->is_aryptr()->elem()->make_oopptr(); 1745 const TypeOopPtr* elemtype = _gvn.type(a)->is_aryptr()->elem()->make_oopptr();
1746 const TypeAryPtr* adr_type = TypeAryPtr::OOPS; 1746 const TypeAryPtr* adr_type = TypeAryPtr::OOPS;
1747 Node* store = store_oop_to_array(control(), a, d, adr_type, c, elemtype, T_OBJECT); 1747 Node* store = store_oop_to_array(control(), a, d, adr_type, c, elemtype, T_OBJECT, MemNode::release);
1748 break; 1748 break;
1749 } 1749 }
1750 case Bytecodes::_lastore: { 1750 case Bytecodes::_lastore: {
1751 a = array_addressing(T_LONG, 2); 1751 a = array_addressing(T_LONG, 2);
1752 if (stopped()) return; // guaranteed null or range check 1752 if (stopped()) return; // guaranteed null or range check
1753 c = pop_pair(); 1753 c = pop_pair();
1754 dec_sp(2); // Pop array and index 1754 dec_sp(2); // Pop array and index
1755 store_to_memory(control(), a, c, T_LONG, TypeAryPtr::LONGS); 1755 store_to_memory(control(), a, c, T_LONG, TypeAryPtr::LONGS, MemNode::unordered);
1756 break; 1756 break;
1757 } 1757 }
1758 case Bytecodes::_dastore: { 1758 case Bytecodes::_dastore: {
1759 a = array_addressing(T_DOUBLE, 2); 1759 a = array_addressing(T_DOUBLE, 2);
1760 if (stopped()) return; // guaranteed null or range check 1760 if (stopped()) return; // guaranteed null or range check
1761 c = pop_pair(); 1761 c = pop_pair();
1762 dec_sp(2); // Pop array and index 1762 dec_sp(2); // Pop array and index
1763 c = dstore_rounding(c); 1763 c = dstore_rounding(c);
1764 store_to_memory(control(), a, c, T_DOUBLE, TypeAryPtr::DOUBLES); 1764 store_to_memory(control(), a, c, T_DOUBLE, TypeAryPtr::DOUBLES, MemNode::unordered);
1765 break; 1765 break;
1766 } 1766 }
1767 case Bytecodes::_getfield: 1767 case Bytecodes::_getfield:
1768 do_getfield(); 1768 do_getfield();
1769 break; 1769 break;