From Vladimir.Kozlov at Sun.COM Mon Mar 3 09:33:48 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 03 Mar 2008 09:33:48 -0800 Subject: Request for reviews (S): 6670459: Fix Node::dump() performance Message-ID: <47CC367C.5070200@sun.com> http://webrev.invokedynamic.info/kvn/6670459/index.html Fixed 6670459: Fix Node::dump() performance Problem: The fix for 6614330 introduced a performance problem in Node::dump() - a dump of whole Ideal graph takes forever. Solution: I replaced depth-first iteration with breadth-first. The code is very simple and fast. But I had to remove Ross's search for loops (which don't have phis and regions). I also fxied the old bug: Node_Stack.size() incorrectly returns big number instead of 0 when it is empty. Reviewed by: Fix verified (y/n): y, failed test case. Other testing: PRT From Vladimir.Kozlov at Sun.COM Tue Mar 4 17:52:51 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Tue, 04 Mar 2008 17:52:51 -0800 Subject: Request for reviews (S): 6671250: In Parse::do_if() old Cmp node 'c' should be replaced with new one after BoolNode transformation. Message-ID: <47CDFCF3.8000109@sun.com> http://webrev.invokedynamic.info/kvn/6671250/index.html Fixed 6671250: In Parse::do_if() old Cmp node 'c' should be replaced with new one after BoolNode transformation. Problem: In Parse::do_if() 'c' (CmpNode) node may be changed during BoolNode transformation so 'c' may became dead but the node is referenced later in the code. Solution: 'c' should be replaced with new node after BoolNode transformation. Reviewed by: Fix verified (y/n): y Other testing: PRT From Vladimir.Kozlov at Sun.COM Wed Mar 5 09:47:14 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Wed, 05 Mar 2008 09:47:14 -0800 Subject: Request for reviews first part EA update (M): 6667605, 6667610, 6667612, 6667615, 6667620 In-Reply-To: <47C76F22.2080803@sun.com> References: <47C76F22.2080803@sun.com> Message-ID: <47CEDCA2.4010407@sun.com> The changes passed JPRT with EA on. Also I was concern about 6667605 when constructors are inlinined even when they were called only one time. I ran refworkload and there is no regression. Note, that without this we lose about half cases in jbb, and monte_carlo, of cause. Thanks, Vladimir Vladimir Kozlov wrote: > Here are first changes for Escape Analysis. > This is a preparation for the EA scalar replacement optimization > and problems fixes. > > It passed PRT with EA switched off (current default). > I will run tonight with EA on. > > Thanks, > Vladimir > > -------------------------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6667605/index.html > > Fixed 6667605: Escape Analysis: always inline java constructors with EA > > Problem: > A java constructor should be inlined to scalar replace the allocation > with EA. > > Solution: > Inline Java constructors when EA is on. > Also replace duplicated code in PhaseGVN::transform() with the call > to transform_no_reclaim(n) (I want to do this for several years already > :) ). > > -------------------------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6667610/index.html > > Fixed 6667610: Escape Analysis: retry compilation without EA if it fails > > Problem: > During split unique types EA could exceed nodes limit and fail the > method compilation. > > Solution: > Retry the compilation without EA. > > -------------------------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6667612/index.html > > Fixed 6667612: Escape Analysis: disable loop cloning if it has a scalar > replaceable allocation > > Problem: > Cloning an allocation will not allow scalar replacement since memory > operations > could not be associated with one allocation, the unique type data is > invalid > after such cloning. > > Solution: > Do not clone a loop with a scalar replaceable allocation > Also use 1 instead of 'true' for bitfields assignment. > > -------------------------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6667615/index.html > > Fixed 6667615: Escape Analysis: extend MDO to cache arguments escape state > > Problem: > EA uses byte code escape analyzer to determine the escape state of > allocations passed > as arguments to a not inlined call. bcEscapeAnalyzer looks recursively > on the method's > bytecode and bytecode of called methods. It is expensive to do this in > each call site. > > Solution: > Use MDO to cache arguments escape state. > > -------------------------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6667620/index.html > > Fixed 6667620: Escape Analysis: fix deoptimization for scalar replaced > objects > > Problem: > Deoptimization code for reallocation and relocking > scalar replaced objects has to be fixed. From Vladimir.Kozlov at Sun.COM Fri Mar 7 11:10:21 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Fri, 07 Mar 2008 11:10:21 -0800 Subject: Request for review (L): 6671807: Escape Analysis: Add new ideal node to represent the state of a scalarized object at a safepoint Message-ID: <47D1931D.7080605@sun.com> http://webrev.invokedynamic.info/kvn/6671807/index.html Fixed 6671807: Escape Analysis: Add new ideal node to represent the state of a scalarized object at a safepoint Problem: To reallocate a scalarized object during a deoptimization we need to know the state (values) of object's non-static fields at a safepoint. Solution: Add new ideal node SafePointScalarObjectNode to represent the state of a scalarized object at a safepoint. It describes additional input edges (starting and count) in the safepoint node to which it is attached. SafePointScalarObjectNode nodes will be created for each safepoint nodes which reference the original scalar replaced allocation (this code will be added in next changes). Thanks, Vladimir From Vladimir.Kozlov at Sun.COM Fri Mar 7 15:47:58 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Fri, 07 Mar 2008 15:47:58 -0800 Subject: Request for reviews (S): 6672848: Escape Analysis: improve lock elimination with EA Message-ID: <47D1D42E.5010000@sun.com> http://webrev.invokedynamic.info/kvn/6672848/index.html Fixed 6672848: Escape Analysis: improve lock elimination with EA Problem: Improve locks elimination based on an allocation escape state from EA. Solution: Remove MemBar nodes associated with elided lock/unlock nodes and specify in debug info which locks should be restored during deoptimization. Thanks, Vladimir From Vladimir.Kozlov at Sun.COM Mon Mar 10 16:53:13 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 10 Mar 2008 15:53:13 -0800 Subject: Request for reviews (M): 6673473: Escape Analysis: Add the instance's field information to PhiNode Message-ID: <47D5C9E9.9070201@sun.com> http://webrev.invokedynamic.info/kvn/6673473/index.html Fixed 6673473: Escape Analysis: Add the instance's field information to PhiNode Problem: Phi nodes are generated when needed to represent instance's fields values for a scalar replacement of an allocation. They are generated during memory optimization by using split_through_phi optimization. It creates a problem when we do this for a loop's Phi since there is no a guard against infinite (for each optimization path for the loop) generation of such value Phi nodes. Solution: Add the instance's field information to PhiNode to reuse the same value Phi. Also additional (needed for EA) fixes in touched files: 1. Fix TypeAryPtr::xmeet() and dump2() methods for array instances. 2. Move the code in MemNode::Ideal_common() to the separate method step_through_mergemem() which will be used in the next EA changes. 3. Replace incorrect assert (static calls are not only runtime calls) in MemNode::Ideal_DU_postCCP() with more precise asserts. 4. Fix the assert in MergeMemNode::Ideal() to allow duplicated references when the transformation is still in 'progress'. Reviewed by: Fix verified (y/n): y Other testing: JPRT From Vladimir.Kozlov at Sun.COM Mon Mar 10 17:36:46 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 10 Mar 2008 16:36:46 -0800 Subject: Request for reviews (s): 6623167: C2 crashed in StoreCMNode::Value Message-ID: <47D5D41E.8050403@sun.com> http://webrev.invokedynamic.info/kvn/6623167/index.html Fixed 6623167: C2 crashed in StoreCMNode::Value Problem: C2 crashed in StoreCMNode::Value since in(MemNode::OopStore) is 0. The node, it seems, is dead since it's inputs are control(0),mem(top),adr(0),val(0),oopst(0) Solution: Check memory and other inputs first. Note: it is the fix from HS10 and HS11. Reviewed by: Fix verified (y/n): y Other testing: JPRT From Vladimir.Kozlov at Sun.COM Tue Mar 11 12:36:51 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Tue, 11 Mar 2008 11:36:51 -0800 Subject: Need reviews for 6671807, 6672848, 6673473 Message-ID: <47D6DF53.1060101@sun.com> Only 3 left :) Thanks, Vladimir ---------------------------------------------------------------------------- http://webrev.invokedynamic.info/kvn/6672848/index.html Fixed 6672848: Escape Analysis: improve lock elimination with EA Problem: Improve locks elimination based on an allocation escape state from EA. Solution: Remove MemBar nodes associated with elided lock/unlock nodes and specify in debug info which locks should be restored during deoptimization. ---------------------------------------------------------------------------- http://webrev.invokedynamic.info/kvn/6671807/index.html Fixed 6671807: Escape Analysis: Add new ideal node to represent the state of a scalarized object at a safepoint Problem: To reallocate a scalarized object during a deoptimization we need to know the state (values) of object's non-static fields at a safepoint. Solution: Add new ideal node SafePointScalarObjectNode to represent the state of a scalarized object at a safepoint. It describes additional input edges (starting and count) in the safepoint node to which it is attached. SafePointScalarObjectNode nodes will be created for each safepoint nodes which reference the original scalar replaced allocation (this code will be added in next changes). ---------------------------------------------------------------------------- http://webrev.invokedynamic.info/kvn/6673473/index.html Fixed 6673473: Escape Analysis: Add the instance's field information to PhiNode Problem: Phi nodes are generated when needed to represent instance's fields values for a scalar replacement of an allocation. They are generated during memory optimization by using split_through_phi optimization. It creates a problem when we do this for a loop's Phi since there is no a guard against infinite (for each optimization path for the loop) generation of such value Phi nodes. Solution: Add the instance's field information to PhiNode to reuse the same value Phi. Also additional (needed for EA) fixes in touched files: 1. Fix TypeAryPtr::xmeet() and dump2() methods for array instances. 2. Move the code in MemNode::Ideal_common() to the separate method step_through_mergemem() which will be used in the next EA changes. 3. Replace incorrect assert (static calls are not only runtime calls) in MemNode::Ideal_DU_postCCP() with more precise asserts. 4. Fix the assert in MergeMemNode::Ideal() to allow duplicated references when the transformation is still in 'progress'. From Vladimir.Kozlov at Sun.COM Tue Mar 11 20:58:27 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Tue, 11 Mar 2008 19:58:27 -0800 Subject: EA push progress Message-ID: <47D754E3.5080406@sun.com> Chuck reviewed all my changes I already pushed and 6667620. Tom reviewed 6667615, 6667620, 6672848. I was able to push 6667620. And I hope to push 6667615 which is in the queue now. 6672848 changes causes deoptimization problem with current escape analysis code (jprt test run with -XX:+DoEscapeAnalysis). I may be missing some changes from my EA workspace for it to work. So I need more time to investigate it. Note, previous changeset 6667615 works fine with -XX:+DoEscapeAnalysis and I am trying to keep such compatibility with old EA code until I change it. Thanks, Vladimir # # An unexpected error has been detected by Java Runtime Environment: # # Internal Error (synchronizer.cpp:1803), pid=18510, tid=19 # Error: guarantee(mid->header()->is_neutral(),"invariant") # # Java VM: OpenJDK 64-Bit Server VM (12.0-b01-2008-03-12-005700.kvn.6667615 compiled mode solaris-amd64) # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x0000000000707c00): VMThread [stack: 0xfffffd7dfac5d000,0xfffffd7dfad5d000] [id=19] Stack: [0xfffffd7dfac5d000,0xfffffd7dfad5d000], sp=0xfffffd7dfad5c2a0, free space=1020k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x95fc13] void VMError::report(outputStream*) + 0x783 V [libjvm.so+0x960b99] void VMError::report_and_die() + 0x4b9 V [libjvm.so+0x5d985d] void report_fatal(const char*,int,const char*) + 0x3d V [libjvm.so+0x37ec90] void ObjectSynchronizer::deflate_idle_monitors() + 0x460 V [libjvm.so+0x37f83c] void SafepointSynchronize::begin() + 0x9cc V [libjvm.so+0x4bbffe] void VMThread::loop() + 0x39e V [libjvm.so+0x4bb32f] void VMThread::run() + 0x7f V [libjvm.so+0x85eb99] java_start + 0x219 C [libc.so.1+0xcb40b] _thr_slot_offset+0x31b _thr_setup + 0x5b C [libc.so.1+0xcb640] _thr_slot_offset+0x550 _lwp_start + 0x0 VM_Operation (0xfffffd7ffe3876f0): Deoptimize, mode: safepoint, requested by thread 0x000000000041c800 From Vladimir.Kozlov at Sun.COM Tue Mar 11 21:58:27 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Tue, 11 Mar 2008 20:58:27 -0800 Subject: EA push progress In-Reply-To: <47D754E3.5080406@sun.com> References: <47D754E3.5080406@sun.com> Message-ID: <47D762F3.4070406@sun.com> My investigation shows that 6672848 changes will not work with current EA code since it is broken: it returns incorrect escape state and it does not push Lock and Unlock nodes on IGVN worklist. As result Locks and Unlocks could be processed in IGVN during different passes and EA information only available during first IGVN optimization pass (when the ideal graph was not modified by "loop" optimizations). So we have Locks which marked as possible to eliminate and Unlocks which are not (and opposite). It seems, these changes have to wait until I fix EA. Thanks, Vladimir Vladimir Kozlov wrote: > Chuck reviewed all my changes I already pushed and 6667620. > Tom reviewed 6667615, 6667620, 6672848. > > I was able to push 6667620. And I hope to push 6667615 > which is in the queue now. > > 6672848 changes causes deoptimization problem with current > escape analysis code (jprt test run with -XX:+DoEscapeAnalysis). > I may be missing some changes from my EA workspace for it to work. > So I need more time to investigate it. > > Note, previous changeset 6667615 works fine with -XX:+DoEscapeAnalysis > and I am trying to keep such compatibility with old EA code > until I change it. > > Thanks, > Vladimir > > > # > # An unexpected error has been detected by Java Runtime Environment: > # > # Internal Error (synchronizer.cpp:1803), pid=18510, tid=19 > # Error: guarantee(mid->header()->is_neutral(),"invariant") > # > # Java VM: OpenJDK 64-Bit Server VM > (12.0-b01-2008-03-12-005700.kvn.6667615 compiled mode solaris-amd64) > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > --------------- T H R E A D --------------- > > Current thread (0x0000000000707c00): VMThread [stack: > 0xfffffd7dfac5d000,0xfffffd7dfad5d000] [id=19] > > Stack: [0xfffffd7dfac5d000,0xfffffd7dfad5d000], sp=0xfffffd7dfad5c2a0, > free space=1020k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > V [libjvm.so+0x95fc13] void VMError::report(outputStream*) + 0x783 > V [libjvm.so+0x960b99] void VMError::report_and_die() + 0x4b9 > V [libjvm.so+0x5d985d] void report_fatal(const char*,int,const char*) + > 0x3d > V [libjvm.so+0x37ec90] void ObjectSynchronizer::deflate_idle_monitors() > + 0x460 > V [libjvm.so+0x37f83c] void SafepointSynchronize::begin() + 0x9cc > V [libjvm.so+0x4bbffe] void VMThread::loop() + 0x39e > V [libjvm.so+0x4bb32f] void VMThread::run() + 0x7f > V [libjvm.so+0x85eb99] java_start + 0x219 > C [libc.so.1+0xcb40b] _thr_slot_offset+0x31b _thr_setup + 0x5b > C [libc.so.1+0xcb640] _thr_slot_offset+0x550 _lwp_start + 0x0 > > VM_Operation (0xfffffd7ffe3876f0): Deoptimize, mode: safepoint, > requested by thread 0x000000000041c800 > > From Chuck.Rasbold at Sun.COM Wed Mar 12 15:44:12 2008 From: Chuck.Rasbold at Sun.COM (Chuck Rasbold) Date: Wed, 12 Mar 2008 15:44:12 -0700 Subject: Review request (S): 6663621:JVM crashes while trying to execute api/java_security/Signature/SignatureTests.html#initSign tests Message-ID: <47D85CBC.6010804@Sun.COM> http://webrev.invokedynamic.info/rasbold/6663621/index.html Fixed 6663621:JVM crashes while trying to execute api/java_security/Signature/SignatureTests.html#initSign tests. Generated code crashes in certain kinds of vectorized loops in the 64 bit VM. Mis-alignment of vector arguments is the root cause of the crash. Deeper issues involving the alignment code need to be investigated; this expedient fix simply turns off SuperWord transformations in 64 bit VMs. They can be turned back on with with +AggressiveOpts. Reviewed by: Fix verified (y/n): y From Vladimir.Kozlov at Sun.COM Wed Mar 12 18:47:18 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Wed, 12 Mar 2008 17:47:18 -0800 Subject: Request for reviews (L): 6674588: Escape Analysis: Improve Escape Analysis code Message-ID: <47D887A6.9070002@sun.com> http://webrev.invokedynamic.info/kvn/6674588/index.html Fixed 6674588: Escape Analysis: Improve Escape Analysis code Problem: Current Escape Analysis code has several problems which have to be fixed. Solution: Generate Connection Graph after Parse phase and after the ideal graph is cleaned (dead parts are removed from the graph). Add checks of additional ideal nodes which could affect escape state of objects. Put on igvn worklist nodes which look for or used with escape information (Lock, Unlock, Allocation, AddP). Improve code for split unique type. Reviewed by: Fix verified (y/n): y Other testing: JPRT From Vladimir.Kozlov at Sun.COM Thu Mar 13 14:42:36 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Thu, 13 Mar 2008 13:42:36 -0800 Subject: Request for reviews (L): 6674588: Escape Analysis: Improve Escape Analysis code In-Reply-To: <47D887A6.9070002@sun.com> References: <47D887A6.9070002@sun.com> Message-ID: <47D99FCC.7060007@sun.com> I updated changes and webrev. Removed the unused (and incomplete/incorrect) method may_modify(Node* base,). Added type.hpp changes from 6673473 changeset so this changes are self consistent. Thank you, Steve, for finding this. Thanks, Vladimir Vladimir Kozlov wrote: > http://webrev.invokedynamic.info/kvn/6674588/index.html > > Fixed 6674588: Escape Analysis: Improve Escape Analysis code > > Problem: > Current Escape Analysis code has several problems which have to be fixed. > > Solution: > Generate Connection Graph after Parse phase and after the ideal graph is > cleaned > (dead parts are removed from the graph). Add checks of additional ideal > nodes > which could affect escape state of objects. Put on igvn worklist nodes > which look for or used with escape information (Lock, Unlock, > Allocation, AddP). > Improve code for split unique type. > > Reviewed by: > Fix verified (y/n): y > > Other testing: > JPRT > From John.Rose at Sun.COM Thu Mar 13 19:09:45 2008 From: John.Rose at Sun.COM (John Rose) Date: Thu, 13 Mar 2008 19:09:45 -0700 Subject: Request for reviews (L): 6674588: Escape Analysis: Improve Escape Analysis code In-Reply-To: <47D99FCC.7060007@sun.com> References: <47D887A6.9070002@sun.com> <47D99FCC.7060007@sun.com> Message-ID: <46021BF0-FA85-4584-BF50-3D41770DC8BF@sun.com> On Mar 13, 2008, at 2:42 PM, Vladimir Kozlov wrote: > I updated changes and webrev. That's some amazing work... --- node.cpp: + (is_CheckCastPP() && req() == 2)) Omit the check of req(); that was just a speed hack to avoid calling the Opcode() virtual. --- callnode.[ch]pp + // or result projection is there are several CheckCastPP s/is there are/if there are/ + return this; // more than 1 CheckCastPP s/return this/return p/ (the result projection), or else change the comment in the header file.. + // The check above guaranty offset >= 0 s/guaranty/guarantees/. Also, you could just make it an assert; it would be easier to read. + add_offset(-offset) That makes me want TypePtr::cast_to_offset(0). Maybe some day. + int base_idx = C->get_alias_index(adr_base_t); + int aat_idx = C->get_alias_index(aat->isa_oopptr()); + if (base_idx == aat_idx ... I don't think this works. If you ask for the alias index of any oop type plus zero, you will get the memory slice for *all* oopDesc::_mark fields. So the above check should always be true. Don't you want to get the alias index the offset versions of the pointers? (I.e., do not add -offset to base, and *do* add offset to aat.) --- escape.hpp The following note types are JavaObject s/note/node/ +// OF -P> JO (the object which oop is stored in the field) s/which/whose/ (genitive neuter) --- escape.cpp + adr_type == TypeRawPtr::NOTNULL This check is overly specific; I think you can omit it, and it will make the code more robust. + // If we are still collecting or there were no not escaping allocations Should be "there were no non-escaping allocations". s/not esc/non-esc/g There are several occurrences of "not esc", 2 in escape.cpp, and 2 in escape.hpp. + if (base->is_top()) { // The AddP case #3. + base = addp->in(AddPNode::Address)->uncast(); Should there be an assert here to correspond to your comment? Something like base->is_Proj && base->in(0)->is_Allocate. + && igvn->type(alloc->in(AllocateNode::KlassNode)) != TypeKlassPtr::OBJECT) { This check seems like it will almost always be true, but if it is false it doesn't say much interesting, just that the compiler cannot make any conclusions about the type of the cloned object. ...I'm about 1/3 of the way through this file; I'll send comments for the rest of it later. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20080313/3313e207/attachment.html From John.Rose at Sun.COM Thu Mar 13 20:29:05 2008 From: John.Rose at Sun.COM (John Rose) Date: Thu, 13 Mar 2008 20:29:05 -0700 Subject: Request for reviews (L): 6674588: Escape Analysis: Improve Escape Analysis code In-Reply-To: <47D99FCC.7060007@sun.com> References: <47D887A6.9070002@sun.com> <47D99FCC.7060007@sun.com> Message-ID: On Mar 13, 2008, at 2:42 PM, Vladimir Kozlov wrote: > I updated changes and webrev. Here's the rest of my review. I hope it helps! -- John --- escape.cpp + // See comments above. + Node* unique_use = use->raw_out(0); That looks like a factorization opportunity: // big comment ... Node* find_second_addp(Node* use) { if (...) return use- >unique_out(); else return NULL; } + if(!_processed.test(n->_idx) && n->is_AddP()) + cg_worklist.append(n->_idx); I looked but did not find how _processed could be set for the AddP node. What sorts of a AddPs are already processed at this early point? +void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) { + switch (n->Opcode()) { It seems like almost every case in that big switch includes the following: ptadr->_node = n; ptadr->set_node_type(PointsToNode::(something)); set_escape_state(n->_idx, PointsToNode::(something else)); _processed.set(n->_idx); Can those steps be factored out of the switch somehow, so it's easy to tell where the irregularities are (if there are any)? (It looks like you found on on case Op_LoadKlass.) The pattern could be: int ntype = (something default); int estate = (something else default); bool defer = false; _processed.set(n->_idx); switch (n->Opcode()) { ... default: return; // nothing to do } ptadr->_node = n; ptadr->set_node_type(ntype); set_escape_state(n->_idx, estate); if (defer) { _deferred.push(n); _processed.clear(n->_idx); } return; By the way, the name _deferred confuses me because it makes me think of a kind of CG edge. Should be "_delayed_worklist" or "_pass_2_worklist" or some such. + process_call_result(n->as_Proj(), phase); + if (!_processed.test(n->_idx)) { + _deferred.push(n); Can _processed.test(n) ever be true here? (I.e., isn't this an unconditional push to _deferred?) + add_deferred_edge_to_fields(n->_idx, pt, address_offset(adr, phase)); FWIW, address_offset(adr, phase) is loop invariant here. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20080313/abff6967/attachment.html From Vladimir.Kozlov at Sun.COM Fri Mar 14 19:13:44 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Fri, 14 Mar 2008 18:13:44 -0800 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) Message-ID: <47DB30D8.3010808@sun.com> Thank you for previous reviews. Here are my last EA changes for HS12. Note: both changesets have similar memory walking code but I don't want to optimize/combine this code now. I will do it later. Thanks, Vladimir ---------------------------------------------------------------------------- http://webrev.invokedynamic.info/kvn/6674600/index.html Fixed 6674600: (Escape Analysis) Optimize memory graph for instance's fields Problem: To reallocate a scalarized object during a deoptimization we need to know the state (values) of object's non-static fields at a safepoint. Solution: Use aggressive memory optimizations during Iterative GVN to obtain values assigned to instance's non-static fields. ---------------------------------------------------------------------------- http://webrev.invokedynamic.info/kvn/6259129/index.html Fixed 6259129: (Escape Analysis) scalar replacement for non-escaping objects Problem: To reallocate a scalarized object during a deoptimization we need to know the state (values) of object's non-static fields at a safepoint. Solution: Replace non-escaping allocations with SafePointScalarObjectNode for a scalar replacement during macro expansion of Allocate nodes. Do an additional memory search to obtain values assigned to instance's non-static fields. Disable scalar replacement if a field's value can't be found. ---------------------------------------------------------------------------- From Vladimir.Kozlov at Sun.COM Mon Mar 17 13:38:29 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 17 Mar 2008 12:38:29 -0800 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: <47DB30D8.3010808@sun.com> References: <47DB30D8.3010808@sun.com> Message-ID: <47DED6C5.90001@sun.com> I updated 6674600 changes to fix the problem in the method CallNode::may_modify() (added in 6674588 changeset): at_ptr->add_offset(offset) throws assert when it's klass is not loaded. I added at_ptr->klass()->is_loaded() check. Should I also check that at_ptr->klass() is not interface and is java klass? I assume that the klass for allocation is not interface and is java klass. Am I right? Also should I check that adrInst_t->klass()->is_subtype_of(at_ptr->klass())? Or the alias check does that? I mean will the next be true (for instance klass): if( adrInst_t->klass()->is_subtype_of(at_ptr->klass()) && adrInst_t->offset() < at_ptr->klass()->as_instance_klass()->size_helper()*wordSize) { (C->get_alias_index(at_ptr->add_offset(adrInst_t->offset())->isa_oopptr()) == C->get_alias_index(adrInst_t)) == true; } Thanks, Vladimir Vladimir Kozlov wrote: > Thank you for previous reviews. > > Here are my last EA changes for HS12. > > Note: both changesets have similar memory walking code but > I don't want to optimize/combine this code now. I will do it later. > > Thanks, > Vladimir > > ---------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6674600/index.html > > Fixed 6674600: (Escape Analysis) Optimize memory graph for instance's > fields > > Problem: > To reallocate a scalarized object during a deoptimization we need > to know the state (values) of object's non-static fields at a safepoint. > > Solution: > Use aggressive memory optimizations during Iterative GVN > to obtain values assigned to instance's non-static fields. > > ---------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6259129/index.html > > Fixed 6259129: (Escape Analysis) scalar replacement for non-escaping > objects > > Problem: > To reallocate a scalarized object during a deoptimization we need > to know the state (values) of object's non-static fields at a safepoint. > > Solution: > Replace non-escaping allocations with SafePointScalarObjectNode > for a scalar replacement during macro expansion of Allocate nodes. > Do an additional memory search to obtain values assigned to instance's > non-static fields. Disable scalar replacement if a field's value > can't be found. > ---------------------------------------------------------------------------- > From John.Rose at Sun.COM Mon Mar 17 12:45:00 2008 From: John.Rose at Sun.COM (John Rose) Date: Mon, 17 Mar 2008 12:45:00 -0700 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: <47DED6C5.90001@sun.com> References: <47DB30D8.3010808@sun.com> <47DED6C5.90001@sun.com> Message-ID: <4C7F6A9C-2D98-4CF1-8C6A-5B5579BCFFA5@sun.com> On Mar 17, 2008, at 1:38 PM, Vladimir Kozlov wrote: > Should I also check that at_ptr->klass() is not interface and > is java klass? I assume that the klass for allocation is not interface > and is java klass. Am I right? You are right. It must be a non-abstract class. > Also should I check that adrInst_t->klass()->is_subtype_of(at_ptr- > >klass())? > Or the alias check does that? I mean will the next be true (for > instance klass): The function flatten_alias_type normalizes the klass, to the super class which actually contains the given offset. So, generally, there's no need for subtype checks when comparing aliases. I would convert those checks to asserts, just to be sure you are working with properly normalized types. -- John From Vladimir.Kozlov at Sun.COM Mon Mar 17 14:21:19 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 17 Mar 2008 13:21:19 -0800 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: <4C7F6A9C-2D98-4CF1-8C6A-5B5579BCFFA5@sun.com> References: <47DB30D8.3010808@sun.com> <47DED6C5.90001@sun.com> <4C7F6A9C-2D98-4CF1-8C6A-5B5579BCFFA5@sun.com> Message-ID: <47DEE0CF.6050008@sun.com> Thank you, John Vladimir John Rose wrote: > On Mar 17, 2008, at 1:38 PM, Vladimir Kozlov wrote: > >> Should I also check that at_ptr->klass() is not interface and >> is java klass? I assume that the klass for allocation is not interface >> and is java klass. Am I right? > > You are right. It must be a non-abstract class. > >> Also should I check that >> adrInst_t->klass()->is_subtype_of(at_ptr->klass())? >> Or the alias check does that? I mean will the next be true (for >> instance klass): > > The function flatten_alias_type normalizes the klass, to the super class > which > actually contains the given offset. So, generally, there's no need for > subtype > checks when comparing aliases. > > I would convert those checks to asserts, just to be sure you are working > with properly normalized types. > > -- John From Thomas.Rodriguez at Sun.COM Tue Mar 18 10:52:31 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Tue, 18 Mar 2008 10:52:31 -0700 Subject: request for review (XS) Message-ID: <47E0015F.1040700@sun.com> http://webrev.invokedynamic.info/never/6666343 From Thomas.Rodriguez at Sun.COM Tue Mar 18 10:53:22 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Tue, 18 Mar 2008 10:53:22 -0700 Subject: request for review (XS) Message-ID: <47E00192.3020107@sun.com> http://webrev.invokedynamic.info/never/6659207/ From Thomas.Rodriguez at Sun.COM Tue Mar 18 14:03:21 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Tue, 18 Mar 2008 14:03:21 -0700 Subject: request for review (XS) Message-ID: <47E02E19.6000405@sun.com> http://webrev.invokedynamic.info/never/6676841/ From John.Rose at Sun.COM Tue Mar 18 21:28:25 2008 From: John.Rose at Sun.COM (John Rose) Date: Tue, 18 Mar 2008 21:28:25 -0700 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: <47DED6C5.90001@sun.com> References: <47DB30D8.3010808@sun.com> <47DED6C5.90001@sun.com> Message-ID: On Mar 17, 2008, at 1:38 PM, Vladimir Kozlov wrote: > ---------------------------------------------------------------------- > ------ http://webrev.invokedynamic.info/kvn/6674600/index.html > Fixed 6674600: (Escape Analysis) Optimize memory graph for > instance's fields > Problem: > To reallocate a scalarized object during a deoptimization we need > to know the state (values) of object's non-static fields at a > safepoint. > Solution: > Use aggressive memory optimizations during Iterative GVN > to obtain values assigned to instance's non-static fields. --- graphKit.cpp missing use of 'mem' in last diff --- callnode.cpp suggest adding this to ciType.hpp: int size() const { return type2size [basic_type()]; } + int array_element_size() const { return type2aelembytes[basic_type ()]; } --- PhiNode::split_out_instance I like it, although it's very expensive. Maybe it should push the whole mini-graph on the worklist before making any splits, and bail out if/when the worklist gets too long. I don't see why you put in the O.B.O. on the edge index: + uint i = stack.index() + 1; + stack.push(ophi, i - 1); This seems clearer to me: + stack.push((Node *)this, 1); + uint i = stack.index(); assert(i >= 1, "not ctl edge"); + stack.push(ophi, i); --- memnode.cpp + } else if (mem->is_Proj() && mem->in(0)->is_MemBar()) { + mem = mem->in(0)->in(TypeFunc::Memory); + continue; // (a) advance through independent MemBar memory This is scary. Unless the membar is slice-specific, it isn't really independent. Some membars (MemBarCPUOrder inserted in library_call.cpp) are necessary to isolate memory effects which do not appear to be related (via the alias analysis) but in fact might. Some unsafe stores are in this category. Also Object.clone intrinsic stores. --- LoadNode::Ideal Wow; lots here. I'll send more on this later. -- John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20080318/aa2f7e58/attachment.html From Steve.Goldman at Sun.COM Wed Mar 19 06:55:04 2008 From: Steve.Goldman at Sun.COM (steve goldman) Date: Wed, 19 Mar 2008 09:55:04 -0400 Subject: Please review (XXXL) merge i486/amd64 and add 64bit client compiler Message-ID: <47E11B38.7090303@sun.com> These changes have been out for review internally at Sun since Dec for the 1st piece and Jan. for the second piece. After a request I'm making them world visible. I'm not sure I expect a review but at least you'll see what is coming. These changes will not be committed for a while yet because I'm waiting for the flood of changes in the pipes to settle down now that the OpenJDK repositories finally opened so you have got a decent amount of time if you are so inclined. :-) 5108146 Merge i486 and amd64 cpu directories http://webrev.invokedynamic.info/sgoldman/5108146/ This webrev merges the code in assembler_x86_[32|64].* into assembler_x86.*. The webrev shows it as assembler_x86.* as new files and assembler_x86_[32|64].* as unchanged. When the commit actually happens the 32|64 files will be deleted. In addition to merging the assembler code the .cpp file was restructured so that the instructions are in alphabetical order and in 3 sections, generic, 32bit only, 64bit only. As a result the diffs for that file are incomprehensible. As part of this there is a small step along the way to the "ptr"ization of the code. The next webrev to appear which contains the 64bit c1 changes goes the rest of the way. With the changes here operations that only can do a full register sized operation don't have a size qualifier. So movl(Register, Register) or movq(Register, Register) are now mov(Register, Register). push/pop/bswap also don't have a qualifier either. 6459804 Want client (c1) compiler for x86_64 (amd64) for faster start-up http://webrev.invokedynamic.info/sgoldman/6459804-1/ http://webrev.invokedynamic.info/sgoldman/6459804-2/ This webrev was so large that the infrastructure at invokedynamic.info wouldn't upload it as a single webrev so it is split into two pieces at an arbitrary point. The changes here are layered as a patch on top of the changes for 5108146. The changes in this request are in two flavors, "ptr-izing" the assembly code throughout the x86 directory and changes to c1 to produce a 64bit c1. The spelling changes that did the "ptr-izing" of the code may be controversial. I'm open to alternative spellings. -- Steve From Vladimir.Kozlov at Sun.COM Wed Mar 19 12:58:38 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Wed, 19 Mar 2008 11:58:38 -0800 Subject: Request for reviews (S): 6662967: Optimize I2D conversion on new x86 Message-ID: <47E1706E.3040903@sun.com> http://webrev.invokedynamic.info/kvn/6662967/index.html Fixed 6662967: Optimize I2D conversion on new x86 Problem: In new AMD cpu CVTDQ2PS and CVTDQ2PD are single direct path instructions. Solution: Use CVTDQ2PS and CVTDQ2PD for integer values conversions to float and double values on new AMD cpu. Reviewed by: Fix verified (y/n): y Other testing: JPRT From Thomas.Rodriguez at Sun.COM Wed Mar 19 13:07:40 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Wed, 19 Mar 2008 13:07:40 -0700 Subject: review for 6661247 (XS) Message-ID: <47E1728C.6020504@sun.com> http://javaweb.sfbay.sun.com/~never/webrev/6661247/ From Vladimir.Kozlov at Sun.COM Wed Mar 19 15:08:19 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Wed, 19 Mar 2008 14:08:19 -0800 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: <47DB30D8.3010808@sun.com> References: <47DB30D8.3010808@sun.com> Message-ID: <47E18ED3.3090804@sun.com> Chuck suggested to add a new method for the next sequence which I used very often in macro.cpp (6259129 changes): I added new method into PhaseIterGVN: + // Replace old node with new one. + void replace_node( Node *old, Node *nn ) { + add_users_to_worklist(old); + hash_delete(old); + subsume_node(old, nn); + } + But I am wondering why we not always put users of old node on worklist in subsume_node()? Thanks, Vladimir Vladimir Kozlov wrote: > Thank you for previous reviews. > > Here are my last EA changes for HS12. > > Note: both changesets have similar memory walking code but > I don't want to optimize/combine this code now. I will do it later. > > Thanks, > Vladimir > > ---------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6674600/index.html > > Fixed 6674600: (Escape Analysis) Optimize memory graph for instance's > fields > > Problem: > To reallocate a scalarized object during a deoptimization we need > to know the state (values) of object's non-static fields at a safepoint. > > Solution: > Use aggressive memory optimizations during Iterative GVN > to obtain values assigned to instance's non-static fields. > > ---------------------------------------------------------------------------- > > http://webrev.invokedynamic.info/kvn/6259129/index.html > > Fixed 6259129: (Escape Analysis) scalar replacement for non-escaping > objects > > Problem: > To reallocate a scalarized object during a deoptimization we need > to know the state (values) of object's non-static fields at a safepoint. > > Solution: > Replace non-escaping allocations with SafePointScalarObjectNode > for a scalar replacement during macro expansion of Allocate nodes. > Do an additional memory search to obtain values assigned to instance's > non-static fields. Disable scalar replacement if a field's value > can't be found. > ---------------------------------------------------------------------------- > From Thomas.Rodriguez at Sun.COM Wed Mar 19 14:21:38 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Wed, 19 Mar 2008 14:21:38 -0700 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: <47E18ED3.3090804@sun.com> References: <47DB30D8.3010808@sun.com> <47E18ED3.3090804@sun.com> Message-ID: <47E183E2.8050906@sun.com> It's a good question. For that matter, I don't understand why subsume_node doesn't automatically call hash_delete for you. In some places we do put things on the worklist but not in others and who knows if there's a good reason for it. I'd generally assume no but I know there are places in loopopts where things are explicitly removed from the worklist to discourage commoning. This is generally done for moving loop invariant operations out of loops and seems like a hack. Anyway, I'd love to see subsume_node automatically hash_delete and add_users_to_worklist. tom Vladimir Kozlov wrote: > Chuck suggested to add a new method for the next sequence > which I used very often in macro.cpp (6259129 changes): > I added new method into PhaseIterGVN: > > > + // Replace old node with new one. > + void replace_node( Node *old, Node *nn ) { > + add_users_to_worklist(old); > + hash_delete(old); > + subsume_node(old, nn); > + } > + > > But I am wondering why we not always put users of old node > on worklist in subsume_node()? > > Thanks, > Vladimir > > Vladimir Kozlov wrote: >> Thank you for previous reviews. >> >> Here are my last EA changes for HS12. >> >> Note: both changesets have similar memory walking code but >> I don't want to optimize/combine this code now. I will do it later. >> >> Thanks, >> Vladimir >> >> ---------------------------------------------------------------------------- >> >> http://webrev.invokedynamic.info/kvn/6674600/index.html >> >> Fixed 6674600: (Escape Analysis) Optimize memory graph for instance's >> fields >> >> Problem: >> To reallocate a scalarized object during a deoptimization we need >> to know the state (values) of object's non-static fields at a safepoint. >> >> Solution: >> Use aggressive memory optimizations during Iterative GVN >> to obtain values assigned to instance's non-static fields. >> >> ---------------------------------------------------------------------------- >> >> http://webrev.invokedynamic.info/kvn/6259129/index.html >> >> Fixed 6259129: (Escape Analysis) scalar replacement for non-escaping >> objects >> >> Problem: >> To reallocate a scalarized object during a deoptimization we need >> to know the state (values) of object's non-static fields at a safepoint. >> >> Solution: >> Replace non-escaping allocations with SafePointScalarObjectNode >> for a scalar replacement during macro expansion of Allocate nodes. >> Do an additional memory search to obtain values assigned to instance's >> non-static fields. Disable scalar replacement if a field's value >> can't be found. >> ---------------------------------------------------------------------------- >> > From Vladimir.Kozlov at Sun.COM Wed Mar 19 18:50:18 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Wed, 19 Mar 2008 17:50:18 -0800 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: <47E18ED3.3090804@sun.com> References: <47DB30D8.3010808@sun.com> <47E18ED3.3090804@sun.com> Message-ID: <47E1C2DA.5060708@sun.com> I updated changes for 6259129. http://webrev.invokedynamic.info/kvn/6259129/index.html As Chuck suggested I divided eliminate_allocate_node() method into 3 methods (he suggested 5 methods): bool can_eliminate_allocation() bool scalar_replacement() void process_users_of_allocation() I used new method replace_node() only in macro.cpp file. And I filed the rfe 6677629 to investigate a possibility to call hash_delete() and add_users_to_worklist() from subsume_node() to clean such calls in all C2 files. Thanks, Vladimir Vladimir Kozlov wrote: > Chuck suggested to add a new method for the next sequence > which I used very often in macro.cpp (6259129 changes): > I added new method into PhaseIterGVN: > > > + // Replace old node with new one. > + void replace_node( Node *old, Node *nn ) { > + add_users_to_worklist(old); > + hash_delete(old); > + subsume_node(old, nn); > + } > + > > But I am wondering why we not always put users of old node > on worklist in subsume_node()? > > Thanks, > Vladimir > > Vladimir Kozlov wrote: >> Thank you for previous reviews. >> >> Here are my last EA changes for HS12. >> >> Note: both changesets have similar memory walking code but >> I don't want to optimize/combine this code now. I will do it later. >> >> Thanks, >> Vladimir >> >> ---------------------------------------------------------------------------- >> >> http://webrev.invokedynamic.info/kvn/6674600/index.html >> >> Fixed 6674600: (Escape Analysis) Optimize memory graph for instance's >> fields >> >> Problem: >> To reallocate a scalarized object during a deoptimization we need >> to know the state (values) of object's non-static fields at a safepoint. >> >> Solution: >> Use aggressive memory optimizations during Iterative GVN >> to obtain values assigned to instance's non-static fields. >> >> ---------------------------------------------------------------------------- >> >> http://webrev.invokedynamic.info/kvn/6259129/index.html >> >> Fixed 6259129: (Escape Analysis) scalar replacement for non-escaping >> objects >> >> Problem: >> To reallocate a scalarized object during a deoptimization we need >> to know the state (values) of object's non-static fields at a safepoint. >> >> Solution: >> Replace non-escaping allocations with SafePointScalarObjectNode >> for a scalar replacement during macro expansion of Allocate nodes. >> Do an additional memory search to obtain values assigned to instance's >> non-static fields. Disable scalar replacement if a field's value >> can't be found. >> ---------------------------------------------------------------------------- >> > From Thomas.Rodriguez at Sun.COM Wed Mar 19 18:30:34 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Wed, 19 Mar 2008 18:30:34 -0700 Subject: review for 6663621 (S) Message-ID: <47E1BE3A.1020409@sun.com> http://webrev.invokedynamic.info/never/6663621/ From John.Rose at Sun.COM Thu Mar 20 13:46:45 2008 From: John.Rose at Sun.COM (John Rose) Date: Thu, 20 Mar 2008 13:46:45 -0700 Subject: Request for reviews (M): 6674600, 6259129 (last Escape Analysis changes for HS12) In-Reply-To: References: <47DB30D8.3010808@sun.com> <47DED6C5.90001@sun.com> Message-ID: On Mar 17, 2008, at 1:38 PM, Vladimir Kozlov wrote: > ---------------------------------------------------------------------- > ------ http://webrev.invokedynamic.info/kvn/6674600/index.html > Fixed 6674600: (Escape Analysis) Optimize memory graph for > instance's fields > Problem: > To reallocate a scalarized object during a deoptimization we need > to know the state (values) of object's non-static fields at a > safepoint. > Solution: > Use aggressive memory optimizations during Iterative GVN > to obtain values assigned to instance's non-static fields. --- LoadNode::Ideal It's OK. There's a big chunk copied from loopopts, which is scary on two counts: It's from loopopts, and it is a modified cut-n-paste. That part needs to be refactored back into a single copy, but it can be a separate cleanup. We need a generally applicable split-through-phi as its own piece of code. Review is complete. > ---------------------------------------------------------------------- > ------ http://webrev.invokedynamic.info/kvn/6259129/index.html > Fixed 6259129: (Escape Analysis) scalar replacement for non- > escaping objects > Problem: > To reallocate a scalarized object during a deoptimization we need > to know the state (values) of object's non-static fields at a > safepoint. > Solution: > Replace non-escaping allocations with SafePointScalarObjectNode > for a scalar replacement during macro expansion of Allocate nodes. > Do an additional memory search to obtain values assigned to instance's > non-static fields. Disable scalar replacement if a field's value > can't be found. > ---------------------------------------------------------------------- > ------ --- PhaseMacroExpand::value_from_mem_phi Another case of phi specialization. I think this also needs to be refactored as a generally-applicable standalone chunk of code. The code repeats lots of local analysis in the Ideal and Identity methods of memnodes. It has to repeat rather than reuse because the inputs to the analysis are not quite local; they involve search over memory chains. As a future cleanup, we should either factor the local analyses so as to take "pluggable" search routines to traverse memory edges nonlocally, or rethink our memory edges so that they do not require search, so that graph transformations are again dependent on local information only. The code is OK, reviewed. -- John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20080320/984d5082/attachment.html From Vladimir.Kozlov at Sun.COM Wed Mar 26 10:11:54 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Wed, 26 Mar 2008 10:11:54 -0700 Subject: Request for reviews (S): 6679854: assert in escape.cpp:397 Message-ID: <47EA83DA.6070201@sun.com> http://webrev.invokedynamic.info/kvn/6679854/index.html Fixed 6679854: assert in escape.cpp:397 Problem: The assert misses the case CastX2P 'base' for an unsafe field reference. Solution: Add the check for CastX2P into the assert. I also fixed the reported this file gcc build problem. Reviewed by: Fix verified (y/n): y, failed test case. Other testing: JPRT From Thomas.Rodriguez at Sun.COM Wed Mar 26 15:18:27 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Wed, 26 Mar 2008 15:18:27 -0700 Subject: review (XS) for 6680594 Message-ID: <47EACBB3.5040700@sun.com> http://webrev.invokedynamic.info/never/6680594/ From Vladimir.Kozlov at Sun.COM Wed Mar 26 17:35:24 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Wed, 26 Mar 2008 17:35:24 -0700 Subject: Request for reviews (S): 6680665: bytecode Escape Analyzer produces incorrect escape information for methods without oop arguments Message-ID: <47EAEBCC.7060209@sun.com> I want this for HS12 (if approved). http://webrev.invokedynamic.info/kvn/6680665/index.html Fixed 6680665: bytecode Escape Analyzer produces incorrect escape information for methods without oop arguments Problem: bcEscapeAnalyzer does not analyze methods with no oop arguments. If such method returns an object bcEscapeAnalyzer always says that an object is new non-escaping allocated object. In the failed test cases the methods are accessors for a static fields oop (which obviously global escape). And the caller method has synchronization on this field. But during compilation locks were removed since EA says the returned object does not escape. Also bcEscapeAnalyzer doesn't save all escape information in MDO. As result sequential calls to bcEscapeAnalyzer for the same method will return incorrect information even when the original was correct. Solution: Use pessimistic escape information for methods which were not analyzed. Analyze methods which returns oop. Save all escape information in MDO. Also I moved duplicated dump code to BCEscapeAnalyzer::dump(). Reviewed by: Fix verified (y/n): y, failed test cases. Other testing: JPRT From regina.anger at hotmail.com Thu Mar 27 09:36:08 2008 From: regina.anger at hotmail.com (Regina Anger) Date: Thu, 27 Mar 2008 17:36:08 +0100 Subject: What does AggressiveOpts do with my timings? Message-ID: Hi, When I run the code attached belog with -XX:+AggressiveOpts I get weird timings. 1 BugTest::fillRect (27 bytes) 2 java.lang.Math::abs (11 bytes) 1% BugTest::main @ 9 (50 bytes) 1% made not entrant (2) BugTest::main @ 9 (50 bytes) Run: 677 2% BugTest::main @ 9 (50 bytes) Run: 780 Run: 623 Run: 676 Run: 676 Run: 624 Run: 104 <----- Why so low? Run: 1193<------ Why so high? Run: 624 Without -XX:+AggressiveOpts the timings are stable at ~630ms after initial warm-up. I am using JDK7b20 on Linux. Although its really unimporntant, I am quite curious, whats going on here? Regi public class SpeedTest { static int[] opcodes = new int[30]; static int cnt = 0; static int dummy=0; public static void main(String[] args) { while (true) { long start = System.currentTimeMillis(); for (int i = 0; i < 100000000; i++) { test(); } System.out.println("Run: " + (System.currentTimeMillis() - start)); } } public static final void test() { dummy += opcodes[Math.abs(++cnt % 30)]; } } _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE From Stephen.Bohne at Sun.COM Thu Mar 27 12:20:01 2008 From: Stephen.Bohne at Sun.COM (Steve Bohne) Date: Thu, 27 Mar 2008 15:20:01 -0400 Subject: What does AggressiveOpts do with my timings? In-Reply-To: References: Message-ID: <47EBF361.4060605@sun.com> Hi Regina, This is likely a bug in the time caching feature introduced in b12 under AggressiveOpts. You can confirm this by running with "-XX:+AggressiveOpts -XX:-CacheTimeMillis" and see if the problem goes away. There is an interaction between time caching, counted loops with the server compiler, and biased locking, that can make time offsets go squirrelly around 4 seconds (or BiasedLockingStartupDelay) into the run. It should go away around b26, when time caching will be removed. Steve Regina Anger wrote: > Hi, > > When I run the code attached belog with -XX:+AggressiveOpts I get weird timings. > > > 1 BugTest::fillRect (27 bytes) > 2 java.lang.Math::abs (11 bytes) > 1% BugTest::main @ 9 (50 bytes) > 1% made not entrant (2) BugTest::main @ 9 (50 bytes) > Run: 677 > 2% BugTest::main @ 9 (50 bytes) > Run: 780 > Run: 623 > Run: 676 > Run: 676 > Run: 624 > Run: 104 <----- Why so low? > Run: 1193<------ Why so high? > Run: 624 > > Without -XX:+AggressiveOpts the timings are stable at ~630ms after initial warm-up. > I am using JDK7b20 on Linux. > Although its really unimporntant, I am quite curious, whats going on here? > > Regi > > public class SpeedTest { > static int[] opcodes = new int[30]; > static int cnt = 0; > static int dummy=0; > > public static void main(String[] args) { > while (true) > { > long start = System.currentTimeMillis(); > > for (int i = 0; i < 100000000; i++) > { > test(); > } > System.out.println("Run: " + (System.currentTimeMillis() - start)); > } > } > > public static final void test() { > dummy += opcodes[Math.abs(++cnt % 30)]; > } > } > _________________________________________________________________ > Explore the seven wonders of the world > http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE > From Thomas.Rodriguez at Sun.COM Fri Mar 28 10:46:49 2008 From: Thomas.Rodriguez at Sun.COM (Tom Rodriguez) Date: Fri, 28 Mar 2008 10:46:49 -0700 Subject: review (XS) for 6636352 Message-ID: <47ED2F09.90003@sun.com> http://webrev.invokedynamic.info/never/6636352 From regina.anger at hotmail.com Sun Mar 30 14:43:25 2008 From: regina.anger at hotmail.com (Regina Anger) Date: Sun, 30 Mar 2008 23:43:25 +0200 Subject: What does AggressiveOpts do with my timings? In-Reply-To: <47EBF361.4060605@sun.com> References: <47EBF361.4060605@sun.com> Message-ID: Hi Steve, > This is likely a bug in the time caching feature introduced in b12 under > AggressiveOpts. You can confirm this by running with > "-XX:+AggressiveOpts -XX:-CacheTimeMillis" and see if the problem goes > away. There is an interaction between time caching, counted loops with > the server compiler, and biased locking, that can make time offsets go > squirrelly around 4 seconds (or BiasedLockingStartupDelay) into the > run. It should go away around b26, when time caching will be removed. Of course you were right, disabling time caching gave me stable results. Sad that timecaching seems to not work out as expected, I for myself also had scalability problems in some code which did a lot of System.currTimeMillis() in a lock ;) Regina PS: Your blog is really interesting - both the airplane and of course also the compiler stuff. Thanks for writing those interesting articles. _________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline From Steve.Goldman at Sun.COM Mon Mar 31 05:54:43 2008 From: Steve.Goldman at Sun.COM (steve goldman) Date: Mon, 31 Mar 2008 08:54:43 -0400 Subject: What does AggressiveOpts do with my timings? In-Reply-To: References: <47EBF361.4060605@sun.com> Message-ID: <47F0DF13.8050805@sun.com> Regina Anger wrote: > Hi Steve, > >> This is likely a bug in the time caching feature introduced in b12 under >> AggressiveOpts. You can confirm this by running with >> "-XX:+AggressiveOpts -XX:-CacheTimeMillis" and see if the problem goes >> away. There is an interaction between time caching, counted loops with >> the server compiler, and biased locking, that can make time offsets go >> squirrelly around 4 seconds (or BiasedLockingStartupDelay) into the >> run. It should go away around b26, when time caching will be removed. > > Of course you were right, disabling time caching gave me stable results. > Sad that timecaching seems to not work out as expected, I for myself also had scalability problems in some code which did a lot of System.currTimeMillis() in a lock ;) > > Regina > > PS: Your blog is really interesting - both the airplane and of course also the compiler stuff. Thanks for writing those interesting articles. :-) Too many Steve's. The Steve that answered you was Steve Bohne and his blog is at http://blogs.sun.com/sbohne/ and afaik there isn't any airplane and compiler stuff there though it is still interesting. My blog http://blogs.sun.com/fatcatair does however does have compiler and airplane stuff although it has been idle for a few months. Every Monday I swear I'll add something in the coming week only to see Friday roll around and I've never gotten to it. I don't know how the people that blog every day do it. -- Steve Goldman (aka fatcatair) From Vladimir.Kozlov at Sun.COM Mon Mar 31 10:14:48 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 31 Mar 2008 10:14:48 -0700 Subject: Request for reviews (S): 6681646: Relocking of a scalar replaced object during deoptimization is broken Message-ID: <47F11C08.8070401@sun.com> I want this for HS12 (if approved). http://webrev.invokedynamic.info/kvn/6680665/index.html Fixed 66681646: Relocking of a scalar replaced object during deoptimization is broken Problem: The test failed when trying exit the monitor after deoptimization of the compiled method with eliminated lock. When scalarized object is reallocated the mark word is set to klass->prototype_header() by default. Which can have biased pattern. Also if the object is not scalarized but only thread-local the method revoke_biases_of_monitors() will relock it before relock_objects() is called. The lock should not be biased in order to safely move the displaced mark word from the compiled frame to the vframeArray and back to the interpreted frame. Solution: Add the check into relock_objects() to do nothing that if an object is locked already. Call fast_enter() in relock_objects() to relock an object - it will revoke biased lock if needed. Put reallocate and relock code under (fr->scope() != NULL) check to avoid reference through NULL. Reviewed by: Fix verified (y/n): y, failed test cases. Other testing: JPRT, CTW, NSK tests From Vladimir.Kozlov at Sun.COM Mon Mar 31 16:07:57 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 31 Mar 2008 16:07:57 -0700 Subject: Request for reviews (S): 6681646: Relocking of a scalar replaced object during deoptimization is broken In-Reply-To: <47F11C08.8070401@sun.com> References: <47F11C08.8070401@sun.com> Message-ID: <47F16ECD.70200@sun.com> Sorry, I sent incorrect link and bug id (too many '6'). http://webrev.invokedynamic.info/kvn/6681646/index.html Fixed 6681646: Relocking of a scalar replaced object during deoptimization is broken Vladimir Vladimir Kozlov wrote: > I want this for HS12 (if approved). > > http://webrev.invokedynamic.info/kvn/6680665/index.html > > Fixed 66681646: Relocking of a scalar replaced object during > deoptimization is broken > > Problem: > The test failed when trying exit the monitor after deoptimization > of the compiled method with eliminated lock. > > When scalarized object is reallocated the mark word is set to > klass->prototype_header() by default. Which can have biased pattern. > Also if the object is not scalarized but only thread-local > the method revoke_biases_of_monitors() will relock it > before relock_objects() is called. > > The lock should not be biased in order to safely move > the displaced mark word from the compiled frame > to the vframeArray and back to the interpreted frame. > > > Solution: > Add the check into relock_objects() to do nothing that if an object > is locked already. > Call fast_enter() in relock_objects() to relock an object - it > will revoke biased lock if needed. > Put reallocate and relock code under (fr->scope() != NULL) check > to avoid reference through NULL. > > Reviewed by: > Fix verified (y/n): y, failed test cases. > > Other testing: > JPRT, CTW, NSK tests > From Vladimir.Kozlov at Sun.COM Mon Mar 31 16:21:19 2008 From: Vladimir.Kozlov at Sun.COM (Vladimir Kozlov) Date: Mon, 31 Mar 2008 16:21:19 -0700 Subject: Request for reviews (S): 6682236: C2 hits ideal nodes limit during IGVN optimization with EA Message-ID: <47F171EF.8000509@sun.com> I want this for HS12 (if approved). http://webrev.invokedynamic.info/kvn/6682236/index.html Fixed 6682236: C2 hits ideal nodes limit during IGVN optimization with EA Problem: I thought I could relay on LoadNode::Identity() call during IGVN optimization to avoid infinite generation of value Phi for an instance field loads. But in the failed case it does not happen since the new Load node (from spit through phi) is replaced with a new value Phi again during next invocation of LoadNode::Ideal(). Solution: Add the check into LoadNode::Ideal() to not generate a new value Phi if LoadNode::Identity() will find a value. Reviewed by: Fix verified (y/n): y, failed test cases. Other testing: JPRT, CTW, NSK tests