Wed, 30 Jun 2010 11:52:10 -0400
Merge
src/share/vm/runtime/arguments.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/x86/vm/vm_version_x86.cpp Mon Jun 28 12:03:05 2010 -0400 1.2 +++ b/src/cpu/x86/vm/vm_version_x86.cpp Wed Jun 30 11:52:10 2010 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -34,7 +34,7 @@ 1.11 VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; 1.12 1.13 static BufferBlob* stub_blob; 1.14 -static const int stub_size = 300; 1.15 +static const int stub_size = 400; 1.16 1.17 extern "C" { 1.18 typedef void (*getPsrInfo_stub_t)(void*); 1.19 @@ -56,7 +56,7 @@ 1.20 const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT); 1.21 const uint32_t CPU_FAMILY_486 = (4 << CPU_FAMILY_SHIFT); 1.22 1.23 - Label detect_486, cpu486, detect_586, std_cpuid1; 1.24 + Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4; 1.25 Label ext_cpuid1, ext_cpuid5, done; 1.26 1.27 StubCodeMark mark(this, "VM_Version", "getPsrInfo_stub"); 1.28 @@ -131,13 +131,62 @@ 1.29 __ movl(Address(rsi, 8), rcx); 1.30 __ movl(Address(rsi,12), rdx); 1.31 1.32 - __ cmpl(rax, 3); // Is cpuid(0x4) supported? 1.33 - __ jccb(Assembler::belowEqual, std_cpuid1); 1.34 + __ cmpl(rax, 0xa); // Is cpuid(0xB) supported? 1.35 + __ jccb(Assembler::belowEqual, std_cpuid4); 1.36 + 1.37 + // 1.38 + // cpuid(0xB) Processor Topology 1.39 + // 1.40 + __ movl(rax, 0xb); 1.41 + __ xorl(rcx, rcx); // Threads level 1.42 + __ cpuid(); 1.43 + 1.44 + __ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB0_offset()))); 1.45 + __ movl(Address(rsi, 0), rax); 1.46 + __ movl(Address(rsi, 4), rbx); 1.47 + __ movl(Address(rsi, 8), rcx); 1.48 + __ movl(Address(rsi,12), rdx); 1.49 + 1.50 + __ movl(rax, 0xb); 1.51 + __ movl(rcx, 1); // Cores level 1.52 + __ cpuid(); 1.53 + __ push(rax); 1.54 + __ andl(rax, 0x1f); // Determine if valid topology level 1.55 + __ orl(rax, rbx); // eax[4:0] | ebx[0:15] == 0 indicates invalid level 1.56 + __ andl(rax, 0xffff); 1.57 + __ pop(rax); 1.58 + __ jccb(Assembler::equal, std_cpuid4); 1.59 + 1.60 + __ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB1_offset()))); 1.61 + __ movl(Address(rsi, 0), rax); 1.62 + __ movl(Address(rsi, 4), rbx); 1.63 + __ movl(Address(rsi, 8), rcx); 1.64 + __ movl(Address(rsi,12), rdx); 1.65 + 1.66 + __ movl(rax, 0xb); 1.67 + __ movl(rcx, 2); // Packages level 1.68 + __ cpuid(); 1.69 + __ push(rax); 1.70 + __ andl(rax, 0x1f); // Determine if valid topology level 1.71 + __ orl(rax, rbx); // eax[4:0] | ebx[0:15] == 0 indicates invalid level 1.72 + __ andl(rax, 0xffff); 1.73 + __ pop(rax); 1.74 + __ jccb(Assembler::equal, std_cpuid4); 1.75 + 1.76 + __ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB2_offset()))); 1.77 + __ movl(Address(rsi, 0), rax); 1.78 + __ movl(Address(rsi, 4), rbx); 1.79 + __ movl(Address(rsi, 8), rcx); 1.80 + __ movl(Address(rsi,12), rdx); 1.81 1.82 // 1.83 // cpuid(0x4) Deterministic cache params 1.84 // 1.85 + __ bind(std_cpuid4); 1.86 __ movl(rax, 4); 1.87 + __ cmpl(rax, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset()))); // Is cpuid(0x4) supported? 1.88 + __ jccb(Assembler::greater, std_cpuid1); 1.89 + 1.90 __ xorl(rcx, rcx); // L1 cache 1.91 __ cpuid(); 1.92 __ push(rax); 1.93 @@ -460,13 +509,18 @@ 1.94 AllocatePrefetchDistance = allocate_prefetch_distance(); 1.95 AllocatePrefetchStyle = allocate_prefetch_style(); 1.96 1.97 - if( AllocatePrefetchStyle == 2 && is_intel() && 1.98 - cpu_family() == 6 && supports_sse3() ) { // watermark prefetching on Core 1.99 + if( is_intel() && cpu_family() == 6 && supports_sse3() ) { 1.100 + if( AllocatePrefetchStyle == 2 ) { // watermark prefetching on Core 1.101 #ifdef _LP64 1.102 - AllocatePrefetchDistance = 384; 1.103 + AllocatePrefetchDistance = 384; 1.104 #else 1.105 - AllocatePrefetchDistance = 320; 1.106 + AllocatePrefetchDistance = 320; 1.107 #endif 1.108 + } 1.109 + if( supports_sse4_2() && supports_ht() ) { // Nehalem based cpus 1.110 + AllocatePrefetchDistance = 192; 1.111 + AllocatePrefetchLines = 4; 1.112 + } 1.113 } 1.114 assert(AllocatePrefetchDistance % AllocatePrefetchStepSize == 0, "invalid value"); 1.115
2.1 --- a/src/cpu/x86/vm/vm_version_x86.hpp Mon Jun 28 12:03:05 2010 -0400 2.2 +++ b/src/cpu/x86/vm/vm_version_x86.hpp Wed Jun 30 11:52:10 2010 -0400 2.3 @@ -1,5 +1,5 @@ 2.4 /* 2.5 - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 2.6 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All Rights Reserved. 2.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.8 * 2.9 * This code is free software; you can redistribute it and/or modify it 2.10 @@ -114,6 +114,14 @@ 2.11 } bits; 2.12 }; 2.13 2.14 + union TplCpuidBEbx { 2.15 + uint32_t value; 2.16 + struct { 2.17 + uint32_t logical_cpus : 16, 2.18 + : 16; 2.19 + } bits; 2.20 + }; 2.21 + 2.22 union ExtCpuid1Ecx { 2.23 uint32_t value; 2.24 struct { 2.25 @@ -211,6 +219,25 @@ 2.26 uint32_t dcp_cpuid4_ecx; // unused currently 2.27 uint32_t dcp_cpuid4_edx; // unused currently 2.28 2.29 + // cpuid function 0xB (processor topology) 2.30 + // ecx = 0 2.31 + uint32_t tpl_cpuidB0_eax; 2.32 + TplCpuidBEbx tpl_cpuidB0_ebx; 2.33 + uint32_t tpl_cpuidB0_ecx; // unused currently 2.34 + uint32_t tpl_cpuidB0_edx; // unused currently 2.35 + 2.36 + // ecx = 1 2.37 + uint32_t tpl_cpuidB1_eax; 2.38 + TplCpuidBEbx tpl_cpuidB1_ebx; 2.39 + uint32_t tpl_cpuidB1_ecx; // unused currently 2.40 + uint32_t tpl_cpuidB1_edx; // unused currently 2.41 + 2.42 + // ecx = 2 2.43 + uint32_t tpl_cpuidB2_eax; 2.44 + TplCpuidBEbx tpl_cpuidB2_ebx; 2.45 + uint32_t tpl_cpuidB2_ecx; // unused currently 2.46 + uint32_t tpl_cpuidB2_edx; // unused currently 2.47 + 2.48 // cpuid function 0x80000000 // example, unused 2.49 uint32_t ext_max_function; 2.50 uint32_t ext_vendor_name_0; 2.51 @@ -316,6 +343,9 @@ 2.52 static ByteSize ext_cpuid1_offset() { return byte_offset_of(CpuidInfo, ext_cpuid1_eax); } 2.53 static ByteSize ext_cpuid5_offset() { return byte_offset_of(CpuidInfo, ext_cpuid5_eax); } 2.54 static ByteSize ext_cpuid8_offset() { return byte_offset_of(CpuidInfo, ext_cpuid8_eax); } 2.55 + static ByteSize tpl_cpuidB0_offset() { return byte_offset_of(CpuidInfo, tpl_cpuidB0_eax); } 2.56 + static ByteSize tpl_cpuidB1_offset() { return byte_offset_of(CpuidInfo, tpl_cpuidB1_eax); } 2.57 + static ByteSize tpl_cpuidB2_offset() { return byte_offset_of(CpuidInfo, tpl_cpuidB2_eax); } 2.58 2.59 // Initialization 2.60 static void initialize(); 2.61 @@ -349,7 +379,12 @@ 2.62 static uint cores_per_cpu() { 2.63 uint result = 1; 2.64 if (is_intel()) { 2.65 - result = (_cpuid_info.dcp_cpuid4_eax.bits.cores_per_cpu + 1); 2.66 + if (_cpuid_info.std_max_function >= 0xB) { 2.67 + result = _cpuid_info.tpl_cpuidB1_ebx.bits.logical_cpus / 2.68 + _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus; 2.69 + } else { 2.70 + result = (_cpuid_info.dcp_cpuid4_eax.bits.cores_per_cpu + 1); 2.71 + } 2.72 } else if (is_amd()) { 2.73 result = (_cpuid_info.ext_cpuid8_ecx.bits.cores_per_cpu + 1); 2.74 } 2.75 @@ -358,7 +393,9 @@ 2.76 2.77 static uint threads_per_core() { 2.78 uint result = 1; 2.79 - if (_cpuid_info.std_cpuid1_edx.bits.ht != 0) { 2.80 + if (is_intel() && _cpuid_info.std_max_function >= 0xB) { 2.81 + result = _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus; 2.82 + } else if (_cpuid_info.std_cpuid1_edx.bits.ht != 0) { 2.83 result = _cpuid_info.std_cpuid1_ebx.bits.threads_per_cpu / 2.84 cores_per_cpu(); 2.85 }
3.1 --- a/src/share/vm/opto/cfgnode.cpp Mon Jun 28 12:03:05 2010 -0400 3.2 +++ b/src/share/vm/opto/cfgnode.cpp Wed Jun 30 11:52:10 2010 -0400 3.3 @@ -472,9 +472,7 @@ 3.4 assert( n->req() == 2 && n->in(1) != NULL, "Only one data input expected" ); 3.5 // Break dead loop data path. 3.6 // Eagerly replace phis with top to avoid phis copies generation. 3.7 - igvn->add_users_to_worklist(n); 3.8 - igvn->hash_delete(n); // Yank from hash before hacking edges 3.9 - igvn->subsume_node(n, top); 3.10 + igvn->replace_node(n, top); 3.11 if( max != outcnt() ) { 3.12 progress = true; 3.13 j = refresh_out_pos(j); 3.14 @@ -518,18 +516,17 @@ 3.15 igvn->hash_delete(n); // Remove from worklist before modifying edges 3.16 if( n->is_Phi() ) { // Collapse all Phis 3.17 // Eagerly replace phis to avoid copies generation. 3.18 - igvn->add_users_to_worklist(n); 3.19 - igvn->hash_delete(n); // Yank from hash before hacking edges 3.20 + Node* in; 3.21 if( cnt == 0 ) { 3.22 assert( n->req() == 1, "No data inputs expected" ); 3.23 - igvn->subsume_node(n, parent_ctrl); // replaced by top 3.24 + in = parent_ctrl; // replaced by top 3.25 } else { 3.26 assert( n->req() == 2 && n->in(1) != NULL, "Only one data input expected" ); 3.27 - Node* in1 = n->in(1); // replaced by unique input 3.28 - if( n->as_Phi()->is_unsafe_data_reference(in1) ) 3.29 - in1 = phase->C->top(); // replaced by top 3.30 - igvn->subsume_node(n, in1); 3.31 + in = n->in(1); // replaced by unique input 3.32 + if( n->as_Phi()->is_unsafe_data_reference(in) ) 3.33 + in = phase->C->top(); // replaced by top 3.34 } 3.35 + igvn->replace_node(n, in); 3.36 } 3.37 else if( n->is_Region() ) { // Update all incoming edges 3.38 assert( !igvn->eqv(n, this), "Must be removed from DefUse edges"); 3.39 @@ -2127,7 +2124,7 @@ 3.40 // if it's not there, there's nothing to do. 3.41 Node* fallthru = proj_out(0); 3.42 if (fallthru != NULL) { 3.43 - phase->is_IterGVN()->subsume_node(fallthru, in(0)); 3.44 + phase->is_IterGVN()->replace_node(fallthru, in(0)); 3.45 } 3.46 return phase->C->top(); 3.47 }
4.1 --- a/src/share/vm/opto/ifnode.cpp Mon Jun 28 12:03:05 2010 -0400 4.2 +++ b/src/share/vm/opto/ifnode.cpp Wed Jun 30 11:52:10 2010 -0400 4.3 @@ -1081,11 +1081,9 @@ 4.4 4.5 igvn->register_new_node_with_optimizer(new_if_f); 4.6 igvn->register_new_node_with_optimizer(new_if_t); 4.7 - igvn->hash_delete(old_if_f); 4.8 - igvn->hash_delete(old_if_t); 4.9 // Flip test, so flip trailing control 4.10 - igvn->subsume_node(old_if_f, new_if_t); 4.11 - igvn->subsume_node(old_if_t, new_if_f); 4.12 + igvn->replace_node(old_if_f, new_if_t); 4.13 + igvn->replace_node(old_if_t, new_if_f); 4.14 4.15 // Progress 4.16 return iff;
5.1 --- a/src/share/vm/opto/loopTransform.cpp Mon Jun 28 12:03:05 2010 -0400 5.2 +++ b/src/share/vm/opto/loopTransform.cpp Wed Jun 30 11:52:10 2010 -0400 5.3 @@ -194,8 +194,7 @@ 5.4 addx = new (phase->C, 3) AddINode(x, inv); 5.5 } 5.6 phase->register_new_node(addx, phase->get_ctrl(x)); 5.7 - phase->_igvn.hash_delete(n1); 5.8 - phase->_igvn.subsume_node(n1, addx); 5.9 + phase->_igvn.replace_node(n1, addx); 5.10 return addx; 5.11 } 5.12 5.13 @@ -1586,8 +1585,7 @@ 5.14 Node *phi = cl->phi(); 5.15 Node *final = new (phase->C, 3) SubINode( cl->limit(), cl->stride() ); 5.16 phase->register_new_node(final,cl->in(LoopNode::EntryControl)); 5.17 - phase->_igvn.hash_delete(phi); 5.18 - phase->_igvn.subsume_node(phi,final); 5.19 + phase->_igvn.replace_node(phi,final); 5.20 phase->C->set_major_progress(); 5.21 return true; 5.22 }
6.1 --- a/src/share/vm/opto/loopnode.cpp Mon Jun 28 12:03:05 2010 -0400 6.2 +++ b/src/share/vm/opto/loopnode.cpp Wed Jun 30 11:52:10 2010 -0400 6.3 @@ -400,7 +400,7 @@ 6.4 nphi->set_req(LoopNode::LoopBackControl, phi->in(LoopNode::LoopBackControl)); 6.5 nphi = _igvn.register_new_node_with_optimizer(nphi); 6.6 set_ctrl(nphi, get_ctrl(phi)); 6.7 - _igvn.subsume_node(phi, nphi); 6.8 + _igvn.replace_node(phi, nphi); 6.9 phi = nphi->as_Phi(); 6.10 } 6.11 cmp = cmp->clone(); 6.12 @@ -760,7 +760,7 @@ 6.13 // which in turn prevents removing an empty loop. 6.14 Node *id_old_phi = old_phi->Identity( &igvn ); 6.15 if( id_old_phi != old_phi ) { // Found a simple identity? 6.16 - // Note that I cannot call 'subsume_node' here, because 6.17 + // Note that I cannot call 'replace_node' here, because 6.18 // that will yank the edge from old_phi to the Region and 6.19 // I'm mid-iteration over the Region's uses. 6.20 for (DUIterator_Last imin, i = old_phi->last_outs(imin); i >= imin; ) { 6.21 @@ -1065,11 +1065,9 @@ 6.22 l = igvn.register_new_node_with_optimizer(l, _head); 6.23 phase->set_created_loop_node(); 6.24 // Go ahead and replace _head 6.25 - phase->_igvn.subsume_node( _head, l ); 6.26 + phase->_igvn.replace_node( _head, l ); 6.27 _head = l; 6.28 phase->set_loop(_head, this); 6.29 - for (DUIterator_Fast imax, i = l->fast_outs(imax); i < imax; i++) 6.30 - phase->_igvn.add_users_to_worklist(l->fast_out(i)); 6.31 } 6.32 6.33 // Now recursively beautify nested loops 6.34 @@ -1329,8 +1327,7 @@ 6.35 Node* add = new (C, 3) AddINode(ratio_idx, diff); 6.36 phase->_igvn.register_new_node_with_optimizer(add); 6.37 phase->set_ctrl(add, cl); 6.38 - phase->_igvn.hash_delete( phi2 ); 6.39 - phase->_igvn.subsume_node( phi2, add ); 6.40 + phase->_igvn.replace_node( phi2, add ); 6.41 // Sometimes an induction variable is unused 6.42 if (add->outcnt() == 0) { 6.43 phase->_igvn.remove_dead_node(add);
7.1 --- a/src/share/vm/opto/loopnode.hpp Mon Jun 28 12:03:05 2010 -0400 7.2 +++ b/src/share/vm/opto/loopnode.hpp Wed Jun 30 11:52:10 2010 -0400 7.3 @@ -626,8 +626,7 @@ 7.4 _nodes.map( old_node->_idx, (Node*)((intptr_t)new_node + 1) ); 7.5 } 7.6 void lazy_replace( Node *old_node, Node *new_node ) { 7.7 - _igvn.hash_delete(old_node); 7.8 - _igvn.subsume_node( old_node, new_node ); 7.9 + _igvn.replace_node( old_node, new_node ); 7.10 lazy_update( old_node, new_node ); 7.11 } 7.12 void lazy_replace_proj( Node *old_node, Node *new_node ) {
8.1 --- a/src/share/vm/opto/loopopts.cpp Mon Jun 28 12:03:05 2010 -0400 8.2 +++ b/src/share/vm/opto/loopopts.cpp Wed Jun 30 11:52:10 2010 -0400 8.3 @@ -354,8 +354,7 @@ 8.4 register_new_node( var_scale, n_ctrl ); 8.5 Node *var_add = new (C, 3) AddINode( var_scale, inv_scale ); 8.6 register_new_node( var_add, n_ctrl ); 8.7 - _igvn.hash_delete( n ); 8.8 - _igvn.subsume_node( n, var_add ); 8.9 + _igvn.replace_node( n, var_add ); 8.10 return var_add; 8.11 } 8.12 8.13 @@ -390,8 +389,7 @@ 8.14 register_new_node( add1, n_loop->_head->in(LoopNode::EntryControl) ); 8.15 Node *add2 = new (C, 4) AddPNode( n->in(1), add1, n->in(2)->in(3) ); 8.16 register_new_node( add2, n_ctrl ); 8.17 - _igvn.hash_delete( n ); 8.18 - _igvn.subsume_node( n, add2 ); 8.19 + _igvn.replace_node( n, add2 ); 8.20 return add2; 8.21 } 8.22 } 8.23 @@ -412,8 +410,7 @@ 8.24 register_new_node( add1, n_loop->_head->in(LoopNode::EntryControl) ); 8.25 Node *add2 = new (C, 4) AddPNode( n->in(1), add1, V ); 8.26 register_new_node( add2, n_ctrl ); 8.27 - _igvn.hash_delete( n ); 8.28 - _igvn.subsume_node( n, add2 ); 8.29 + _igvn.replace_node( n, add2 ); 8.30 return add2; 8.31 } 8.32 } 8.33 @@ -555,8 +552,7 @@ 8.34 } 8.35 Node *cmov = CMoveNode::make( C, cmov_ctrl, iff->in(1), phi->in(1+flip), phi->in(2-flip), _igvn.type(phi) ); 8.36 register_new_node( cmov, cmov_ctrl ); 8.37 - _igvn.hash_delete(phi); 8.38 - _igvn.subsume_node( phi, cmov ); 8.39 + _igvn.replace_node( phi, cmov ); 8.40 #ifndef PRODUCT 8.41 if( VerifyLoopOptimizations ) verify(); 8.42 #endif 8.43 @@ -642,8 +638,7 @@ 8.44 8.45 // Found a Phi to split thru! 8.46 // Replace 'n' with the new phi 8.47 - _igvn.hash_delete(n); 8.48 - _igvn.subsume_node( n, phi ); 8.49 + _igvn.replace_node( n, phi ); 8.50 // Moved a load around the loop, 'en-registering' something. 8.51 if( n_blk->Opcode() == Op_Loop && n->is_Load() && 8.52 !phi->in(LoopNode::LoopBackControl)->is_Load() ) 8.53 @@ -789,13 +784,11 @@ 8.54 8.55 // Found a Phi to split thru! 8.56 // Replace 'n' with the new phi 8.57 - _igvn.hash_delete(n); 8.58 - _igvn.subsume_node( n, phi ); 8.59 + _igvn.replace_node( n, phi ); 8.60 8.61 // Now split the bool up thru the phi 8.62 Node *bolphi = split_thru_phi( bol, n_ctrl, -1 ); 8.63 - _igvn.hash_delete(bol); 8.64 - _igvn.subsume_node( bol, bolphi ); 8.65 + _igvn.replace_node( bol, bolphi ); 8.66 assert( iff->in(1) == bolphi, "" ); 8.67 if( bolphi->Value(&_igvn)->singleton() ) 8.68 return; 8.69 @@ -803,8 +796,7 @@ 8.70 // Conditional-move? Must split up now 8.71 if( !iff->is_If() ) { 8.72 Node *cmovphi = split_thru_phi( iff, n_ctrl, -1 ); 8.73 - _igvn.hash_delete(iff); 8.74 - _igvn.subsume_node( iff, cmovphi ); 8.75 + _igvn.replace_node( iff, cmovphi ); 8.76 return; 8.77 } 8.78 8.79 @@ -950,9 +942,7 @@ 8.80 if( n_op == Op_Opaque2 && 8.81 n->in(1) != NULL && 8.82 get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) { 8.83 - _igvn.add_users_to_worklist(n); 8.84 - _igvn.hash_delete(n); 8.85 - _igvn.subsume_node( n, n->in(1) ); 8.86 + _igvn.replace_node( n, n->in(1) ); 8.87 } 8.88 } 8.89 8.90 @@ -1425,7 +1415,7 @@ 8.91 // IGVN does CSE). 8.92 Node *hit = _igvn.hash_find_insert(use); 8.93 if( hit ) // Go ahead and re-hash for hits. 8.94 - _igvn.subsume_node( use, hit ); 8.95 + _igvn.replace_node( use, hit ); 8.96 } 8.97 8.98 // If 'use' was in the loop-exit block, it now needs to be sunk
9.1 --- a/src/share/vm/opto/macro.cpp Mon Jun 28 12:03:05 2010 -0400 9.2 +++ b/src/share/vm/opto/macro.cpp Wed Jun 30 11:52:10 2010 -0400 9.3 @@ -135,8 +135,7 @@ 9.4 if (parm1 != NULL) call->init_req(TypeFunc::Parms+1, parm1); 9.5 copy_call_debug_info(oldcall, call); 9.6 call->set_cnt(PROB_UNLIKELY_MAG(4)); // Same effect as RC_UNCOMMON. 9.7 - _igvn.hash_delete(oldcall); 9.8 - _igvn.subsume_node(oldcall, call); 9.9 + _igvn.replace_node(oldcall, call); 9.10 transform_later(call); 9.11 9.12 return call; 9.13 @@ -523,8 +522,7 @@ 9.14 // Kill all new Phis 9.15 while(value_phis.is_nonempty()) { 9.16 Node* n = value_phis.node(); 9.17 - _igvn.hash_delete(n); 9.18 - _igvn.subsume_node(n, C->top()); 9.19 + _igvn.replace_node(n, C->top()); 9.20 value_phis.pop(); 9.21 } 9.22 } 9.23 @@ -1311,8 +1309,7 @@ 9.24 if (!always_slow) { 9.25 call->set_cnt(PROB_UNLIKELY_MAG(4)); // Same effect as RC_UNCOMMON. 9.26 } 9.27 - _igvn.hash_delete(alloc); 9.28 - _igvn.subsume_node(alloc, call); 9.29 + _igvn.replace_node(alloc, call); 9.30 transform_later(call); 9.31 9.32 // Identify the output projections from the allocate node and
10.1 --- a/src/share/vm/opto/phaseX.cpp Mon Jun 28 12:03:05 2010 -0400 10.2 +++ b/src/share/vm/opto/phaseX.cpp Wed Jun 30 11:52:10 2010 -0400 10.3 @@ -1447,16 +1447,12 @@ 10.4 Node* m = n->out(i); 10.5 if( m->is_Phi() ) { 10.6 assert(type(m) == Type::TOP, "Unreachable region should not have live phis."); 10.7 - add_users_to_worklist(m); 10.8 - hash_delete(m); // Yank from hash before hacking edges 10.9 - subsume_node(m, nn); 10.10 + replace_node(m, nn); 10.11 --i; // deleted this phi; rescan starting with next position 10.12 } 10.13 } 10.14 } 10.15 - add_users_to_worklist(n); // Users of about-to-be-constant 'n' 10.16 - hash_delete(n); // Removed 'n' from table before subsuming it 10.17 - subsume_node(n,nn); // Update DefUse edges for new constant 10.18 + replace_node(n,nn); // Update DefUse edges for new constant 10.19 } 10.20 return nn; 10.21 }
11.1 --- a/src/share/vm/opto/phaseX.hpp Mon Jun 28 12:03:05 2010 -0400 11.2 +++ b/src/share/vm/opto/phaseX.hpp Wed Jun 30 11:52:10 2010 -0400 11.3 @@ -393,6 +393,10 @@ 11.4 11.5 // Idealize old Node 'n' with respect to its inputs and its value 11.6 virtual Node *transform_old( Node *a_node ); 11.7 + 11.8 + // Subsume users of node 'old' into node 'nn' 11.9 + void subsume_node( Node *old, Node *nn ); 11.10 + 11.11 protected: 11.12 11.13 // Idealize new Node 'n' with respect to its inputs and its value 11.14 @@ -439,10 +443,6 @@ 11.15 remove_globally_dead_node(dead); 11.16 } 11.17 11.18 - // Subsume users of node 'old' into node 'nn' 11.19 - // If no Def-Use info existed for 'nn' it will after call. 11.20 - void subsume_node( Node *old, Node *nn ); 11.21 - 11.22 // Add users of 'n' to worklist 11.23 void add_users_to_worklist0( Node *n ); 11.24 void add_users_to_worklist ( Node *n ); 11.25 @@ -450,7 +450,7 @@ 11.26 // Replace old node with new one. 11.27 void replace_node( Node *old, Node *nn ) { 11.28 add_users_to_worklist(old); 11.29 - hash_delete(old); 11.30 + hash_delete(old); // Yank from hash before hacking edges 11.31 subsume_node(old, nn); 11.32 } 11.33
12.1 --- a/src/share/vm/opto/split_if.cpp Mon Jun 28 12:03:05 2010 -0400 12.2 +++ b/src/share/vm/opto/split_if.cpp Wed Jun 30 11:52:10 2010 -0400 12.3 @@ -217,8 +217,7 @@ 12.4 register_new_node(phi, blk1); 12.5 12.6 // Remove cloned-up value from optimizer; use phi instead 12.7 - _igvn.hash_delete(n); 12.8 - _igvn.subsume_node( n, phi ); 12.9 + _igvn.replace_node( n, phi ); 12.10 12.11 // (There used to be a self-recursive call to split_up() here, 12.12 // but it is not needed. All necessary forward walking is done 12.13 @@ -352,8 +351,7 @@ 12.14 } 12.15 12.16 if (use_blk == NULL) { // He's dead, Jim 12.17 - _igvn.hash_delete(use); 12.18 - _igvn.subsume_node(use, C->top()); 12.19 + _igvn.replace_node(use, C->top()); 12.20 } 12.21 12.22 return use_blk;
13.1 --- a/src/share/vm/opto/superword.cpp Mon Jun 28 12:03:05 2010 -0400 13.2 +++ b/src/share/vm/opto/superword.cpp Wed Jun 30 11:52:10 2010 -0400 13.3 @@ -1172,8 +1172,7 @@ 13.4 _phase->set_ctrl(vn, _phase->get_ctrl(p->at(0))); 13.5 for (uint j = 0; j < p->size(); j++) { 13.6 Node* pm = p->at(j); 13.7 - _igvn.hash_delete(pm); 13.8 - _igvn.subsume_node(pm, vn); 13.9 + _igvn.replace_node(pm, vn); 13.10 } 13.11 _igvn._worklist.push(vn); 13.12 }
14.1 --- a/src/share/vm/opto/type.cpp Mon Jun 28 12:03:05 2010 -0400 14.2 +++ b/src/share/vm/opto/type.cpp Wed Jun 30 11:52:10 2010 -0400 14.3 @@ -182,6 +182,8 @@ 14.4 return t->hash(); 14.5 } 14.6 14.7 +#define SMALLINT ((juint)3) // a value too insignificant to consider widening 14.8 + 14.9 //--------------------------Initialize_shared---------------------------------- 14.10 void Type::Initialize_shared(Compile* current) { 14.11 // This method does not need to be locked because the first system 14.12 @@ -240,6 +242,7 @@ 14.13 assert( TypeInt::CC_GT == TypeInt::ONE, "types must match for CmpL to work" ); 14.14 assert( TypeInt::CC_EQ == TypeInt::ZERO, "types must match for CmpL to work" ); 14.15 assert( TypeInt::CC_GE == TypeInt::BOOL, "types must match for CmpL to work" ); 14.16 + assert( (juint)(TypeInt::CC->_hi - TypeInt::CC->_lo) <= SMALLINT, "CC is truly small"); 14.17 14.18 TypeLong::MINUS_1 = TypeLong::make(-1); // -1 14.19 TypeLong::ZERO = TypeLong::make( 0); // 0 14.20 @@ -1054,16 +1057,21 @@ 14.21 return (TypeInt*)(new TypeInt(lo,lo,WidenMin))->hashcons(); 14.22 } 14.23 14.24 -#define SMALLINT ((juint)3) // a value too insignificant to consider widening 14.25 - 14.26 -const TypeInt *TypeInt::make( jint lo, jint hi, int w ) { 14.27 +static int normalize_int_widen( jint lo, jint hi, int w ) { 14.28 // Certain normalizations keep us sane when comparing types. 14.29 // The 'SMALLINT' covers constants and also CC and its relatives. 14.30 - assert(CC == NULL || (juint)(CC->_hi - CC->_lo) <= SMALLINT, "CC is truly small"); 14.31 if (lo <= hi) { 14.32 - if ((juint)(hi - lo) <= SMALLINT) w = Type::WidenMin; 14.33 - if ((juint)(hi - lo) >= max_juint) w = Type::WidenMax; // plain int 14.34 + if ((juint)(hi - lo) <= SMALLINT) w = Type::WidenMin; 14.35 + if ((juint)(hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT 14.36 + } else { 14.37 + if ((juint)(lo - hi) <= SMALLINT) w = Type::WidenMin; 14.38 + if ((juint)(lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT 14.39 } 14.40 + return w; 14.41 +} 14.42 + 14.43 +const TypeInt *TypeInt::make( jint lo, jint hi, int w ) { 14.44 + w = normalize_int_widen(lo, hi, w); 14.45 return (TypeInt*)(new TypeInt(lo,hi,w))->hashcons(); 14.46 } 14.47 14.48 @@ -1103,14 +1111,14 @@ 14.49 14.50 // Expand covered set 14.51 const TypeInt *r = t->is_int(); 14.52 - // (Avoid TypeInt::make, to avoid the argument normalizations it enforces.) 14.53 - return (new TypeInt( MIN2(_lo,r->_lo), MAX2(_hi,r->_hi), MAX2(_widen,r->_widen) ))->hashcons(); 14.54 + return make( MIN2(_lo,r->_lo), MAX2(_hi,r->_hi), MAX2(_widen,r->_widen) ); 14.55 } 14.56 14.57 //------------------------------xdual------------------------------------------ 14.58 // Dual: reverse hi & lo; flip widen 14.59 const Type *TypeInt::xdual() const { 14.60 - return new TypeInt(_hi,_lo,WidenMax-_widen); 14.61 + int w = normalize_int_widen(_hi,_lo, WidenMax-_widen); 14.62 + return new TypeInt(_hi,_lo,w); 14.63 } 14.64 14.65 //------------------------------widen------------------------------------------ 14.66 @@ -1202,7 +1210,7 @@ 14.67 //-----------------------------filter------------------------------------------ 14.68 const Type *TypeInt::filter( const Type *kills ) const { 14.69 const TypeInt* ft = join(kills)->isa_int(); 14.70 - if (ft == NULL || ft->_lo > ft->_hi) 14.71 + if (ft == NULL || ft->empty()) 14.72 return Type::TOP; // Canonical empty value 14.73 if (ft->_widen < this->_widen) { 14.74 // Do not allow the value of kill->_widen to affect the outcome. 14.75 @@ -1304,13 +1312,21 @@ 14.76 return (TypeLong*)(new TypeLong(lo,lo,WidenMin))->hashcons(); 14.77 } 14.78 14.79 +static int normalize_long_widen( jlong lo, jlong hi, int w ) { 14.80 + // Certain normalizations keep us sane when comparing types. 14.81 + // The 'SMALLINT' covers constants. 14.82 + if (lo <= hi) { 14.83 + if ((julong)(hi - lo) <= SMALLINT) w = Type::WidenMin; 14.84 + if ((julong)(hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG 14.85 + } else { 14.86 + if ((julong)(lo - hi) <= SMALLINT) w = Type::WidenMin; 14.87 + if ((julong)(lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG 14.88 + } 14.89 + return w; 14.90 +} 14.91 + 14.92 const TypeLong *TypeLong::make( jlong lo, jlong hi, int w ) { 14.93 - // Certain normalizations keep us sane when comparing types. 14.94 - // The '1' covers constants. 14.95 - if (lo <= hi) { 14.96 - if ((julong)(hi - lo) <= SMALLINT) w = Type::WidenMin; 14.97 - if ((julong)(hi - lo) >= max_julong) w = Type::WidenMax; // plain long 14.98 - } 14.99 + w = normalize_long_widen(lo, hi, w); 14.100 return (TypeLong*)(new TypeLong(lo,hi,w))->hashcons(); 14.101 } 14.102 14.103 @@ -1351,14 +1367,14 @@ 14.104 14.105 // Expand covered set 14.106 const TypeLong *r = t->is_long(); // Turn into a TypeLong 14.107 - // (Avoid TypeLong::make, to avoid the argument normalizations it enforces.) 14.108 - return (new TypeLong( MIN2(_lo,r->_lo), MAX2(_hi,r->_hi), MAX2(_widen,r->_widen) ))->hashcons(); 14.109 + return make( MIN2(_lo,r->_lo), MAX2(_hi,r->_hi), MAX2(_widen,r->_widen) ); 14.110 } 14.111 14.112 //------------------------------xdual------------------------------------------ 14.113 // Dual: reverse hi & lo; flip widen 14.114 const Type *TypeLong::xdual() const { 14.115 - return new TypeLong(_hi,_lo,WidenMax-_widen); 14.116 + int w = normalize_long_widen(_hi,_lo, WidenMax-_widen); 14.117 + return new TypeLong(_hi,_lo,w); 14.118 } 14.119 14.120 //------------------------------widen------------------------------------------ 14.121 @@ -1453,7 +1469,7 @@ 14.122 //-----------------------------filter------------------------------------------ 14.123 const Type *TypeLong::filter( const Type *kills ) const { 14.124 const TypeLong* ft = join(kills)->isa_long(); 14.125 - if (ft == NULL || ft->_lo > ft->_hi) 14.126 + if (ft == NULL || ft->empty()) 14.127 return Type::TOP; // Canonical empty value 14.128 if (ft->_widen < this->_widen) { 14.129 // Do not allow the value of kill->_widen to affect the outcome.
15.1 --- a/src/share/vm/runtime/arguments.cpp Mon Jun 28 12:03:05 2010 -0400 15.2 +++ b/src/share/vm/runtime/arguments.cpp Wed Jun 30 11:52:10 2010 -0400 15.3 @@ -1508,6 +1508,9 @@ 15.4 if (AggressiveOpts && FLAG_IS_DEFAULT(BiasedLockingStartupDelay)) { 15.5 FLAG_SET_DEFAULT(BiasedLockingStartupDelay, 500); 15.6 } 15.7 + if (AggressiveOpts && FLAG_IS_DEFAULT(OptimizeStringConcat)) { 15.8 + FLAG_SET_DEFAULT(OptimizeStringConcat, true); 15.9 + } 15.10 #endif 15.11 15.12 if (AggressiveOpts) {