From doug.simon at oracle.com Mon Dec 1 02:00:09 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Mon, 01 Dec 2014 02:00:09 +0000 Subject: hg: graal/graal: 10 new changesets Message-ID: <201412010200.sB120AHY011915@aojmv0008> Changeset: 966081b8e830 Author: Doug Simon Date: 2014-11-27 11:45 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/966081b8e830 guard against null element in HotSpotConstantReflectionProvider.readStableFieldValue ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantReflectionProvider.java Changeset: c4da2e160178 Author: Doug Simon Date: 2014-11-27 11:50 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c4da2e160178 removed static reference to HotSpotGraalRuntime ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java Changeset: 3566e1edb3b4 Author: Doug Simon Date: 2014-11-27 11:51 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3566e1edb3b4 removed static references to HotSpotGraalRuntime ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CRC32Substitutions.java Changeset: 37d88a4af2ab Author: Doug Simon Date: 2014-11-27 11:59 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/37d88a4af2ab removed references to HotSpotGraalRuntime.unsafeReadWord() ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java Changeset: 351cc8ee5e3f Author: Doug Simon Date: 2014-11-27 12:37 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/351cc8ee5e3f removed static accesses to HotSpotGraalRuntime ! graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/AllocaNode.java Changeset: 487c792de3dc Author: Doug Simon Date: 2014-11-30 00:17 +0000 URL: http://hg.openjdk.java.net/graal/graal/rev/487c792de3dc Merge. Changeset: c296b906b9eb Author: Doug Simon Date: 2014-11-30 08:35 +0000 URL: http://hg.openjdk.java.net/graal/graal/rev/c296b906b9eb added missing SubstitutionGuard binding for HotSpotVMConfig ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java Changeset: f262c6c5fb7a Author: Doug Simon Date: 2014-11-30 21:09 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/f262c6c5fb7a invocation cache hit counter should be incremented, not decremented ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Handler.java Changeset: 77b55091cca1 Author: Doug Simon Date: 2014-11-30 21:12 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/77b55091cca1 removed object pool sharing across unique Contexts ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java Changeset: b76489300efa Author: Doug Simon Date: 2014-11-30 21:14 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/b76489300efa generalized assertion regarding code that can/cannot execute in replay compilation context ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstantImpl.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstantImpl.java From doug.simon at oracle.com Tue Dec 2 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Tue, 02 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 9 new changesets Message-ID: <201412020200.sB22073g022204@aojmv0008> Changeset: d24328ea36a7 Author: Doug Simon Date: 2014-12-01 10:00 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d24328ea36a7 fixed bug in VerifyUsageWithEquals and improved javadoc ! graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java Changeset: 1b918c6ff5eb Author: Doug Simon Date: 2014-12-01 10:29 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/1b918c6ff5eb allow == when one of the variables is the receiver in equals() ! graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java Changeset: 12bd2b344b08 Author: Doug Simon Date: 2014-12-01 10:43 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/12bd2b344b08 replace usages of == with .equals() ! graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractJavaProfile.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java ! graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java ! graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Changeset: bf7db79a6e45 Author: Doug Simon Date: 2014-12-01 15:03 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/bf7db79a6e45 only TrustedInterfaces can be checked with VerifyUsageWithEquals ! graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java ! graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java ! graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java ! graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java ! graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java ! graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java Changeset: 68814fb4bbe4 Author: Stefan Anzinger Date: 2014-12-01 15:19 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/68814fb4bbe4 [SPARC] Fix ArraysSubstitution and StringSubstitution tests by moving the according substitutions to common code ! graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64Substitutions.java ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraalMethodSubstitutions.java Changeset: 51d05f258309 Author: Stefan Anzinger Date: 2014-12-01 15:19 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/51d05f258309 Merge Changeset: d6555d937ae2 Author: Stefan Anzinger Date: 2014-12-01 17:03 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d6555d937ae2 Merge Changeset: 3f63ea587d2b Author: Stefan Anzinger Date: 2014-12-01 17:12 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3f63ea587d2b Fix eclipseformat ! graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64Substitutions.java Changeset: c640f804dbad Author: Tom Rodriguez Date: 2014-12-01 11:31 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/c640f804dbad Intrinsify Reflection.getClassAccessFlags ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionSubstitutions.java From doug.simon at oracle.com Wed Dec 3 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Wed, 03 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 6 new changesets Message-ID: <201412030200.sB3207lK019840@aojmv0008> Changeset: 15224d4c0347 Author: Bernhard Urban Date: 2014-12-02 15:51 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/15224d4c0347 ArrayCopyCallNode: remove unused method. ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java Changeset: 62723b0ac9e6 Author: Bernhard Urban Date: 2014-12-02 15:51 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/62723b0ac9e6 ArrayCopySnippets: add comment about lookup ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java Changeset: 278f8fe0c212 Author: Bernhard Urban Date: 2014-12-02 15:51 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/278f8fe0c212 ArrayCopyCallNode: remove unused code. ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java Changeset: 58ea6b98cb09 Author: Bernhard Urban Date: 2014-12-02 18:55 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/58ea6b98cb09 ArrayCopy: use hotspot stub for checkcastArraycopy. ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckcastArrayCopyCallNode.java Changeset: 1f379e2a623f Author: Bernhard Urban Date: 2014-12-02 19:27 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/1f379e2a623f checkcastArraycopy: sign extend super_check_offset ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckcastArrayCopyCallNode.java Changeset: be63951fa2bc Author: Bernhard Urban Date: 2014-12-02 20:48 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/be63951fa2bc WriteBarrierVerification: relax check ! graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java From java at stefan-marr.de Wed Dec 3 09:29:54 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 3 Dec 2014 10:29:54 +0100 Subject: [Truffle] Support for long[]/double[] in TypeSystem Message-ID: <22BF735A-CF15-4486-984F-22C960F07C2B@stefan-marr.de> Hi: I wanted to briefly see whether primitive arrays will give a significant speedup to see what the potential for collection strategies is. However, I ran into an issue with the TruffleDSL, specifically, the processing of @TypeSystem. Looks like primitive arrays are currently not supported. At least I get the error/stack trace below (both on TruffleSOM as well as SimpleLanguage). ElementUtils.fromTypeMirror does seem to return null, instead of a TypeElement. Would it be possible to add support for primitive arrays? Hints how I could do that myself, and how I could debug an annotation processor would also be very much appreciate. Thanks Stefan Uncaught error in AnnotationProcessor while processing som.interpreter.Types: null java.lang.NullPointerException at com.oracle.truffle.dsl.processor.java.ElementUtils.getSuperType(ElementUtils.java:619) at com.oracle.truffle.dsl.processor.java.ElementUtils.getSuperTypes(ElementUtils.java:629) at com.oracle.truffle.dsl.processor.java.ElementUtils.getQualifiedSuperTypeNames(ElementUtils.java:521) at com.oracle.truffle.dsl.processor.parser.TypeSystemParser.verifyTypeOrder(TypeSystemParser.java:219) at com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parseTypes(TypeSystemParser.java:203) at com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parse(TypeSystemParser.java:70) at com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parse(TypeSystemParser.java:39) at com.oracle.truffle.dsl.processor.parser.AbstractParser.parse(AbstractParser.java:64) at com.oracle.truffle.dsl.processor.AnnotationProcessor.process(AnnotationProcessor.java:76) at com.oracle.truffle.dsl.processor.TruffleProcessor.processElement(TruffleProcessor.java:89) at com.oracle.truffle.dsl.processor.TruffleProcessor.processImpl(TruffleProcessor.java:65) at com.oracle.truffle.dsl.processor.TruffleProcessor.process(TruffleProcessor.java:51) at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139) at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121) at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159) at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134) at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:818) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434) at -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From java at stefan-marr.de Wed Dec 3 14:48:28 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 3 Dec 2014 15:48:28 +0100 Subject: Truffle: share frame descriptor among cloned call targets In-Reply-To: <54511219.4020700@jku.at> References: <201410280200.s9S20B4l003851@aojmv0008> <54511219.4020700@jku.at> Message-ID: <8983A1C5-64A8-4951-BC52-8A8714C9E289@stefan-marr.de> Hi: Kind of related to this old thread: I am having issues with current handling of splitting in Truffle/Graal and my handling of lexical scopes, spitting, and ensuring that the right frame descriptors are used for different copies of ASTs. In TruffleSOM, when a method is split, all type-specific specialization information are also split, which includes frame descriptors. For blocks/lambdas embedded into a split method this means they are also copied and will use the frame descriptors of the correct copy of the outer scopes. Until recently, this all worked pretty well, and enabled completely independent specialization of frame types for all copies of a method. However, with the change of the splitting API, I can?t guarantee the consistency of my ASTs anymore. The main issue is that the recursive NodeUtil.cloneNode is used, without giving my any ability to fix up the ASTs after the cloning. Before, I was able to do the cloning completely myself, and afterwards send a NodeVisitor over the tree to fix up all relevant nodes. With the current API design, that is not possible anymore. And for some reason, which I don?t entirely understand yet, cloning the root node in copy() myself, while NodeUtil.cloneNode is doing its thing, can lead to inconsistencies. So, would it be possible to expose a hook or something, in which I can fix up my ASTs after you cloned it? I remember there was also some discussion about this API change already, but I didn?t find it. Best regards Stefan > On 29 Oct 2014, at 17:13, Andreas Woess wrote: > > Short answer: because it could break code in a few cases. > > A shallowCopy() isn't really that useful anyway, since it also shares existing FrameSlot instances and thus also the FrameSlotKinds. You can still do a full copy by overriding the copy() method. We don't do this because it requires any nodes referencing FrameSlots to be updated which is hard to do reliably in the framework. > I've recently experimented with making this unnecessary, but I can't say yet whether this is going to happen. > > - andreas > > On 28/10/14 08:51, Stefan Marr wrote: >> Hi Andreas: >> >> Could you elaborate a little on this change? >> >>> On 28 Oct 2014, at 03:00, doug.simon at oracle.com wrote: >>> >>> Changeset: be1316e633b5 >>> Author: Andreas Woess >>> Date: 2014-10-27 14:33 +0100 >>> URL: http://hg.openjdk.java.net/graal/graal/rev/be1316e633b5 >>> >>> Truffle: share frame descriptor among cloned call targets >>> >>> ! graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >> I thought the idea was that the cloned AST trees can specialize themselves completely independently. Also with regard to the types in the frames. So, in TruffleSOM I am also making sure to clone the frame slots properly and clone all lexically embedded methods to have a proper match of descriptors and slot objects. >> >> Is all this not necessary anymore? >> >> Best regards >> Stefan >> > -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From chris.seaton at oracle.com Wed Dec 3 15:20:57 2014 From: chris.seaton at oracle.com (Chris Seaton) Date: Wed, 3 Dec 2014 15:20:57 +0000 Subject: [Truffle] Support for long[]/double[] in TypeSystem In-Reply-To: <22BF735A-CF15-4486-984F-22C960F07C2B@stefan-marr.de> References: <22BF735A-CF15-4486-984F-22C960F07C2B@stefan-marr.de> Message-ID: <15254112-E470-4E1A-A533-4F4C8AC275EB@oracle.com> Hi Stefan, I?m not sure about your specific error, but if you want to hear about how I applied storage strategies in Ruby catch me on Skype. We never wrote it up but I think we did some interesting work. I basically applied something like CF Bolz?s work, but instead of a strategy singleton the node itself kind of fulfils that role. And at the moment I?m detecting the strategy from the storage object type, not by any extra field in the object. Or are you planning something new unrelated to the PyPy approach? Chris > On 3 Dec 2014, at 09:29, Stefan Marr wrote: > > Hi: > > I wanted to briefly see whether primitive arrays will give a significant speedup to see what the potential for collection strategies is. However, I ran into an issue with the TruffleDSL, specifically, the processing of @TypeSystem. > > Looks like primitive arrays are currently not supported. > At least I get the error/stack trace below (both on TruffleSOM as well as SimpleLanguage). > > ElementUtils.fromTypeMirror does seem to return null, instead of a TypeElement. > > Would it be possible to add support for primitive arrays? > > Hints how I could do that myself, and how I could debug an annotation processor would also be very much appreciate. > > Thanks > Stefan > > Uncaught error in AnnotationProcessor while processing som.interpreter.Types: null java.lang.NullPointerException at > com.oracle.truffle.dsl.processor.java.ElementUtils.getSuperType(ElementUtils.java:619) at com.oracle.truffle.dsl.processor.java.ElementUtils.getSuperTypes(ElementUtils.java:629) at > com.oracle.truffle.dsl.processor.java.ElementUtils.getQualifiedSuperTypeNames(ElementUtils.java:521) at > com.oracle.truffle.dsl.processor.parser.TypeSystemParser.verifyTypeOrder(TypeSystemParser.java:219) at > com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parseTypes(TypeSystemParser.java:203) at com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parse(TypeSystemParser.java:70) > at com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parse(TypeSystemParser.java:39) at com.oracle.truffle.dsl.processor.parser.AbstractParser.parse(AbstractParser.java:64) at > com.oracle.truffle.dsl.processor.AnnotationProcessor.process(AnnotationProcessor.java:76) at com.oracle.truffle.dsl.processor.TruffleProcessor.processElement(TruffleProcessor.java:89) at > com.oracle.truffle.dsl.processor.TruffleProcessor.processImpl(TruffleProcessor.java:65) at com.oracle.truffle.dsl.processor.TruffleProcessor.process(TruffleProcessor.java:51) at > org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139) at > org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121) at > org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159) at > org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134) at > org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:818) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434) at > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ > > > From java at stefan-marr.de Wed Dec 3 17:55:28 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 3 Dec 2014 18:55:28 +0100 Subject: [Truffle] Support for long[]/double[] in TypeSystem In-Reply-To: <15254112-E470-4E1A-A533-4F4C8AC275EB@oracle.com> References: <22BF735A-CF15-4486-984F-22C960F07C2B@stefan-marr.de> <15254112-E470-4E1A-A533-4F4C8AC275EB@oracle.com> Message-ID: Hi Chris: > On 03 Dec 2014, at 16:20, Chris Seaton wrote: > [?] > Or are you planning something new unrelated to the PyPy approach? Not really, I wanted to see what the potential gain is of having long/double arrays. Would be nice to get the benchmarks that use a lot of arrays a little faster, but, it is really just ?would be nice?. Best regards Stefan -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From christian.humer at gmail.com Wed Dec 3 20:14:49 2014 From: christian.humer at gmail.com (Christian Humer) Date: Wed, 3 Dec 2014 21:14:49 +0100 Subject: [Truffle] Support for long[]/double[] in TypeSystem In-Reply-To: <22BF735A-CF15-4486-984F-22C960F07C2B@stefan-marr.de> References: <22BF735A-CF15-4486-984F-22C960F07C2B@stefan-marr.de> Message-ID: Hi Stefan, You are right primitive arrays are broken. No wonder they were not tested at all. I've attached a patch. Its going to get integrated on openjdk this night. Thanks for the report. - Christian Humer On Wed, Dec 3, 2014 at 10:29 AM, Stefan Marr wrote: > Hi: > > I wanted to briefly see whether primitive arrays will give a significant > speedup to see what the potential for collection strategies is. However, I > ran into an issue with the TruffleDSL, specifically, the processing of > @TypeSystem. > > Looks like primitive arrays are currently not supported. > At least I get the error/stack trace below (both on TruffleSOM as well as > SimpleLanguage). > > ElementUtils.fromTypeMirror does seem to return null, instead of a > TypeElement. > > Would it be possible to add support for primitive arrays? > > Hints how I could do that myself, and how I could debug an annotation > processor would also be very much appreciate. > > Thanks > Stefan > > Uncaught error in AnnotationProcessor while processing > som.interpreter.Types: null java.lang.NullPointerException at > com.oracle.truffle.dsl.processor.java.ElementUtils.getSuperType(ElementUtils.java:619) > at > com.oracle.truffle.dsl.processor.java.ElementUtils.getSuperTypes(ElementUtils.java:629) > at > com.oracle.truffle.dsl.processor.java.ElementUtils.getQualifiedSuperTypeNames(ElementUtils.java:521) > at > com.oracle.truffle.dsl.processor.parser.TypeSystemParser.verifyTypeOrder(TypeSystemParser.java:219) > at > com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parseTypes(TypeSystemParser.java:203) > at > com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parse(TypeSystemParser.java:70) > at > com.oracle.truffle.dsl.processor.parser.TypeSystemParser.parse(TypeSystemParser.java:39) > at > com.oracle.truffle.dsl.processor.parser.AbstractParser.parse(AbstractParser.java:64) > at > com.oracle.truffle.dsl.processor.AnnotationProcessor.process(AnnotationProcessor.java:76) > at > com.oracle.truffle.dsl.processor.TruffleProcessor.processElement(TruffleProcessor.java:89) > at > com.oracle.truffle.dsl.processor.TruffleProcessor.processImpl(TruffleProcessor.java:65) > at > com.oracle.truffle.dsl.processor.TruffleProcessor.process(TruffleProcessor.java:51) > at > org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139) > at > org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121) > at > org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159) > at > org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134) > at > org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:818) > at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434) at > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ > > > > -------------- next part -------------- # HG changeset patch # Parent 43e2cc9a4fde1d5c631569874e55d3b45922925d Truffle-DSL: fixed several bugs when using arrays as type. added arrays test. diff -r 43e2cc9a4fde graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ArrayTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ArrayTest.java Wed Dec 03 21:02:27 2014 +0100 @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.truffle.api.dsl.test; + +import org.junit.*; + +import com.oracle.truffle.api.*; +import com.oracle.truffle.api.dsl.*; +import com.oracle.truffle.api.dsl.test.ArrayTestFactory.TestNode1Factory; +import com.oracle.truffle.api.frame.*; +import com.oracle.truffle.api.nodes.*; + +public class ArrayTest { + + @Test + public void testNode1() { + final TestNode1 node = TestNode1Factory.create(null); + RootNode root = new RootNode() { + @Child TestNode1 test = node; + + @Override + public Object execute(VirtualFrame frame) { + return test.executeWith(frame, frame.getArguments()[0]); + } + }; + CallTarget target = Truffle.getRuntime().createCallTarget(root); + + Assert.assertEquals(1, (int) target.call(1)); + Assert.assertArrayEquals(new double[0], (double[]) target.call(new int[0]), 0.0d); + Assert.assertArrayEquals(new double[0], (double[]) target.call(new double[0]), 0.0d); + Assert.assertArrayEquals(new String[0], (String[]) target.call((Object) new String[0])); + } + + @TypeSystemReference(ArrayTypeSystem.class) + abstract static class BaseNode extends Node { + + abstract Object execute(VirtualFrame frame); + + int executeInt(VirtualFrame frame) throws UnexpectedResultException { + return ArrayTypeSystemGen.ARRAYTYPESYSTEM.expectInteger(execute(frame)); + } + + int[] executeIntArray(VirtualFrame frame) throws UnexpectedResultException { + return ArrayTypeSystemGen.ARRAYTYPESYSTEM.expectIntArray(execute(frame)); + } + + String[] executeStringArray(VirtualFrame frame) throws UnexpectedResultException { + return ArrayTypeSystemGen.ARRAYTYPESYSTEM.expectStringArray(execute(frame)); + } + + double[] executeDoubleArray(VirtualFrame frame) throws UnexpectedResultException { + return ArrayTypeSystemGen.ARRAYTYPESYSTEM.expectDoubleArray(execute(frame)); + } + } + + @NodeChild + abstract static class TestNode1 extends BaseNode { + + abstract Object executeWith(VirtualFrame frame, Object operand); + + @Specialization + int doInt(int value) { + return value; + } + + @Specialization + double[] doDoubleArray(double[] value) { + return value; + } + + @Specialization + String[] doStringArray(String[] value) { + return value; + } + + } + + @TypeSystem({int.class, int[].class, double[].class, String[].class, Object[].class}) + public static class ArrayTypeSystem { + + @ImplicitCast + public double[] castFromInt(int[] array) { + double[] newArray = new double[array.length]; + for (int i = 0; i < array.length; i++) { + newArray[i] = array[i]; + } + return newArray; + } + + @TypeCheck + public boolean isIntArray(Object array) { + return array instanceof int[]; + } + + @TypeCast + public int[] asIntArray(Object array) { + return (int[]) array; + } + + } + +} diff -r 43e2cc9a4fde graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java Wed Dec 03 18:53:22 2014 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java Wed Dec 03 21:02:27 2014 +0100 @@ -322,12 +322,12 @@ /** *
      * variant1 $condition != null
-     * 
+     *
      * $type $name = defaultValue($type);
      * if ($condition) {
      *     $name = $value;
      * }
-     * 
+     *
      * variant2 $condition != null
      * $type $name = $value;
      * 
@@ -1993,7 +1993,7 @@ } String prefix = expect ? "expect" : "execute"; String suffix = execution.getIndex() > -1 ? String.valueOf(execution.getIndex()) : ""; - return prefix + ElementUtils.firstLetterUpperCase(child.getName()) + ElementUtils.firstLetterUpperCase(ElementUtils.getSimpleName(param.getType())) + suffix; + return prefix + ElementUtils.firstLetterUpperCase(child.getName()) + ElementUtils.firstLetterUpperCase(ElementUtils.getTypeId(param.getType())) + suffix; } private List createExecuteChilds(Parameter param, Set expectTypes) { diff -r 43e2cc9a4fde graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTreeBuilder.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTreeBuilder.java Wed Dec 03 18:53:22 2014 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTreeBuilder.java Wed Dec 03 21:02:27 2014 +0100 @@ -672,10 +672,6 @@ } public CodeTreeBuilder instanceOf(String var, TypeMirror type) { - TypeElement element = ElementUtils.fromTypeMirror(type); - if (element == null) { - throw new IllegalArgumentException("Cannot call instanceof for a non supported type: " + type.getKind()); - } return instanceOf(singleString(var), singleType(type)); } diff -r 43e2cc9a4fde graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java Wed Dec 03 18:53:22 2014 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java Wed Dec 03 21:02:27 2014 +0100 @@ -139,7 +139,7 @@ public TypeData findType(String simpleName) { for (TypeData type : types) { - if (ElementUtils.getSimpleName(type.getBoxedType()).equals(simpleName)) { + if (ElementUtils.getTypeId(type.getBoxedType()).equals(simpleName)) { return type; } } diff -r 43e2cc9a4fde graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeSystemParser.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeSystemParser.java Wed Dec 03 18:53:22 2014 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeSystemParser.java Wed Dec 03 21:02:27 2014 +0100 @@ -216,7 +216,11 @@ typeData.addError("Invalid type order. The type(s) %s are inherited from a earlier defined type %s.", invalidTypes.get(ElementUtils.getQualifiedName(type)), ElementUtils.getQualifiedName(type)); } - List nextInvalidTypes = ElementUtils.getQualifiedSuperTypeNames(ElementUtils.fromTypeMirror(type)); + TypeElement element = ElementUtils.fromTypeMirror(type); + List nextInvalidTypes = new ArrayList<>(); + if (element != null) { + nextInvalidTypes.addAll(ElementUtils.getQualifiedSuperTypeNames(element)); + } nextInvalidTypes.add(getQualifiedName(type)); for (String qualifiedName : nextInvalidTypes) { From doug.simon at oracle.com Thu Dec 4 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Thu, 04 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: 10 new changesets Message-ID: <201412040200.sB4208fG018905@aojmv0008> Changeset: 5afa718edb8b Author: Bernhard Urban Date: 2014-12-03 10:35 +0200 URL: http://hg.openjdk.java.net/graal/graal/rev/5afa718edb8b arraycopy: move related classes to dedicated package ! graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotReplacementsImpl.java ! graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckcastArrayCopyCallNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeArrayCopyNode.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeArrayCopySnippets.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyNode.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java Changeset: 95ec1f6723ac Author: Bernhard Urban Date: 2014-12-03 09:53 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/95ec1f6723ac ArrayCopyNode: simplify condition ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyNode.java Changeset: d806707624bb Author: Bernhard Urban Date: 2014-12-03 14:29 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d806707624bb amd64 register config: reserve "home space" on windows in frame. ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java Changeset: 68cab2726edb Author: Bernhard Urban Date: 2014-12-03 14:31 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/68cab2726edb arraycopytests: test for disjoint ! graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java Changeset: f6ca61099649 Author: Bernhard Urban Date: 2014-12-03 14:50 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/f6ca61099649 arraycopy: don't use checkcast stub if the arrays overlap ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Changeset: 676f1800077c Author: Doug Simon Date: 2014-12-03 16:02 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/676f1800077c mx: removed unused _read_projects_file function ! mx/mx_graal.py ! mxtool/mx.py Changeset: 7d8270532cd9 Author: Doug Simon Date: 2014-12-03 16:07 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/7d8270532cd9 mx: changes towards supporting python 2.6 for call to mx from make/Makefile ! make/Makefile ! mx/mx_graal.py ! mxtool/mx.py Changeset: 43e2cc9a4fde Author: Doug Simon Date: 2014-12-03 18:53 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/43e2cc9a4fde removed reference to com.oracle.graal.compiler.CompilerThread from VM code ! src/share/vm/classfile/systemDictionary.cpp ! src/share/vm/classfile/systemDictionary.hpp ! src/share/vm/runtime/thread.cpp Changeset: 39441c10d314 Author: Doug Simon Date: 2014-12-03 22:10 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/39441c10d314 try to be more precise about python executable name ! make/Makefile Changeset: 58eb9bbb60c4 Author: Christian Humer Date: 2014-12-03 21:02 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/58eb9bbb60c4 Truffle-DSL: fixed several bugs when using arrays as type. added arrays test. + graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ArrayTest.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTreeBuilder.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeSystemParser.java From doug.simon at oracle.com Fri Dec 5 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Fri, 05 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 28 new changesets Message-ID: <201412050200.sB5208i5001311@aojmv0008> Changeset: 3d0422b6f8fa Author: Josef Eisl Date: 2014-12-04 10:51 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3d0422b6f8fa mx gate: execute unittests with --fail-fast option. ! mx/mx_graal.py Changeset: 6383574293f9 Author: Josef Eisl Date: 2014-12-03 17:16 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6383574293f9 Introduce FrameMap.clearReference(). ! graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ReferenceMap.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java ! graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMap.java Changeset: 66e31efead2f Author: Josef Eisl Date: 2014-12-02 17:39 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/66e31efead2f Make ReferenceMap Clonable. ! graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ReferenceMap.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java Changeset: c7fe48cd8087 Author: Josef Eisl Date: 2014-12-03 19:42 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c7fe48cd8087 Add ReferenceMap.mergeMaps(). ! graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ReferenceMap.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java ! graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java Changeset: 6a6291c31657 Author: Josef Eisl Date: 2014-12-03 20:40 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6a6291c31657 Add LocationMarker. ! graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java + graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LocationMarker.java Changeset: 20e498cfa409 Author: Bernhard Urban Date: 2014-12-04 12:13 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/20e498cfa409 checkcastArraycopy: if src and dest are equal, unchecked variant can be used ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Changeset: 4a88dacfcb17 Author: Doug Simon Date: 2014-12-04 13:41 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/4a88dacfcb17 removed reference to com.oracle.graal.compiler.CompilerThread from VM code (part 2) ! src/share/vm/classfile/vmSymbols.hpp Changeset: 8c3a85077f84 Author: Doug Simon Date: 2014-12-04 13:41 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8c3a85077f84 mx: run findbugs with the appropriate jdk ! mx/mx_graal.py Changeset: c307546c7b0a Author: Doug Simon Date: 2014-12-04 13:42 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c307546c7b0a made initialization of the Graal class loader and well known Graal classes lazy ! graal/com.oracle.graal.hotspot.loader/src/com/oracle/graal/hotspot/loader/Factory.java ! src/share/vm/classfile/systemDictionary.cpp ! src/share/vm/classfile/systemDictionary.hpp ! src/share/vm/graal/graalCompiler.cpp ! src/share/vm/graal/graalRuntime.cpp ! src/share/vm/graal/graalRuntime.hpp ! src/share/vm/prims/nativeLookup.cpp ! src/share/vm/runtime/thread.cpp Changeset: c2da0aa9e675 Author: Doug Simon Date: 2014-12-04 13:48 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c2da0aa9e675 Merge. Changeset: b0fabf67614a Author: Josef Eisl Date: 2014-12-04 14:39 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/b0fabf67614a Rename ReferenceMap.mergeMaps() to updateUnion(). ! graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ReferenceMap.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LocationMarker.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java ! graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java Changeset: 56c6eb8f5261 Author: Josef Eisl Date: 2014-12-04 14:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/56c6eb8f5261 Rename LIRFrameState.markLocation(ReferenceMap) to updateUnion(ReferenceMap). ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LocationMarker.java ! graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java Changeset: 0aec14bcf006 Author: Doug Simon Date: 2014-12-04 15:28 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/0aec14bcf006 ensure the error message about missing Graal classes is printed exactly once ! src/share/vm/graal/graalRuntime.cpp Changeset: 965f1e08c083 Author: Doug Simon Date: 2014-12-04 16:12 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/965f1e08c083 Merge. Changeset: 23de014b38ab Author: Andreas Woess Date: 2014-12-04 19:50 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/23de014b38ab mx: fix missing frozenset constructor to fix intersection ! mxtool/mx.py Changeset: b3b241bbbbdb Author: Andreas Woess Date: 2014-12-04 13:35 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/b3b241bbbbdb OM: rename transitions ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/Transition.java Changeset: a306a94111a6 Author: Andreas Woess Date: 2014-11-28 15:43 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a306a94111a6 OM: iterate over properties using property map instead of parent chain ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java Changeset: 8bf798e8cf11 Author: Andreas Woess Date: 2014-12-04 18:08 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8bf798e8cf11 OM: remember transition from parent and walk transitions instead of properties in replaceProperty,removeProperty ! graal/com.oracle.truffle.object.basic/src/com/oracle/truffle/object/basic/ShapeBasic.java ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java Changeset: a9a14b31f3b3 Author: Andreas Woess Date: 2014-12-04 14:42 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a9a14b31f3b3 OM: lazy initialization of leaf assumption ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java Changeset: 073e7f314516 Author: Andreas Woess Date: 2014-12-04 19:24 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/073e7f314516 OM: add Transition#isDirect() ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/Transition.java Changeset: ce46f909c176 Author: Andreas Woess Date: 2014-12-04 19:31 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/ce46f909c176 OM: record replaceProperty transitions ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/Transition.java Changeset: 196cf131ed32 Author: Andreas Woess Date: 2014-12-04 19:36 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/196cf131ed32 OM: extract queryTransition method ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java Changeset: 4ca70b51c8bb Author: Doug Simon Date: 2014-12-04 23:09 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/4ca70b51c8bb improved comments ! src/share/vm/graal/graalRuntime.cpp Changeset: caad1a70312d Author: Stefan Anzinger Date: 2014-12-03 10:59 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/caad1a70312d [SPARC] SPARCScratchRegister optionally logs the stacktrace where the register is requested (Just for debugging) ! graal/com.oracle.graal.sparc/src/com/oracle/graal/sparc/SPARCScratchRegister.java Changeset: 7cd79d18f71a Author: Stefan Anzinger Date: 2014-12-04 23:30 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/7cd79d18f71a [SPARC] fix concurrency issues in register configuration caching (Use concurrenthashmap) ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotRegisterConfig.java Changeset: 12bad81babff Author: Stefan Anzinger Date: 2014-12-04 23:33 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/12bad81babff [AMD64] fix concurrency issues in register configuration caching (Use concurrenthashmap) ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java Changeset: 5ec45cb4bf22 Author: Stefan Anzinger Date: 2014-12-04 23:34 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/5ec45cb4bf22 Merge ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeArrayCopyNode.java - graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeArrayCopySnippets.java Changeset: 8a03753546f3 Author: Stefan Anzinger Date: 2014-12-05 00:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8a03753546f3 Merge From doug.simon at oracle.com Fri Dec 5 09:45:11 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Fri, 05 Dec 2014 09:45:11 +0000 Subject: hg: graal/graal: 2 new changesets Message-ID: <201412050945.sB59jBf8018294@aojmv0008> Changeset: b4071daf1892 Author: Andreas Woess Date: 2014-12-05 03:30 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/b4071daf1892 ensure Graal class loader is initialized prior to loading HotSpotTruffleRuntime ! src/share/vm/graal/graalRuntime.cpp Changeset: a8b46348b79f Author: Doug Simon Date: 2014-12-05 08:20 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a8b46348b79f mx: converted format strings to be python 2.6 compliant ! mx/mx_graal.py ! mxtool/mx.py From doug.simon at oracle.com Fri Dec 5 10:44:40 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Fri, 05 Dec 2014 10:44:40 +0000 Subject: hg: graal/graal: mx: fixed issue with calling abort() before _opts is defined Message-ID: <201412051044.sB5AieZH029442@aojmv0008> Changeset: dcf5cd3c6da9 Author: Doug Simon Date: 2014-12-05 11:00 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/dcf5cd3c6da9 mx: fixed issue with calling abort() before _opts is defined ! mxtool/mx.py From doug.simon at oracle.com Sat Dec 6 01:29:30 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Sat, 06 Dec 2014 01:29:30 +0000 Subject: hg: graal/graal: 3 new changesets Message-ID: <201412060129.sB61TUgG011102@aojmv0008> Changeset: d5d1fbe270e9 Author: Doug Simon Date: 2014-12-05 19:13 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d5d1fbe270e9 mx: fixed format string ! mx/mx_graal.py Changeset: 0dac22d266d8 Author: Doug Simon Date: 2014-12-05 19:24 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/0dac22d266d8 always try decode both types of AMD64 safepoint patterns (i.e., near and far) when testing a PC for being a safepoint ! src/cpu/x86/vm/nativeInst_x86.hpp Changeset: 56f806632622 Author: Doug Simon Date: 2014-12-06 01:14 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/56f806632622 fixed bugs in support for arbitrary types in SubstitutionGuard constructors Contributed-by: Igor Veresov ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java From cristian.esquivias at gmail.com Sat Dec 6 22:46:46 2014 From: cristian.esquivias at gmail.com (Cristian Esquivias) Date: Sat, 6 Dec 2014 14:46:46 -0800 Subject: Truffle DSL with Array of Primitive Types Message-ID: I'm writing a simple lisp language to try out Truffle, but I'm running into problems implementing a plus function that takes a variable number of arguments. I figured the Truffle DSL can do the node rewriting for me and all I needed was to request an array of longs. Something like: @NodeChild(value = "arguments", type = Node.class) public abstract AddNode extends Node { @Specialization protected long add(long[] arguments) { long sum = 0; for (long arg : arguments) { sum += arg; } return sum; } } I'm not worrying about overflows right now. And Truffle would create an AddNodeFactory that will map Node#executeLong over all the arguments then call my add method, but I get a compilation error: "Method signature (long[]) does not match to the expected signature." It looks like an array isn't allowed. What's the preferred way of implementing (builtin) functions that take a variable number of arguments? The only thing I can think of right now is to do my own tree rewriting and write a custom node that does the mapping across the arguments myself. Thanks, Cristian From doug.simon at oracle.com Mon Dec 8 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Mon, 08 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 2 new changesets Message-ID: <201412080200.sB82096o015442@aojmv0008> Changeset: 02b5114b74c1 Author: Thomas Wuerthinger Date: 2014-12-05 11:09 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/02b5114b74c1 Started consolidation of options. Added descriptions. ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolderExplorable.java Changeset: e22a21b27036 Author: Thomas Wuerthinger Date: 2014-12-07 20:43 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/e22a21b27036 Merge. From java at stefan-marr.de Tue Dec 9 22:35:06 2014 From: java at stefan-marr.de (Stefan Marr) Date: Tue, 9 Dec 2014 23:35:06 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) Message-ID: Hi: In one of my experiments, I got a hard crash of the Graal VM. Error below. The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. Though, I haven?t managed to find a way to avoid crashes reliably. To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. git clone https://github.com/smarr/GraalVM.git cd GraalVM ./mx.sh --vm server build -p cd ../ git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git cd TruffleSOM ant ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 Best regards Stefan # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 # # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) # Problematic frame: # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 relocation [0x000000010d601e08,0x000000010d601e20] = 24 main code [0x000000010d601e20,0x000000010d601edd] = 189 stub code [0x000000010d601edd,0x000000010d601ee0] = 3 oops [0x000000010d601ee0,0x000000010d601ef8] = 24 metadata [0x000000010d601ef8,0x000000010d601f00] = 8 scopes data [0x000000010d601f00,0x000000010d601f18] = 24 scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 dependencies [0x000000010d601f48,0x000000010d601f50] = 8 Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 main code [0x000000010c77ba60,0x000000010c77bac0] = 96 stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 oops [0x000000010c77bae8,0x000000010c77baf0] = 8 metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java index 8d00194..0670fad 100644 --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget if (root == null || !root.isCloningAllowed()) { return null; } - return NodeUtil.cloneNode(root); + return root.cloneRootNode(); } public Assumption getNodeRewritingAssumption() { diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java index aebf748..2552eea 100644 --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { return false; } + public RootNode cloneRootNode() { + return NodeUtil.cloneNode(this); + } + /** * Reports the execution count of a loop that is a child of this node. The optimization * heuristics can use the loop count to guide compilation and inlining. -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From duboscq at ssw.jku.at Tue Dec 9 23:04:29 2014 From: duboscq at ssw.jku.at (Gilles Duboscq) Date: Wed, 10 Dec 2014 00:04:29 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: Message-ID: Hello Stefan, Thanks for the report. Could you send us the hs_err file as well (hs_err_pid68949.log)? -Gilles On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: > Hi: > > In one of my experiments, I got a hard crash of the Graal VM. > Error below. > > The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. > Though, I haven?t managed to find a way to avoid crashes reliably. > > To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. > > git clone https://github.com/smarr/GraalVM.git > cd GraalVM > ./mx.sh --vm server build -p > cd ../ > git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git > cd TruffleSOM > ant > ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 > > Best regards > Stefan > > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 > # > # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) > # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) > # Problematic frame: > # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] > # > # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again > # > # An error report file with more information is saved as: > # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log > Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib > Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) > total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 > relocation [0x000000010d601e08,0x000000010d601e20] = 24 > main code [0x000000010d601e20,0x000000010d601edd] = 189 > stub code [0x000000010d601edd,0x000000010d601ee0] = 3 > oops [0x000000010d601ee0,0x000000010d601ef8] = 24 > metadata [0x000000010d601ef8,0x000000010d601f00] = 8 > scopes data [0x000000010d601f00,0x000000010d601f18] = 24 > scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 > dependencies [0x000000010d601f48,0x000000010d601f50] = 8 > Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) > total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 > relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 > main code [0x000000010c77ba60,0x000000010c77bac0] = 96 > stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 > oops [0x000000010c77bae8,0x000000010c77baf0] = 8 > metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 > scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 > scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 > dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 > handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 > > > diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java > index 8d00194..0670fad 100644 > --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java > +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java > @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget > if (root == null || !root.isCloningAllowed()) { > return null; > } > - return NodeUtil.cloneNode(root); > + return root.cloneRootNode(); > } > > public Assumption getNodeRewritingAssumption() { > diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java > index aebf748..2552eea 100644 > --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java > +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java > @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { > return false; > } > > + public RootNode cloneRootNode() { > + return NodeUtil.cloneNode(this); > + } > + > /** > * Reports the execution count of a loop that is a child of this node. The optimization > * heuristics can use the loop count to guide compilation and inlining. > > > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ > > > From java at stefan-marr.de Tue Dec 9 23:15:42 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 10 Dec 2014 00:15:42 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: Message-ID: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> Hi Gilles: Here the log file. Best regards Stefan -------------- next part -------------- > On 10 Dec 2014, at 00:04, Gilles Duboscq wrote: > > Hello Stefan, > > Thanks for the report. > Could you send us the hs_err file as well (hs_err_pid68949.log)? > > -Gilles > > On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: >> Hi: >> >> In one of my experiments, I got a hard crash of the Graal VM. >> Error below. >> >> The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. >> Though, I haven?t managed to find a way to avoid crashes reliably. >> >> To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. >> >> git clone https://github.com/smarr/GraalVM.git >> cd GraalVM >> ./mx.sh --vm server build -p >> cd ../ >> git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git >> cd TruffleSOM >> ant >> ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 >> >> Best regards >> Stefan >> >> >> # >> # A fatal error has been detected by the Java Runtime Environment: >> # >> # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 >> # >> # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) >> # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) >> # Problematic frame: >> # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] >> # >> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again >> # >> # An error report file with more information is saved as: >> # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log >> Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib >> Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) >> total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 >> relocation [0x000000010d601e08,0x000000010d601e20] = 24 >> main code [0x000000010d601e20,0x000000010d601edd] = 189 >> stub code [0x000000010d601edd,0x000000010d601ee0] = 3 >> oops [0x000000010d601ee0,0x000000010d601ef8] = 24 >> metadata [0x000000010d601ef8,0x000000010d601f00] = 8 >> scopes data [0x000000010d601f00,0x000000010d601f18] = 24 >> scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 >> dependencies [0x000000010d601f48,0x000000010d601f50] = 8 >> Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) >> total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 >> relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 >> main code [0x000000010c77ba60,0x000000010c77bac0] = 96 >> stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 >> oops [0x000000010c77bae8,0x000000010c77baf0] = 8 >> metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 >> scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 >> scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 >> dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 >> handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 >> >> >> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >> index 8d00194..0670fad 100644 >> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >> @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget >> if (root == null || !root.isCloningAllowed()) { >> return null; >> } >> - return NodeUtil.cloneNode(root); >> + return root.cloneRootNode(); >> } >> >> public Assumption getNodeRewritingAssumption() { >> diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >> index aebf748..2552eea 100644 >> --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >> +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >> @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { >> return false; >> } >> >> + public RootNode cloneRootNode() { >> + return NodeUtil.cloneNode(this); >> + } >> + >> /** >> * Reports the execution count of a loop that is a child of this node. The optimization >> * heuristics can use the loop count to guide compilation and inlining. >> >> >> >> -- >> Stefan Marr >> INRIA Lille - Nord Europe >> http://stefan-marr.de/research/ >> >> >> -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From doug.simon at oracle.com Wed Dec 10 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Wed, 10 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 15 new changesets Message-ID: <201412100200.sBA208ss026277@aojmv0008> Changeset: 133d5a98c547 Author: Doug Simon Date: 2014-12-08 14:32 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/133d5a98c547 generalized semantics of DebugDumpHandler.close() to mean reset so that closing a handler flushes and releases all its resources but leaves it operational (i.e. subsequent uses will (re)create and (re)open the required resources) ! graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java ! graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java ! graal/com.oracle.graal.printer/src/com/oracle/graal/printer/DecompilerDebugDumpHandler.java ! graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Changeset: 3e71078c2efe Author: Doug Simon Date: 2014-12-08 14:33 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3e71078c2efe converted use of '==' to .equals() to support replay compilation ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Changeset: 47263ffe47bd Author: Doug Simon Date: 2014-12-08 14:34 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/47263ffe47bd made lambdas stored in Nodes be Serializable ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AbsNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NarrowNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NotNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RemNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SignExtendNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SqrtNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnaryArithmeticNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java ! graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64FloatConvertNode.java Changeset: f08d320a77d0 Author: Doug Simon Date: 2014-12-08 14:35 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/f08d320a77d0 use deterministic iteration-order data structures ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerationResult.java Changeset: 290dc460feb3 Author: Doug Simon Date: 2014-12-08 20:41 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/290dc460feb3 use better types to simplify instantiation of Serializable lambdas ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AbsNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NarrowNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NotNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RemNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SignExtendNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SqrtNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnaryArithmeticNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java ! graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64FloatConvertNode.java Changeset: beb33138029c Author: Christian Wimmer Date: 2014-12-08 17:45 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/beb33138029c Clean bin directory before compiling to remove stale classfiles ! mxtool/mx.py Changeset: a1584e21457c Author: Roland Schatz Date: 2014-12-09 15:39 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a1584e21457c Use ReadNode to read Klass pointer. ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/HotSpotWordTypeRewriterPhase.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaReadNode.java Changeset: d138867d61c4 Author: Roland Schatz Date: 2014-12-09 16:55 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d138867d61c4 Remove getValueKind() from LocationNode. ! graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java ! graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotLoweringProvider.java ! graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ClassGetHubNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/KlassLayoutHelperNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/HotSpotWordTypeRewriterPhase.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ConstantLocationNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaReadNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaWriteNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AtomicReadAndAddNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringProvider.java ! graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java ! graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java ! graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java ! graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Changeset: 39df3f428d5c Author: Roland Schatz Date: 2014-12-09 17:06 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/39df3f428d5c Temporarily disable LocationMarker. ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LocationMarker.java Changeset: 8c753e6fab96 Author: Doug Simon Date: 2014-12-09 21:58 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8c753e6fab96 added mechanism for recomputing IterableNodeType lists in a Graph after deserialization ! graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java ! graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java Changeset: dfacef5b7958 Author: Doug Simon Date: 2014-12-09 22:04 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/dfacef5b7958 remove uses of Unsafe in HotSpotVMConfig methods that may be executed on a deserialized HotSpotVMConfig object ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfigVerifier.java Changeset: 8bdc3428cf0e Author: Doug Simon Date: 2014-12-09 22:04 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8bdc3428cf0e split out unit tests ! graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopParseLong.java Changeset: 7c31de47cf48 Author: Doug Simon Date: 2014-12-09 22:28 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/7c31de47cf48 removed replay compilation testing from GraalCompilerTest and placed hooks for it to be tested externally ! graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Changeset: 86269e451920 Author: Doug Simon Date: 2014-12-09 23:44 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/86269e451920 removed (most) replay compilation support + graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/CollectionsFactory.java + graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/LinkedIdentityHashMap.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Handler.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Invocation.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/LinkedIdentityHashMap.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/ProxyUtil.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java ! graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerationResult.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstantImpl.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstantImpl.java ! graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopsData.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectsClosure.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Changeset: de362aafce05 Author: Doug Simon Date: 2014-12-09 23:53 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/de362aafce05 fixed findbugs issue ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfigVerifier.java From duboscq at ssw.jku.at Wed Dec 10 10:53:12 2014 From: duboscq at ssw.jku.at (Gilles Duboscq) Date: Wed, 10 Dec 2014 11:53:12 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> Message-ID: Hello Stefan, I see a lot of unsafeCast calls where the last argument is true. That sounds dangerous. Are you sure your casts really *always* hold? Regardless of control-flow? This argument should be the condition under which that cast is safe, which is usually a condition that you have already checked in the control-flow that leads to the cast. -Gilles On Wed, Dec 10, 2014 at 12:15 AM, Stefan Marr wrote: > Hi Gilles: > > Here the log file. > > Best regards > Stefan > > > > > >> On 10 Dec 2014, at 00:04, Gilles Duboscq wrote: >> >> Hello Stefan, >> >> Thanks for the report. >> Could you send us the hs_err file as well (hs_err_pid68949.log)? >> >> -Gilles >> >> On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: >>> Hi: >>> >>> In one of my experiments, I got a hard crash of the Graal VM. >>> Error below. >>> >>> The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. >>> Though, I haven?t managed to find a way to avoid crashes reliably. >>> >>> To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. >>> >>> git clone https://github.com/smarr/GraalVM.git >>> cd GraalVM >>> ./mx.sh --vm server build -p >>> cd ../ >>> git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git >>> cd TruffleSOM >>> ant >>> ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 >>> >>> Best regards >>> Stefan >>> >>> >>> # >>> # A fatal error has been detected by the Java Runtime Environment: >>> # >>> # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 >>> # >>> # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) >>> # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) >>> # Problematic frame: >>> # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] >>> # >>> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again >>> # >>> # An error report file with more information is saved as: >>> # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log >>> Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib >>> Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) >>> total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 >>> relocation [0x000000010d601e08,0x000000010d601e20] = 24 >>> main code [0x000000010d601e20,0x000000010d601edd] = 189 >>> stub code [0x000000010d601edd,0x000000010d601ee0] = 3 >>> oops [0x000000010d601ee0,0x000000010d601ef8] = 24 >>> metadata [0x000000010d601ef8,0x000000010d601f00] = 8 >>> scopes data [0x000000010d601f00,0x000000010d601f18] = 24 >>> scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 >>> dependencies [0x000000010d601f48,0x000000010d601f50] = 8 >>> Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) >>> total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 >>> relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 >>> main code [0x000000010c77ba60,0x000000010c77bac0] = 96 >>> stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 >>> oops [0x000000010c77bae8,0x000000010c77baf0] = 8 >>> metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 >>> scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 >>> scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 >>> dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 >>> handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 >>> >>> >>> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>> index 8d00194..0670fad 100644 >>> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>> @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget >>> if (root == null || !root.isCloningAllowed()) { >>> return null; >>> } >>> - return NodeUtil.cloneNode(root); >>> + return root.cloneRootNode(); >>> } >>> >>> public Assumption getNodeRewritingAssumption() { >>> diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>> index aebf748..2552eea 100644 >>> --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>> +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>> @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { >>> return false; >>> } >>> >>> + public RootNode cloneRootNode() { >>> + return NodeUtil.cloneNode(this); >>> + } >>> + >>> /** >>> * Reports the execution count of a loop that is a child of this node. The optimization >>> * heuristics can use the loop count to guide compilation and inlining. >>> >>> >>> >>> -- >>> Stefan Marr >>> INRIA Lille - Nord Europe >>> http://stefan-marr.de/research/ >>> >>> >>> > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ > > > > From duboscq at ssw.jku.at Wed Dec 10 10:58:25 2014 From: duboscq at ssw.jku.at (Gilles Duboscq) Date: Wed, 10 Dec 2014 11:58:25 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> Message-ID: Sorry i mean the "condition" argument (which the second to last in your case). On Wed, Dec 10, 2014 at 11:53 AM, Gilles Duboscq wrote: > Hello Stefan, > > I see a lot of unsafeCast calls where the last argument is true. That > sounds dangerous. > Are you sure your casts really *always* hold? Regardless of > control-flow? This argument should be the condition under which that > cast is safe, which is usually a condition that you have already > checked in the control-flow that leads to the cast. > > -Gilles > > On Wed, Dec 10, 2014 at 12:15 AM, Stefan Marr wrote: >> Hi Gilles: >> >> Here the log file. >> >> Best regards >> Stefan >> >> >> >> >> >>> On 10 Dec 2014, at 00:04, Gilles Duboscq wrote: >>> >>> Hello Stefan, >>> >>> Thanks for the report. >>> Could you send us the hs_err file as well (hs_err_pid68949.log)? >>> >>> -Gilles >>> >>> On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: >>>> Hi: >>>> >>>> In one of my experiments, I got a hard crash of the Graal VM. >>>> Error below. >>>> >>>> The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. >>>> Though, I haven?t managed to find a way to avoid crashes reliably. >>>> >>>> To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. >>>> >>>> git clone https://github.com/smarr/GraalVM.git >>>> cd GraalVM >>>> ./mx.sh --vm server build -p >>>> cd ../ >>>> git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git >>>> cd TruffleSOM >>>> ant >>>> ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 >>>> >>>> Best regards >>>> Stefan >>>> >>>> >>>> # >>>> # A fatal error has been detected by the Java Runtime Environment: >>>> # >>>> # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 >>>> # >>>> # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) >>>> # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) >>>> # Problematic frame: >>>> # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] >>>> # >>>> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again >>>> # >>>> # An error report file with more information is saved as: >>>> # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log >>>> Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib >>>> Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) >>>> total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 >>>> relocation [0x000000010d601e08,0x000000010d601e20] = 24 >>>> main code [0x000000010d601e20,0x000000010d601edd] = 189 >>>> stub code [0x000000010d601edd,0x000000010d601ee0] = 3 >>>> oops [0x000000010d601ee0,0x000000010d601ef8] = 24 >>>> metadata [0x000000010d601ef8,0x000000010d601f00] = 8 >>>> scopes data [0x000000010d601f00,0x000000010d601f18] = 24 >>>> scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 >>>> dependencies [0x000000010d601f48,0x000000010d601f50] = 8 >>>> Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) >>>> total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 >>>> relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 >>>> main code [0x000000010c77ba60,0x000000010c77bac0] = 96 >>>> stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 >>>> oops [0x000000010c77bae8,0x000000010c77baf0] = 8 >>>> metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 >>>> scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 >>>> scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 >>>> dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 >>>> handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 >>>> >>>> >>>> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>> index 8d00194..0670fad 100644 >>>> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>> @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget >>>> if (root == null || !root.isCloningAllowed()) { >>>> return null; >>>> } >>>> - return NodeUtil.cloneNode(root); >>>> + return root.cloneRootNode(); >>>> } >>>> >>>> public Assumption getNodeRewritingAssumption() { >>>> diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>> index aebf748..2552eea 100644 >>>> --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>> +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>> @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { >>>> return false; >>>> } >>>> >>>> + public RootNode cloneRootNode() { >>>> + return NodeUtil.cloneNode(this); >>>> + } >>>> + >>>> /** >>>> * Reports the execution count of a loop that is a child of this node. The optimization >>>> * heuristics can use the loop count to guide compilation and inlining. >>>> >>>> >>>> >>>> -- >>>> Stefan Marr >>>> INRIA Lille - Nord Europe >>>> http://stefan-marr.de/research/ >>>> >>>> >>>> >> >> -- >> Stefan Marr >> INRIA Lille - Nord Europe >> http://stefan-marr.de/research/ >> >> >> >> From java at stefan-marr.de Wed Dec 10 11:22:35 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 10 Dec 2014 12:22:35 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> Message-ID: <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> Hi Gilles: > On 10 Dec 2014, at 11:53, Gilles Duboscq wrote: > > I see a lot of unsafeCast calls where the last argument is true. That > sounds dangerous. > Are you sure your casts really *always* hold? Regardless of > control-flow? This argument should be the condition under which that > cast is safe, which is usually a condition that you have already > checked in the control-flow that leads to the cast. I am not sure what you mean with ?always?. I use most of those casts to get rid of some of the null-checks I saw in IGV. Below is a patch that adds the assertions corresponding to the unsafeCasts. They do not trigger. Does that satisfy your definition of ?always?? Best regards Stefan diff --git a/src/som/interpreter/SArguments.java b/src/som/interpreter/SArguments.java index 64d5cd7..4ccc53e 100644 --- a/src/som/interpreter/SArguments.java +++ b/src/som/interpreter/SArguments.java @@ -8,10 +8,12 @@ public final class SArguments { private static final int RCVR_IDX = 0; private static Object[] args(final Frame frame) { + assert frame.getArguments() != null; return CompilerDirectives.unsafeCast(frame.getArguments(), Object[].class, true, true); } public static Object arg(final Frame frame, final int index) { + assert args(frame)[index] != null; return CompilerDirectives.unsafeCast(args(frame)[index], Object.class, true, true); } diff --git a/src/som/interpreter/nodes/ContextualNode.java b/src/som/interpreter/nodes/ContextualNode.java index ec83e48..84535aa 100644 --- a/src/som/interpreter/nodes/ContextualNode.java +++ b/src/som/interpreter/nodes/ContextualNode.java @@ -62,14 +62,18 @@ public abstract class ContextualNode extends ExpressionNode { int i = contextLevel - 1; while (i > 0) { - self = CompilerDirectives.unsafeCast(self.getOuterSelf(), SBlock.class, true, true); + Object b = self.getOuterSelf(); + assert b instanceof SBlock && b != null; + self = CompilerDirectives.unsafeCast(b, SBlock.class, true, true); i--; } return self.getContext(); } private SBlock getLocalSelf(final VirtualFrame frame) { - return CompilerDirectives.unsafeCast(FrameUtil.getObjectSafe(frame, localSelf), SBlock.class, true, true); + Object b = FrameUtil.getObjectSafe(frame, localSelf); + assert b instanceof SBlock && b != null; + return CompilerDirectives.unsafeCast(b, SBlock.class, true, true); } @ExplodeLoop @@ -77,6 +81,7 @@ public abstract class ContextualNode extends ExpressionNode { Object self = getLocalSelf(frame); int i = contextLevel; while (i > 0) { + assert self instanceof SBlock && self != null; SBlock block = CompilerDirectives.unsafeCast(self, SBlock.class, true, true); self = block.getOuterSelf(); i--; diff --git a/src/som/interpreter/nodes/FieldNode.java b/src/som/interpreter/nodes/FieldNode.java index 4077baa..98a4a4b 100644 --- a/src/som/interpreter/nodes/FieldNode.java +++ b/src/som/interpreter/nodes/FieldNode.java @@ -81,6 +81,7 @@ public abstract class FieldNode extends ExpressionNode { @Override public Object doPreEvaluated(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null && arguments[0] instanceof SObject; return executeEvaluated(CompilerDirectives.unsafeCast( arguments[0], SObject.class, true, true)); } @@ -134,6 +135,8 @@ public abstract class FieldNode extends ExpressionNode { @Override public final Object doPreEvaluated(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null && arguments[0] instanceof SObject; + assert arguments[1] != null; return executeEvaluated(frame, CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true), CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); diff --git a/src/som/interpreter/nodes/LocalVariableNode.java b/src/som/interpreter/nodes/LocalVariableNode.java index 6102aa2..e49bea1 100644 --- a/src/som/interpreter/nodes/LocalVariableNode.java +++ b/src/som/interpreter/nodes/LocalVariableNode.java @@ -72,7 +72,9 @@ public abstract class LocalVariableNode extends ExpressionNode { @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { - return CompilerDirectives.unsafeCast(frame.getObject(slot), + Object o = frame.getObject(slot); + assert o != null; + return CompilerDirectives.unsafeCast(o, Object.class, true, true); } diff --git a/src/som/interpreter/nodes/NonLocalVariableNode.java b/src/som/interpreter/nodes/NonLocalVariableNode.java index a7cd432..76230fd 100644 --- a/src/som/interpreter/nodes/NonLocalVariableNode.java +++ b/src/som/interpreter/nodes/NonLocalVariableNode.java @@ -60,8 +60,10 @@ public abstract class NonLocalVariableNode extends ContextualNode { @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { + Object o = determineContext(frame).getObject(slot); + assert o != null; return CompilerDirectives.unsafeCast( - determineContext(frame).getObject(slot), Object.class, true, true); + o, Object.class, true, true); } // @Generic diff --git a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java index 381552a..a6ca011 100644 --- a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java +++ b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java @@ -20,6 +20,7 @@ public final class CachedBlockDispatchNode extends AbstractCachedDispatchNode { @Override public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] instanceof SBlock; SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); if (rcvr.getMethod() == cachedSomMethod) { return cachedMethod.call(frame, arguments); diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java index 0eb9492..49b80f9 100644 --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java @@ -22,6 +22,7 @@ public final class CachedDispatchSObjectCheckNode extends AbstractCachedDispatch @Override public Object executeDispatch( final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] instanceof SObject; SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); if (rcvr.getSOMClass() == expectedClass) { return cachedMethod.call(frame, arguments); diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java index f86e3f5..29f82a2 100644 --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java @@ -20,6 +20,7 @@ public final class CachedDispatchSimpleCheckNode extends AbstractCachedDispatchN @Override public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null; Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); if (rcvr.getClass() == expectedClass) { return cachedMethod.call(frame, arguments); diff --git a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java index b5a9836..27bbc4c 100644 --- a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java +++ b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java @@ -27,6 +27,7 @@ public final class CachedDnuSObjectCheckNode extends AbstractCachedDispatchNode @Override public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] instanceof SObject; SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); if (rcvr.getSOMClass() == expectedClass) { diff --git a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java index 64b5e6c..4ba9693 100644 --- a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java +++ b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java @@ -14,6 +14,7 @@ public final class GenericBlockDispatchNode extends AbstractDispatchNode { @Override public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] instanceof SBlock; SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); return call.call(frame, rcvr.getMethod().getCallTarget(), arguments); } diff --git a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java index b429795..331f946 100644 --- a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java +++ b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java @@ -24,6 +24,7 @@ public final class GenericDispatchNode extends AbstractDispatchWithLookupNode { @Override public Object executeDispatch( final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null; Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); SInvokable method = lookupMethod(rcvr); if (method != null) { diff --git a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java index 2d9106c..0ea1afc 100644 --- a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java +++ b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java @@ -24,6 +24,7 @@ public final class SObjectCheckDispatchNode extends AbstractDispatchNode { @Override public Object executeDispatch( final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null; Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); if (rcvr instanceof SObject) { return nextInCache.executeDispatch(frame, arguments); diff --git a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java index a5a3f96..3b5eee7 100644 --- a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java +++ b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java @@ -29,6 +29,8 @@ public abstract class BinaryExpressionNode extends ExpressionNode @Override public final Object doPreEvaluated(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null; + assert arguments[1] != null; return executeEvaluated(frame, CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); diff --git a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java index 9d4fb29..0d91e42 100644 --- a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java +++ b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java @@ -29,6 +29,9 @@ public abstract class TernaryExpressionNode extends ExpressionNode @Override public final Object doPreEvaluated(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null; + assert arguments[1] != null; + assert arguments[2] != null; return executeEvaluated(frame, CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true), diff --git a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java index 7344d33..a7844a2 100644 --- a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java +++ b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java @@ -25,6 +25,7 @@ public abstract class UnaryExpressionNode extends ExpressionNode @Override public final Object doPreEvaluated(final VirtualFrame frame, final Object[] arguments) { + assert arguments[0] != null; return executeEvaluated(frame, CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true)); } diff --git a/src/som/primitives/reflection/AbstractSymbolDispatch.java b/src/som/primitives/reflection/AbstractSymbolDispatch.java index df92632..f0e79a8 100644 --- a/src/som/primitives/reflection/AbstractSymbolDispatch.java +++ b/src/som/primitives/reflection/AbstractSymbolDispatch.java @@ -94,6 +94,7 @@ public abstract class AbstractSymbolDispatch extends Node implements DispatchCha if (this.selector == selector) { Object[] arguments = SArguments.createSArgumentsArrayFrom(receiver, argsArr); + assert cachedSend instanceof PreevaluatedExpression; PreevaluatedExpression realCachedSend = CompilerDirectives.unsafeCast(cachedSend, PreevaluatedExpression.class, true); return realCachedSend.doPreEvaluated(frame, arguments); } else { diff --git a/src/som/vmobjects/SArray.java b/src/som/vmobjects/SArray.java index c3dee89..36ac1d7 100644 --- a/src/som/vmobjects/SArray.java +++ b/src/som/vmobjects/SArray.java @@ -21,6 +21,7 @@ public final class SArray { public static Object get(final Object[] arr, final long idx) { assert idx >= 0; assert idx < arr.length; + assert arr[(int) idx] != null; return CompilerDirectives.unsafeCast(arr[(int) idx], Object.class, true, true); } diff --git a/src/som/vmobjects/SObject.java b/src/som/vmobjects/SObject.java index c95bc80..dd1e883 100644 --- a/src/som/vmobjects/SObject.java +++ b/src/som/vmobjects/SObject.java @@ -106,10 +106,12 @@ public class SObject extends SAbstractObject { } public final long[] getExtendedPrimFields() { + assert extensionPrimFields instanceof long[]; return CompilerDirectives.unsafeCast(extensionPrimFields, long[].class, true, true); } public final Object[] getExtensionObjFields() { + assert extensionObjFields instanceof Object[]; return CompilerDirectives.unsafeCast(extensionObjFields, Object[].class, true, true); } @@ -207,6 +209,7 @@ public class SObject extends SAbstractObject { @Override public final SClass getSOMClass() { + assert clazz instanceof SClass; return CompilerDirectives.unsafeCast(clazz, SClass.class, true, true); } > > -Gilles > > On Wed, Dec 10, 2014 at 12:15 AM, Stefan Marr wrote: >> Hi Gilles: >> >> Here the log file. >> >> Best regards >> Stefan >> >> >> >> >> >>> On 10 Dec 2014, at 00:04, Gilles Duboscq wrote: >>> >>> Hello Stefan, >>> >>> Thanks for the report. >>> Could you send us the hs_err file as well (hs_err_pid68949.log)? >>> >>> -Gilles >>> >>> On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: >>>> Hi: >>>> >>>> In one of my experiments, I got a hard crash of the Graal VM. >>>> Error below. >>>> >>>> The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. >>>> Though, I haven?t managed to find a way to avoid crashes reliably. >>>> >>>> To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. >>>> >>>> git clone https://github.com/smarr/GraalVM.git >>>> cd GraalVM >>>> ./mx.sh --vm server build -p >>>> cd ../ >>>> git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git >>>> cd TruffleSOM >>>> ant >>>> ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 >>>> >>>> Best regards >>>> Stefan >>>> >>>> >>>> # >>>> # A fatal error has been detected by the Java Runtime Environment: >>>> # >>>> # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 >>>> # >>>> # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) >>>> # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) >>>> # Problematic frame: >>>> # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] >>>> # >>>> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again >>>> # >>>> # An error report file with more information is saved as: >>>> # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log >>>> Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib >>>> Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) >>>> total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 >>>> relocation [0x000000010d601e08,0x000000010d601e20] = 24 >>>> main code [0x000000010d601e20,0x000000010d601edd] = 189 >>>> stub code [0x000000010d601edd,0x000000010d601ee0] = 3 >>>> oops [0x000000010d601ee0,0x000000010d601ef8] = 24 >>>> metadata [0x000000010d601ef8,0x000000010d601f00] = 8 >>>> scopes data [0x000000010d601f00,0x000000010d601f18] = 24 >>>> scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 >>>> dependencies [0x000000010d601f48,0x000000010d601f50] = 8 >>>> Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) >>>> total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 >>>> relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 >>>> main code [0x000000010c77ba60,0x000000010c77bac0] = 96 >>>> stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 >>>> oops [0x000000010c77bae8,0x000000010c77baf0] = 8 >>>> metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 >>>> scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 >>>> scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 >>>> dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 >>>> handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 >>>> >>>> >>>> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>> index 8d00194..0670fad 100644 >>>> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>> @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget >>>> if (root == null || !root.isCloningAllowed()) { >>>> return null; >>>> } >>>> - return NodeUtil.cloneNode(root); >>>> + return root.cloneRootNode(); >>>> } >>>> >>>> public Assumption getNodeRewritingAssumption() { >>>> diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>> index aebf748..2552eea 100644 >>>> --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>> +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>> @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { >>>> return false; >>>> } >>>> >>>> + public RootNode cloneRootNode() { >>>> + return NodeUtil.cloneNode(this); >>>> + } >>>> + >>>> /** >>>> * Reports the execution count of a loop that is a child of this node. The optimization >>>> * heuristics can use the loop count to guide compilation and inlining. >>>> >>>> >>>> >>>> -- >>>> Stefan Marr >>>> INRIA Lille - Nord Europe >>>> http://stefan-marr.de/research/ >>>> >>>> >>>> >> >> -- >> Stefan Marr >> INRIA Lille - Nord Europe >> http://stefan-marr.de/research/ >> >> >> >> -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From java at stefan-marr.de Wed Dec 10 12:37:12 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 10 Dec 2014 13:37:12 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> Message-ID: Hi Gilles: To complete that experiment, I removed all unsafeCasts. As a result, the crash is gone. I am not entirely sure why that is however. During interpretation, asserts never trigger. I suppose, for compilation the asserts are just ignored? I put them in there mostly because of null-checks I wanted to get rid of when optimizing for some benchmarks, but I also had the impression that it helps with warmup time. Do you have by chance an idea what I do misunderstand here, or what could be going wrong? Thanks Stefan > On 10 Dec 2014, at 12:22, Stefan Marr wrote: > > Hi Gilles: > >> On 10 Dec 2014, at 11:53, Gilles Duboscq wrote: >> >> I see a lot of unsafeCast calls where the last argument is true. That >> sounds dangerous. >> Are you sure your casts really *always* hold? Regardless of >> control-flow? This argument should be the condition under which that >> cast is safe, which is usually a condition that you have already >> checked in the control-flow that leads to the cast. > > I am not sure what you mean with ?always?. > I use most of those casts to get rid of some of the null-checks I saw in IGV. > > Below is a patch that adds the assertions corresponding to the unsafeCasts. > > They do not trigger. Does that satisfy your definition of ?always?? > > Best regards > Stefan > > diff --git a/src/som/interpreter/SArguments.java b/src/som/interpreter/SArguments.java > index 64d5cd7..4ccc53e 100644 > --- a/src/som/interpreter/SArguments.java > +++ b/src/som/interpreter/SArguments.java > @@ -8,10 +8,12 @@ public final class SArguments { > private static final int RCVR_IDX = 0; > > private static Object[] args(final Frame frame) { > + assert frame.getArguments() != null; > return CompilerDirectives.unsafeCast(frame.getArguments(), Object[].class, true, true); > } > > public static Object arg(final Frame frame, final int index) { > + assert args(frame)[index] != null; > return CompilerDirectives.unsafeCast(args(frame)[index], Object.class, true, true); > } > > diff --git a/src/som/interpreter/nodes/ContextualNode.java b/src/som/interpreter/nodes/ContextualNode.java > index ec83e48..84535aa 100644 > --- a/src/som/interpreter/nodes/ContextualNode.java > +++ b/src/som/interpreter/nodes/ContextualNode.java > @@ -62,14 +62,18 @@ public abstract class ContextualNode extends ExpressionNode { > int i = contextLevel - 1; > > while (i > 0) { > - self = CompilerDirectives.unsafeCast(self.getOuterSelf(), SBlock.class, true, true); > + Object b = self.getOuterSelf(); > + assert b instanceof SBlock && b != null; > + self = CompilerDirectives.unsafeCast(b, SBlock.class, true, true); > i--; > } > return self.getContext(); > } > > private SBlock getLocalSelf(final VirtualFrame frame) { > - return CompilerDirectives.unsafeCast(FrameUtil.getObjectSafe(frame, localSelf), SBlock.class, true, true); > + Object b = FrameUtil.getObjectSafe(frame, localSelf); > + assert b instanceof SBlock && b != null; > + return CompilerDirectives.unsafeCast(b, SBlock.class, true, true); > } > > @ExplodeLoop > @@ -77,6 +81,7 @@ public abstract class ContextualNode extends ExpressionNode { > Object self = getLocalSelf(frame); > int i = contextLevel; > while (i > 0) { > + assert self instanceof SBlock && self != null; > SBlock block = CompilerDirectives.unsafeCast(self, SBlock.class, true, true); > self = block.getOuterSelf(); > i--; > diff --git a/src/som/interpreter/nodes/FieldNode.java b/src/som/interpreter/nodes/FieldNode.java > index 4077baa..98a4a4b 100644 > --- a/src/som/interpreter/nodes/FieldNode.java > +++ b/src/som/interpreter/nodes/FieldNode.java > @@ -81,6 +81,7 @@ public abstract class FieldNode extends ExpressionNode { > @Override > public Object doPreEvaluated(final VirtualFrame frame, > final Object[] arguments) { > + assert arguments[0] != null && arguments[0] instanceof SObject; > return executeEvaluated(CompilerDirectives.unsafeCast( > arguments[0], SObject.class, true, true)); > } > @@ -134,6 +135,8 @@ public abstract class FieldNode extends ExpressionNode { > @Override > public final Object doPreEvaluated(final VirtualFrame frame, > final Object[] arguments) { > + assert arguments[0] != null && arguments[0] instanceof SObject; > + assert arguments[1] != null; > return executeEvaluated(frame, > CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true), > CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); > diff --git a/src/som/interpreter/nodes/LocalVariableNode.java b/src/som/interpreter/nodes/LocalVariableNode.java > index 6102aa2..e49bea1 100644 > --- a/src/som/interpreter/nodes/LocalVariableNode.java > +++ b/src/som/interpreter/nodes/LocalVariableNode.java > @@ -72,7 +72,9 @@ public abstract class LocalVariableNode extends ExpressionNode { > > @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) > public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { > - return CompilerDirectives.unsafeCast(frame.getObject(slot), > + Object o = frame.getObject(slot); > + assert o != null; > + return CompilerDirectives.unsafeCast(o, > Object.class, true, true); > } > > diff --git a/src/som/interpreter/nodes/NonLocalVariableNode.java b/src/som/interpreter/nodes/NonLocalVariableNode.java > index a7cd432..76230fd 100644 > --- a/src/som/interpreter/nodes/NonLocalVariableNode.java > +++ b/src/som/interpreter/nodes/NonLocalVariableNode.java > @@ -60,8 +60,10 @@ public abstract class NonLocalVariableNode extends ContextualNode { > > @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) > public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { > + Object o = determineContext(frame).getObject(slot); > + assert o != null; > return CompilerDirectives.unsafeCast( > - determineContext(frame).getObject(slot), Object.class, true, true); > + o, Object.class, true, true); > } > > // @Generic > diff --git a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java > index 381552a..a6ca011 100644 > --- a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java > +++ b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java > @@ -20,6 +20,7 @@ public final class CachedBlockDispatchNode extends AbstractCachedDispatchNode { > > @Override > public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { > + assert arguments[0] instanceof SBlock; > SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); > if (rcvr.getMethod() == cachedSomMethod) { > return cachedMethod.call(frame, arguments); > diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java > index 0eb9492..49b80f9 100644 > --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java > +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java > @@ -22,6 +22,7 @@ public final class CachedDispatchSObjectCheckNode extends AbstractCachedDispatch > @Override > public Object executeDispatch( > final VirtualFrame frame, final Object[] arguments) { > + assert arguments[0] instanceof SObject; > SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); > if (rcvr.getSOMClass() == expectedClass) { > return cachedMethod.call(frame, arguments); > diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java > index f86e3f5..29f82a2 100644 > --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java > +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java > @@ -20,6 +20,7 @@ public final class CachedDispatchSimpleCheckNode extends AbstractCachedDispatchN > @Override > public Object executeDispatch(final VirtualFrame frame, > final Object[] arguments) { > + assert arguments[0] != null; > Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); > if (rcvr.getClass() == expectedClass) { > return cachedMethod.call(frame, arguments); > diff --git a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java > index b5a9836..27bbc4c 100644 > --- a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java > +++ b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java > @@ -27,6 +27,7 @@ public final class CachedDnuSObjectCheckNode extends AbstractCachedDispatchNode > > @Override > public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { > + assert arguments[0] instanceof SObject; > SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); > > if (rcvr.getSOMClass() == expectedClass) { > diff --git a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java > index 64b5e6c..4ba9693 100644 > --- a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java > +++ b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java > @@ -14,6 +14,7 @@ public final class GenericBlockDispatchNode extends AbstractDispatchNode { > @Override > public Object executeDispatch(final VirtualFrame frame, > final Object[] arguments) { > + assert arguments[0] instanceof SBlock; > SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); > return call.call(frame, rcvr.getMethod().getCallTarget(), arguments); > } > diff --git a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java > index b429795..331f946 100644 > --- a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java > +++ b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java > @@ -24,6 +24,7 @@ public final class GenericDispatchNode extends AbstractDispatchWithLookupNode { > @Override > public Object executeDispatch( > final VirtualFrame frame, final Object[] arguments) { > + assert arguments[0] != null; > Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); > SInvokable method = lookupMethod(rcvr); > if (method != null) { > diff --git a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java > index 2d9106c..0ea1afc 100644 > --- a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java > +++ b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java > @@ -24,6 +24,7 @@ public final class SObjectCheckDispatchNode extends AbstractDispatchNode { > @Override > public Object executeDispatch( > final VirtualFrame frame, final Object[] arguments) { > + assert arguments[0] != null; > Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); > if (rcvr instanceof SObject) { > return nextInCache.executeDispatch(frame, arguments); > diff --git a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java > index a5a3f96..3b5eee7 100644 > --- a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java > +++ b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java > @@ -29,6 +29,8 @@ public abstract class BinaryExpressionNode extends ExpressionNode > @Override > public final Object doPreEvaluated(final VirtualFrame frame, > final Object[] arguments) { > + assert arguments[0] != null; > + assert arguments[1] != null; > return executeEvaluated(frame, > CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), > CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); > diff --git a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java > index 9d4fb29..0d91e42 100644 > --- a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java > +++ b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java > @@ -29,6 +29,9 @@ public abstract class TernaryExpressionNode extends ExpressionNode > @Override > public final Object doPreEvaluated(final VirtualFrame frame, > final Object[] arguments) { > + assert arguments[0] != null; > + assert arguments[1] != null; > + assert arguments[2] != null; > return executeEvaluated(frame, > CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), > CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true), > diff --git a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java > index 7344d33..a7844a2 100644 > --- a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java > +++ b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java > @@ -25,6 +25,7 @@ public abstract class UnaryExpressionNode extends ExpressionNode > @Override > public final Object doPreEvaluated(final VirtualFrame frame, > final Object[] arguments) { > + assert arguments[0] != null; > return executeEvaluated(frame, > CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true)); > } > diff --git a/src/som/primitives/reflection/AbstractSymbolDispatch.java b/src/som/primitives/reflection/AbstractSymbolDispatch.java > index df92632..f0e79a8 100644 > --- a/src/som/primitives/reflection/AbstractSymbolDispatch.java > +++ b/src/som/primitives/reflection/AbstractSymbolDispatch.java > @@ -94,6 +94,7 @@ public abstract class AbstractSymbolDispatch extends Node implements DispatchCha > if (this.selector == selector) { > Object[] arguments = SArguments.createSArgumentsArrayFrom(receiver, argsArr); > > + assert cachedSend instanceof PreevaluatedExpression; > PreevaluatedExpression realCachedSend = CompilerDirectives.unsafeCast(cachedSend, PreevaluatedExpression.class, true); > return realCachedSend.doPreEvaluated(frame, arguments); > } else { > diff --git a/src/som/vmobjects/SArray.java b/src/som/vmobjects/SArray.java > index c3dee89..36ac1d7 100644 > --- a/src/som/vmobjects/SArray.java > +++ b/src/som/vmobjects/SArray.java > @@ -21,6 +21,7 @@ public final class SArray { > public static Object get(final Object[] arr, final long idx) { > assert idx >= 0; > assert idx < arr.length; > + assert arr[(int) idx] != null; > return CompilerDirectives.unsafeCast(arr[(int) idx], Object.class, true, true); > } > > diff --git a/src/som/vmobjects/SObject.java b/src/som/vmobjects/SObject.java > index c95bc80..dd1e883 100644 > --- a/src/som/vmobjects/SObject.java > +++ b/src/som/vmobjects/SObject.java > @@ -106,10 +106,12 @@ public class SObject extends SAbstractObject { > } > > public final long[] getExtendedPrimFields() { > + assert extensionPrimFields instanceof long[]; > return CompilerDirectives.unsafeCast(extensionPrimFields, long[].class, true, true); > } > > public final Object[] getExtensionObjFields() { > + assert extensionObjFields instanceof Object[]; > return CompilerDirectives.unsafeCast(extensionObjFields, Object[].class, true, true); > } > > @@ -207,6 +209,7 @@ public class SObject extends SAbstractObject { > > @Override > public final SClass getSOMClass() { > + assert clazz instanceof SClass; > return CompilerDirectives.unsafeCast(clazz, SClass.class, true, true); > } > > > > >> >> -Gilles >> >> On Wed, Dec 10, 2014 at 12:15 AM, Stefan Marr wrote: >>> Hi Gilles: >>> >>> Here the log file. >>> >>> Best regards >>> Stefan >>> >>> >>> >>> >>> >>>> On 10 Dec 2014, at 00:04, Gilles Duboscq wrote: >>>> >>>> Hello Stefan, >>>> >>>> Thanks for the report. >>>> Could you send us the hs_err file as well (hs_err_pid68949.log)? >>>> >>>> -Gilles >>>> >>>> On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: >>>>> Hi: >>>>> >>>>> In one of my experiments, I got a hard crash of the Graal VM. >>>>> Error below. >>>>> >>>>> The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. >>>>> Though, I haven?t managed to find a way to avoid crashes reliably. >>>>> >>>>> To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. >>>>> >>>>> git clone https://github.com/smarr/GraalVM.git >>>>> cd GraalVM >>>>> ./mx.sh --vm server build -p >>>>> cd ../ >>>>> git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git >>>>> cd TruffleSOM >>>>> ant >>>>> ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 >>>>> >>>>> Best regards >>>>> Stefan >>>>> >>>>> >>>>> # >>>>> # A fatal error has been detected by the Java Runtime Environment: >>>>> # >>>>> # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 >>>>> # >>>>> # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) >>>>> # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) >>>>> # Problematic frame: >>>>> # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] >>>>> # >>>>> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again >>>>> # >>>>> # An error report file with more information is saved as: >>>>> # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log >>>>> Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib >>>>> Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) >>>>> total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 >>>>> relocation [0x000000010d601e08,0x000000010d601e20] = 24 >>>>> main code [0x000000010d601e20,0x000000010d601edd] = 189 >>>>> stub code [0x000000010d601edd,0x000000010d601ee0] = 3 >>>>> oops [0x000000010d601ee0,0x000000010d601ef8] = 24 >>>>> metadata [0x000000010d601ef8,0x000000010d601f00] = 8 >>>>> scopes data [0x000000010d601f00,0x000000010d601f18] = 24 >>>>> scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 >>>>> dependencies [0x000000010d601f48,0x000000010d601f50] = 8 >>>>> Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) >>>>> total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 >>>>> relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 >>>>> main code [0x000000010c77ba60,0x000000010c77bac0] = 96 >>>>> stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 >>>>> oops [0x000000010c77bae8,0x000000010c77baf0] = 8 >>>>> metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 >>>>> scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 >>>>> scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 >>>>> dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 >>>>> handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 >>>>> >>>>> >>>>> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>> index 8d00194..0670fad 100644 >>>>> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>> @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget >>>>> if (root == null || !root.isCloningAllowed()) { >>>>> return null; >>>>> } >>>>> - return NodeUtil.cloneNode(root); >>>>> + return root.cloneRootNode(); >>>>> } >>>>> >>>>> public Assumption getNodeRewritingAssumption() { >>>>> diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>> index aebf748..2552eea 100644 >>>>> --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>> +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>> @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { >>>>> return false; >>>>> } >>>>> >>>>> + public RootNode cloneRootNode() { >>>>> + return NodeUtil.cloneNode(this); >>>>> + } >>>>> + >>>>> /** >>>>> * Reports the execution count of a loop that is a child of this node. The optimization >>>>> * heuristics can use the loop count to guide compilation and inlining. >>>>> >>>>> >>>>> >>>>> -- >>>>> Stefan Marr >>>>> INRIA Lille - Nord Europe >>>>> http://stefan-marr.de/research/ >>>>> >>>>> >>>>> >>> >>> -- >>> Stefan Marr >>> INRIA Lille - Nord Europe >>> http://stefan-marr.de/research/ >>> >>> >>> >>> > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From java at stefan-marr.de Wed Dec 10 14:58:57 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 10 Dec 2014 15:58:57 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> Message-ID: Hi Gilles: Going through all unsafeCasts, which might or might not be in vain optimizations attempts of mine, it turns out, it is an old friend? It is SBlock.getContext() again: https://github.com/smarr/TruffleSOM/blob/master/src/som/vmobjects/SBlock.java#L101 public final MaterializedFrame getContext() { assert context != null; // This cast is necessary to help Graal to see that we are // really having a MaterializedFrame here. return CompilerDirectives.unsafeCast( // and while we are at it, just also tell Graal the field is not null // (when getContext() is used, it is guaranteed to be set, by construction) context, MaterializedFrame.class, true, true); } And, context is only ever accessed if there is actually a lexical context. That?s by construction. There is no code path that will ever call getContext() with context being null. For reasonable values of ?always?, this method has always had the assertion `context != null`, so, there is reasonable evidence that the implementation is correct enough, I would say. So, I think, there is still something fishy going on here. Is there any way that this `is-not-null` property is floating somewhere earlier where it shouldn?t be? But then again, I don?t see how that would matter, since there wouldn?t be a data dependency on the context field to begin with in cases where it is null. Any deeper insights would be appreciate. Thanks Stefan > On 10 Dec 2014, at 13:37, Stefan Marr wrote: > > Hi Gilles: > > To complete that experiment, I removed all unsafeCasts. As a result, the crash is gone. > > I am not entirely sure why that is however. > During interpretation, asserts never trigger. > I suppose, for compilation the asserts are just ignored? > > I put them in there mostly because of null-checks I wanted to get rid of when optimizing for some benchmarks, but I also had the impression that it helps with warmup time. > > Do you have by chance an idea what I do misunderstand here, or what could be going wrong? > > Thanks > Stefan > >> On 10 Dec 2014, at 12:22, Stefan Marr wrote: >> >> Hi Gilles: >> >>> On 10 Dec 2014, at 11:53, Gilles Duboscq wrote: >>> >>> I see a lot of unsafeCast calls where the last argument is true. That >>> sounds dangerous. >>> Are you sure your casts really *always* hold? Regardless of >>> control-flow? This argument should be the condition under which that >>> cast is safe, which is usually a condition that you have already >>> checked in the control-flow that leads to the cast. >> >> I am not sure what you mean with ?always?. >> I use most of those casts to get rid of some of the null-checks I saw in IGV. >> >> Below is a patch that adds the assertions corresponding to the unsafeCasts. >> >> They do not trigger. Does that satisfy your definition of ?always?? >> >> Best regards >> Stefan >> >> diff --git a/src/som/interpreter/SArguments.java b/src/som/interpreter/SArguments.java >> index 64d5cd7..4ccc53e 100644 >> --- a/src/som/interpreter/SArguments.java >> +++ b/src/som/interpreter/SArguments.java >> @@ -8,10 +8,12 @@ public final class SArguments { >> private static final int RCVR_IDX = 0; >> >> private static Object[] args(final Frame frame) { >> + assert frame.getArguments() != null; >> return CompilerDirectives.unsafeCast(frame.getArguments(), Object[].class, true, true); >> } >> >> public static Object arg(final Frame frame, final int index) { >> + assert args(frame)[index] != null; >> return CompilerDirectives.unsafeCast(args(frame)[index], Object.class, true, true); >> } >> >> diff --git a/src/som/interpreter/nodes/ContextualNode.java b/src/som/interpreter/nodes/ContextualNode.java >> index ec83e48..84535aa 100644 >> --- a/src/som/interpreter/nodes/ContextualNode.java >> +++ b/src/som/interpreter/nodes/ContextualNode.java >> @@ -62,14 +62,18 @@ public abstract class ContextualNode extends ExpressionNode { >> int i = contextLevel - 1; >> >> while (i > 0) { >> - self = CompilerDirectives.unsafeCast(self.getOuterSelf(), SBlock.class, true, true); >> + Object b = self.getOuterSelf(); >> + assert b instanceof SBlock && b != null; >> + self = CompilerDirectives.unsafeCast(b, SBlock.class, true, true); >> i--; >> } >> return self.getContext(); >> } >> >> private SBlock getLocalSelf(final VirtualFrame frame) { >> - return CompilerDirectives.unsafeCast(FrameUtil.getObjectSafe(frame, localSelf), SBlock.class, true, true); >> + Object b = FrameUtil.getObjectSafe(frame, localSelf); >> + assert b instanceof SBlock && b != null; >> + return CompilerDirectives.unsafeCast(b, SBlock.class, true, true); >> } >> >> @ExplodeLoop >> @@ -77,6 +81,7 @@ public abstract class ContextualNode extends ExpressionNode { >> Object self = getLocalSelf(frame); >> int i = contextLevel; >> while (i > 0) { >> + assert self instanceof SBlock && self != null; >> SBlock block = CompilerDirectives.unsafeCast(self, SBlock.class, true, true); >> self = block.getOuterSelf(); >> i--; >> diff --git a/src/som/interpreter/nodes/FieldNode.java b/src/som/interpreter/nodes/FieldNode.java >> index 4077baa..98a4a4b 100644 >> --- a/src/som/interpreter/nodes/FieldNode.java >> +++ b/src/som/interpreter/nodes/FieldNode.java >> @@ -81,6 +81,7 @@ public abstract class FieldNode extends ExpressionNode { >> @Override >> public Object doPreEvaluated(final VirtualFrame frame, >> final Object[] arguments) { >> + assert arguments[0] != null && arguments[0] instanceof SObject; >> return executeEvaluated(CompilerDirectives.unsafeCast( >> arguments[0], SObject.class, true, true)); >> } >> @@ -134,6 +135,8 @@ public abstract class FieldNode extends ExpressionNode { >> @Override >> public final Object doPreEvaluated(final VirtualFrame frame, >> final Object[] arguments) { >> + assert arguments[0] != null && arguments[0] instanceof SObject; >> + assert arguments[1] != null; >> return executeEvaluated(frame, >> CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true), >> CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); >> diff --git a/src/som/interpreter/nodes/LocalVariableNode.java b/src/som/interpreter/nodes/LocalVariableNode.java >> index 6102aa2..e49bea1 100644 >> --- a/src/som/interpreter/nodes/LocalVariableNode.java >> +++ b/src/som/interpreter/nodes/LocalVariableNode.java >> @@ -72,7 +72,9 @@ public abstract class LocalVariableNode extends ExpressionNode { >> >> @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) >> public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { >> - return CompilerDirectives.unsafeCast(frame.getObject(slot), >> + Object o = frame.getObject(slot); >> + assert o != null; >> + return CompilerDirectives.unsafeCast(o, >> Object.class, true, true); >> } >> >> diff --git a/src/som/interpreter/nodes/NonLocalVariableNode.java b/src/som/interpreter/nodes/NonLocalVariableNode.java >> index a7cd432..76230fd 100644 >> --- a/src/som/interpreter/nodes/NonLocalVariableNode.java >> +++ b/src/som/interpreter/nodes/NonLocalVariableNode.java >> @@ -60,8 +60,10 @@ public abstract class NonLocalVariableNode extends ContextualNode { >> >> @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) >> public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { >> + Object o = determineContext(frame).getObject(slot); >> + assert o != null; >> return CompilerDirectives.unsafeCast( >> - determineContext(frame).getObject(slot), Object.class, true, true); >> + o, Object.class, true, true); >> } >> >> // @Generic >> diff --git a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java >> index 381552a..a6ca011 100644 >> --- a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java >> +++ b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java >> @@ -20,6 +20,7 @@ public final class CachedBlockDispatchNode extends AbstractCachedDispatchNode { >> >> @Override >> public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { >> + assert arguments[0] instanceof SBlock; >> SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); >> if (rcvr.getMethod() == cachedSomMethod) { >> return cachedMethod.call(frame, arguments); >> diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java >> index 0eb9492..49b80f9 100644 >> --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java >> +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java >> @@ -22,6 +22,7 @@ public final class CachedDispatchSObjectCheckNode extends AbstractCachedDispatch >> @Override >> public Object executeDispatch( >> final VirtualFrame frame, final Object[] arguments) { >> + assert arguments[0] instanceof SObject; >> SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); >> if (rcvr.getSOMClass() == expectedClass) { >> return cachedMethod.call(frame, arguments); >> diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java >> index f86e3f5..29f82a2 100644 >> --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java >> +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java >> @@ -20,6 +20,7 @@ public final class CachedDispatchSimpleCheckNode extends AbstractCachedDispatchN >> @Override >> public Object executeDispatch(final VirtualFrame frame, >> final Object[] arguments) { >> + assert arguments[0] != null; >> Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); >> if (rcvr.getClass() == expectedClass) { >> return cachedMethod.call(frame, arguments); >> diff --git a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java >> index b5a9836..27bbc4c 100644 >> --- a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java >> +++ b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java >> @@ -27,6 +27,7 @@ public final class CachedDnuSObjectCheckNode extends AbstractCachedDispatchNode >> >> @Override >> public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { >> + assert arguments[0] instanceof SObject; >> SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); >> >> if (rcvr.getSOMClass() == expectedClass) { >> diff --git a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java >> index 64b5e6c..4ba9693 100644 >> --- a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java >> +++ b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java >> @@ -14,6 +14,7 @@ public final class GenericBlockDispatchNode extends AbstractDispatchNode { >> @Override >> public Object executeDispatch(final VirtualFrame frame, >> final Object[] arguments) { >> + assert arguments[0] instanceof SBlock; >> SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); >> return call.call(frame, rcvr.getMethod().getCallTarget(), arguments); >> } >> diff --git a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java >> index b429795..331f946 100644 >> --- a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java >> +++ b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java >> @@ -24,6 +24,7 @@ public final class GenericDispatchNode extends AbstractDispatchWithLookupNode { >> @Override >> public Object executeDispatch( >> final VirtualFrame frame, final Object[] arguments) { >> + assert arguments[0] != null; >> Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); >> SInvokable method = lookupMethod(rcvr); >> if (method != null) { >> diff --git a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java >> index 2d9106c..0ea1afc 100644 >> --- a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java >> +++ b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java >> @@ -24,6 +24,7 @@ public final class SObjectCheckDispatchNode extends AbstractDispatchNode { >> @Override >> public Object executeDispatch( >> final VirtualFrame frame, final Object[] arguments) { >> + assert arguments[0] != null; >> Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); >> if (rcvr instanceof SObject) { >> return nextInCache.executeDispatch(frame, arguments); >> diff --git a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java >> index a5a3f96..3b5eee7 100644 >> --- a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java >> +++ b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java >> @@ -29,6 +29,8 @@ public abstract class BinaryExpressionNode extends ExpressionNode >> @Override >> public final Object doPreEvaluated(final VirtualFrame frame, >> final Object[] arguments) { >> + assert arguments[0] != null; >> + assert arguments[1] != null; >> return executeEvaluated(frame, >> CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), >> CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); >> diff --git a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java >> index 9d4fb29..0d91e42 100644 >> --- a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java >> +++ b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java >> @@ -29,6 +29,9 @@ public abstract class TernaryExpressionNode extends ExpressionNode >> @Override >> public final Object doPreEvaluated(final VirtualFrame frame, >> final Object[] arguments) { >> + assert arguments[0] != null; >> + assert arguments[1] != null; >> + assert arguments[2] != null; >> return executeEvaluated(frame, >> CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), >> CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true), >> diff --git a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java >> index 7344d33..a7844a2 100644 >> --- a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java >> +++ b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java >> @@ -25,6 +25,7 @@ public abstract class UnaryExpressionNode extends ExpressionNode >> @Override >> public final Object doPreEvaluated(final VirtualFrame frame, >> final Object[] arguments) { >> + assert arguments[0] != null; >> return executeEvaluated(frame, >> CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true)); >> } >> diff --git a/src/som/primitives/reflection/AbstractSymbolDispatch.java b/src/som/primitives/reflection/AbstractSymbolDispatch.java >> index df92632..f0e79a8 100644 >> --- a/src/som/primitives/reflection/AbstractSymbolDispatch.java >> +++ b/src/som/primitives/reflection/AbstractSymbolDispatch.java >> @@ -94,6 +94,7 @@ public abstract class AbstractSymbolDispatch extends Node implements DispatchCha >> if (this.selector == selector) { >> Object[] arguments = SArguments.createSArgumentsArrayFrom(receiver, argsArr); >> >> + assert cachedSend instanceof PreevaluatedExpression; >> PreevaluatedExpression realCachedSend = CompilerDirectives.unsafeCast(cachedSend, PreevaluatedExpression.class, true); >> return realCachedSend.doPreEvaluated(frame, arguments); >> } else { >> diff --git a/src/som/vmobjects/SArray.java b/src/som/vmobjects/SArray.java >> index c3dee89..36ac1d7 100644 >> --- a/src/som/vmobjects/SArray.java >> +++ b/src/som/vmobjects/SArray.java >> @@ -21,6 +21,7 @@ public final class SArray { >> public static Object get(final Object[] arr, final long idx) { >> assert idx >= 0; >> assert idx < arr.length; >> + assert arr[(int) idx] != null; >> return CompilerDirectives.unsafeCast(arr[(int) idx], Object.class, true, true); >> } >> >> diff --git a/src/som/vmobjects/SObject.java b/src/som/vmobjects/SObject.java >> index c95bc80..dd1e883 100644 >> --- a/src/som/vmobjects/SObject.java >> +++ b/src/som/vmobjects/SObject.java >> @@ -106,10 +106,12 @@ public class SObject extends SAbstractObject { >> } >> >> public final long[] getExtendedPrimFields() { >> + assert extensionPrimFields instanceof long[]; >> return CompilerDirectives.unsafeCast(extensionPrimFields, long[].class, true, true); >> } >> >> public final Object[] getExtensionObjFields() { >> + assert extensionObjFields instanceof Object[]; >> return CompilerDirectives.unsafeCast(extensionObjFields, Object[].class, true, true); >> } >> >> @@ -207,6 +209,7 @@ public class SObject extends SAbstractObject { >> >> @Override >> public final SClass getSOMClass() { >> + assert clazz instanceof SClass; >> return CompilerDirectives.unsafeCast(clazz, SClass.class, true, true); >> } >> >> >> >> >>> >>> -Gilles >>> >>> On Wed, Dec 10, 2014 at 12:15 AM, Stefan Marr wrote: >>>> Hi Gilles: >>>> >>>> Here the log file. >>>> >>>> Best regards >>>> Stefan >>>> >>>> >>>> >>>> >>>> >>>>> On 10 Dec 2014, at 00:04, Gilles Duboscq wrote: >>>>> >>>>> Hello Stefan, >>>>> >>>>> Thanks for the report. >>>>> Could you send us the hs_err file as well (hs_err_pid68949.log)? >>>>> >>>>> -Gilles >>>>> >>>>> On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: >>>>>> Hi: >>>>>> >>>>>> In one of my experiments, I got a hard crash of the Graal VM. >>>>>> Error below. >>>>>> >>>>>> The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. >>>>>> Though, I haven?t managed to find a way to avoid crashes reliably. >>>>>> >>>>>> To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. >>>>>> >>>>>> git clone https://github.com/smarr/GraalVM.git >>>>>> cd GraalVM >>>>>> ./mx.sh --vm server build -p >>>>>> cd ../ >>>>>> git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git >>>>>> cd TruffleSOM >>>>>> ant >>>>>> ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 >>>>>> >>>>>> Best regards >>>>>> Stefan >>>>>> >>>>>> >>>>>> # >>>>>> # A fatal error has been detected by the Java Runtime Environment: >>>>>> # >>>>>> # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 >>>>>> # >>>>>> # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) >>>>>> # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) >>>>>> # Problematic frame: >>>>>> # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] >>>>>> # >>>>>> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again >>>>>> # >>>>>> # An error report file with more information is saved as: >>>>>> # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log >>>>>> Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib >>>>>> Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) >>>>>> total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 >>>>>> relocation [0x000000010d601e08,0x000000010d601e20] = 24 >>>>>> main code [0x000000010d601e20,0x000000010d601edd] = 189 >>>>>> stub code [0x000000010d601edd,0x000000010d601ee0] = 3 >>>>>> oops [0x000000010d601ee0,0x000000010d601ef8] = 24 >>>>>> metadata [0x000000010d601ef8,0x000000010d601f00] = 8 >>>>>> scopes data [0x000000010d601f00,0x000000010d601f18] = 24 >>>>>> scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 >>>>>> dependencies [0x000000010d601f48,0x000000010d601f50] = 8 >>>>>> Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) >>>>>> total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 >>>>>> relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 >>>>>> main code [0x000000010c77ba60,0x000000010c77bac0] = 96 >>>>>> stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 >>>>>> oops [0x000000010c77bae8,0x000000010c77baf0] = 8 >>>>>> metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 >>>>>> scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 >>>>>> scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 >>>>>> dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 >>>>>> handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 >>>>>> >>>>>> >>>>>> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>>> index 8d00194..0670fad 100644 >>>>>> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>>> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>>> @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget >>>>>> if (root == null || !root.isCloningAllowed()) { >>>>>> return null; >>>>>> } >>>>>> - return NodeUtil.cloneNode(root); >>>>>> + return root.cloneRootNode(); >>>>>> } >>>>>> >>>>>> public Assumption getNodeRewritingAssumption() { >>>>>> diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>>> index aebf748..2552eea 100644 >>>>>> --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>>> +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>>> @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { >>>>>> return false; >>>>>> } >>>>>> >>>>>> + public RootNode cloneRootNode() { >>>>>> + return NodeUtil.cloneNode(this); >>>>>> + } >>>>>> + >>>>>> /** >>>>>> * Reports the execution count of a loop that is a child of this node. The optimization >>>>>> * heuristics can use the loop count to guide compilation and inlining. >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Stefan Marr >>>>>> INRIA Lille - Nord Europe >>>>>> http://stefan-marr.de/research/ >>>>>> >>>>>> >>>>>> >>>> >>>> -- >>>> Stefan Marr >>>> INRIA Lille - Nord Europe >>>> http://stefan-marr.de/research/ >>>> >>>> >>>> >>>> >> >> -- >> Stefan Marr >> INRIA Lille - Nord Europe >> http://stefan-marr.de/research/ > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ > > > -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From duboscq at ssw.jku.at Wed Dec 10 15:42:28 2014 From: duboscq at ssw.jku.at (Gilles Duboscq) Date: Wed, 10 Dec 2014 16:42:28 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> Message-ID: Hi Stefan. Yes it is floating early because it is not constrained. Using true as a condition is like saying "this cast is universally valid" it can float anywhere. It does not belong to a particular branch anymore. Even if in the end the usages of this cast are only in path where your assumption hold, since they are not constrained, they are free to float before those path. Global Value Numbering can easily common-out things and make them float very early. This is why the asserts don't really help you when you use "true" as the unsafeCast condition because the asserts will not float. If you know that all path reaching this are dominated by some specific check, you can use it as the condition such that the information from this cast will only ever be used in those branches. In general, we're planning to remove the unsafe operations from CompilerDirectives anyway. -Gilles On Wed, Dec 10, 2014 at 3:58 PM, Stefan Marr wrote: > Hi Gilles: > > Going through all unsafeCasts, which might or might not be in vain optimizations attempts of mine, it turns out, it is an old friend? > > It is SBlock.getContext() again: https://github.com/smarr/TruffleSOM/blob/master/src/som/vmobjects/SBlock.java#L101 > > > public final MaterializedFrame getContext() { > assert context != null; > > // This cast is necessary to help Graal to see that we are > // really having a MaterializedFrame here. > return CompilerDirectives.unsafeCast( > // and while we are at it, just also tell Graal the field is not null > // (when getContext() is used, it is guaranteed to be set, by construction) > context, MaterializedFrame.class, true, true); > } > > And, context is only ever accessed if there is actually a lexical context. That?s by construction. There is no code path that will ever call getContext() with context being null. For reasonable values of ?always?, this method has always had the assertion `context != null`, so, there is reasonable evidence that the implementation is correct enough, I would say. > > So, I think, there is still something fishy going on here. > Is there any way that this `is-not-null` property is floating somewhere earlier where it shouldn?t be? > But then again, I don?t see how that would matter, since there wouldn?t be a data dependency on the context field to begin with in cases where it is null. > > Any deeper insights would be appreciate. > > Thanks > Stefan > >> On 10 Dec 2014, at 13:37, Stefan Marr wrote: >> >> Hi Gilles: >> >> To complete that experiment, I removed all unsafeCasts. As a result, the crash is gone. >> >> I am not entirely sure why that is however. >> During interpretation, asserts never trigger. >> I suppose, for compilation the asserts are just ignored? >> >> I put them in there mostly because of null-checks I wanted to get rid of when optimizing for some benchmarks, but I also had the impression that it helps with warmup time. >> >> Do you have by chance an idea what I do misunderstand here, or what could be going wrong? >> >> Thanks >> Stefan >> >>> On 10 Dec 2014, at 12:22, Stefan Marr wrote: >>> >>> Hi Gilles: >>> >>>> On 10 Dec 2014, at 11:53, Gilles Duboscq wrote: >>>> >>>> I see a lot of unsafeCast calls where the last argument is true. That >>>> sounds dangerous. >>>> Are you sure your casts really *always* hold? Regardless of >>>> control-flow? This argument should be the condition under which that >>>> cast is safe, which is usually a condition that you have already >>>> checked in the control-flow that leads to the cast. >>> >>> I am not sure what you mean with ?always?. >>> I use most of those casts to get rid of some of the null-checks I saw in IGV. >>> >>> Below is a patch that adds the assertions corresponding to the unsafeCasts. >>> >>> They do not trigger. Does that satisfy your definition of ?always?? >>> >>> Best regards >>> Stefan >>> >>> diff --git a/src/som/interpreter/SArguments.java b/src/som/interpreter/SArguments.java >>> index 64d5cd7..4ccc53e 100644 >>> --- a/src/som/interpreter/SArguments.java >>> +++ b/src/som/interpreter/SArguments.java >>> @@ -8,10 +8,12 @@ public final class SArguments { >>> private static final int RCVR_IDX = 0; >>> >>> private static Object[] args(final Frame frame) { >>> + assert frame.getArguments() != null; >>> return CompilerDirectives.unsafeCast(frame.getArguments(), Object[].class, true, true); >>> } >>> >>> public static Object arg(final Frame frame, final int index) { >>> + assert args(frame)[index] != null; >>> return CompilerDirectives.unsafeCast(args(frame)[index], Object.class, true, true); >>> } >>> >>> diff --git a/src/som/interpreter/nodes/ContextualNode.java b/src/som/interpreter/nodes/ContextualNode.java >>> index ec83e48..84535aa 100644 >>> --- a/src/som/interpreter/nodes/ContextualNode.java >>> +++ b/src/som/interpreter/nodes/ContextualNode.java >>> @@ -62,14 +62,18 @@ public abstract class ContextualNode extends ExpressionNode { >>> int i = contextLevel - 1; >>> >>> while (i > 0) { >>> - self = CompilerDirectives.unsafeCast(self.getOuterSelf(), SBlock.class, true, true); >>> + Object b = self.getOuterSelf(); >>> + assert b instanceof SBlock && b != null; >>> + self = CompilerDirectives.unsafeCast(b, SBlock.class, true, true); >>> i--; >>> } >>> return self.getContext(); >>> } >>> >>> private SBlock getLocalSelf(final VirtualFrame frame) { >>> - return CompilerDirectives.unsafeCast(FrameUtil.getObjectSafe(frame, localSelf), SBlock.class, true, true); >>> + Object b = FrameUtil.getObjectSafe(frame, localSelf); >>> + assert b instanceof SBlock && b != null; >>> + return CompilerDirectives.unsafeCast(b, SBlock.class, true, true); >>> } >>> >>> @ExplodeLoop >>> @@ -77,6 +81,7 @@ public abstract class ContextualNode extends ExpressionNode { >>> Object self = getLocalSelf(frame); >>> int i = contextLevel; >>> while (i > 0) { >>> + assert self instanceof SBlock && self != null; >>> SBlock block = CompilerDirectives.unsafeCast(self, SBlock.class, true, true); >>> self = block.getOuterSelf(); >>> i--; >>> diff --git a/src/som/interpreter/nodes/FieldNode.java b/src/som/interpreter/nodes/FieldNode.java >>> index 4077baa..98a4a4b 100644 >>> --- a/src/som/interpreter/nodes/FieldNode.java >>> +++ b/src/som/interpreter/nodes/FieldNode.java >>> @@ -81,6 +81,7 @@ public abstract class FieldNode extends ExpressionNode { >>> @Override >>> public Object doPreEvaluated(final VirtualFrame frame, >>> final Object[] arguments) { >>> + assert arguments[0] != null && arguments[0] instanceof SObject; >>> return executeEvaluated(CompilerDirectives.unsafeCast( >>> arguments[0], SObject.class, true, true)); >>> } >>> @@ -134,6 +135,8 @@ public abstract class FieldNode extends ExpressionNode { >>> @Override >>> public final Object doPreEvaluated(final VirtualFrame frame, >>> final Object[] arguments) { >>> + assert arguments[0] != null && arguments[0] instanceof SObject; >>> + assert arguments[1] != null; >>> return executeEvaluated(frame, >>> CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true), >>> CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); >>> diff --git a/src/som/interpreter/nodes/LocalVariableNode.java b/src/som/interpreter/nodes/LocalVariableNode.java >>> index 6102aa2..e49bea1 100644 >>> --- a/src/som/interpreter/nodes/LocalVariableNode.java >>> +++ b/src/som/interpreter/nodes/LocalVariableNode.java >>> @@ -72,7 +72,9 @@ public abstract class LocalVariableNode extends ExpressionNode { >>> >>> @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) >>> public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { >>> - return CompilerDirectives.unsafeCast(frame.getObject(slot), >>> + Object o = frame.getObject(slot); >>> + assert o != null; >>> + return CompilerDirectives.unsafeCast(o, >>> Object.class, true, true); >>> } >>> >>> diff --git a/src/som/interpreter/nodes/NonLocalVariableNode.java b/src/som/interpreter/nodes/NonLocalVariableNode.java >>> index a7cd432..76230fd 100644 >>> --- a/src/som/interpreter/nodes/NonLocalVariableNode.java >>> +++ b/src/som/interpreter/nodes/NonLocalVariableNode.java >>> @@ -60,8 +60,10 @@ public abstract class NonLocalVariableNode extends ContextualNode { >>> >>> @Specialization(guards = "isInitialized", rewriteOn = {FrameSlotTypeException.class}) >>> public final Object doObject(final VirtualFrame frame) throws FrameSlotTypeException { >>> + Object o = determineContext(frame).getObject(slot); >>> + assert o != null; >>> return CompilerDirectives.unsafeCast( >>> - determineContext(frame).getObject(slot), Object.class, true, true); >>> + o, Object.class, true, true); >>> } >>> >>> // @Generic >>> diff --git a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java >>> index 381552a..a6ca011 100644 >>> --- a/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java >>> +++ b/src/som/interpreter/nodes/dispatch/CachedBlockDispatchNode.java >>> @@ -20,6 +20,7 @@ public final class CachedBlockDispatchNode extends AbstractCachedDispatchNode { >>> >>> @Override >>> public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { >>> + assert arguments[0] instanceof SBlock; >>> SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); >>> if (rcvr.getMethod() == cachedSomMethod) { >>> return cachedMethod.call(frame, arguments); >>> diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java >>> index 0eb9492..49b80f9 100644 >>> --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java >>> +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSObjectCheckNode.java >>> @@ -22,6 +22,7 @@ public final class CachedDispatchSObjectCheckNode extends AbstractCachedDispatch >>> @Override >>> public Object executeDispatch( >>> final VirtualFrame frame, final Object[] arguments) { >>> + assert arguments[0] instanceof SObject; >>> SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); >>> if (rcvr.getSOMClass() == expectedClass) { >>> return cachedMethod.call(frame, arguments); >>> diff --git a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java >>> index f86e3f5..29f82a2 100644 >>> --- a/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java >>> +++ b/src/som/interpreter/nodes/dispatch/CachedDispatchSimpleCheckNode.java >>> @@ -20,6 +20,7 @@ public final class CachedDispatchSimpleCheckNode extends AbstractCachedDispatchN >>> @Override >>> public Object executeDispatch(final VirtualFrame frame, >>> final Object[] arguments) { >>> + assert arguments[0] != null; >>> Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); >>> if (rcvr.getClass() == expectedClass) { >>> return cachedMethod.call(frame, arguments); >>> diff --git a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java >>> index b5a9836..27bbc4c 100644 >>> --- a/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java >>> +++ b/src/som/interpreter/nodes/dispatch/CachedDnuSObjectCheckNode.java >>> @@ -27,6 +27,7 @@ public final class CachedDnuSObjectCheckNode extends AbstractCachedDispatchNode >>> >>> @Override >>> public Object executeDispatch(final VirtualFrame frame, final Object[] arguments) { >>> + assert arguments[0] instanceof SObject; >>> SObject rcvr = CompilerDirectives.unsafeCast(arguments[0], SObject.class, true, true); >>> >>> if (rcvr.getSOMClass() == expectedClass) { >>> diff --git a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java >>> index 64b5e6c..4ba9693 100644 >>> --- a/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java >>> +++ b/src/som/interpreter/nodes/dispatch/GenericBlockDispatchNode.java >>> @@ -14,6 +14,7 @@ public final class GenericBlockDispatchNode extends AbstractDispatchNode { >>> @Override >>> public Object executeDispatch(final VirtualFrame frame, >>> final Object[] arguments) { >>> + assert arguments[0] instanceof SBlock; >>> SBlock rcvr = CompilerDirectives.unsafeCast(arguments[0], SBlock.class, true, true); >>> return call.call(frame, rcvr.getMethod().getCallTarget(), arguments); >>> } >>> diff --git a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java >>> index b429795..331f946 100644 >>> --- a/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java >>> +++ b/src/som/interpreter/nodes/dispatch/GenericDispatchNode.java >>> @@ -24,6 +24,7 @@ public final class GenericDispatchNode extends AbstractDispatchWithLookupNode { >>> @Override >>> public Object executeDispatch( >>> final VirtualFrame frame, final Object[] arguments) { >>> + assert arguments[0] != null; >>> Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); >>> SInvokable method = lookupMethod(rcvr); >>> if (method != null) { >>> diff --git a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java >>> index 2d9106c..0ea1afc 100644 >>> --- a/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java >>> +++ b/src/som/interpreter/nodes/dispatch/SObjectCheckDispatchNode.java >>> @@ -24,6 +24,7 @@ public final class SObjectCheckDispatchNode extends AbstractDispatchNode { >>> @Override >>> public Object executeDispatch( >>> final VirtualFrame frame, final Object[] arguments) { >>> + assert arguments[0] != null; >>> Object rcvr = CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true); >>> if (rcvr instanceof SObject) { >>> return nextInCache.executeDispatch(frame, arguments); >>> diff --git a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java >>> index a5a3f96..3b5eee7 100644 >>> --- a/src/som/interpreter/nodes/nary/BinaryExpressionNode.java >>> +++ b/src/som/interpreter/nodes/nary/BinaryExpressionNode.java >>> @@ -29,6 +29,8 @@ public abstract class BinaryExpressionNode extends ExpressionNode >>> @Override >>> public final Object doPreEvaluated(final VirtualFrame frame, >>> final Object[] arguments) { >>> + assert arguments[0] != null; >>> + assert arguments[1] != null; >>> return executeEvaluated(frame, >>> CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), >>> CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true)); >>> diff --git a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java >>> index 9d4fb29..0d91e42 100644 >>> --- a/src/som/interpreter/nodes/nary/TernaryExpressionNode.java >>> +++ b/src/som/interpreter/nodes/nary/TernaryExpressionNode.java >>> @@ -29,6 +29,9 @@ public abstract class TernaryExpressionNode extends ExpressionNode >>> @Override >>> public final Object doPreEvaluated(final VirtualFrame frame, >>> final Object[] arguments) { >>> + assert arguments[0] != null; >>> + assert arguments[1] != null; >>> + assert arguments[2] != null; >>> return executeEvaluated(frame, >>> CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true), >>> CompilerDirectives.unsafeCast(arguments[1], Object.class, true, true), >>> diff --git a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java >>> index 7344d33..a7844a2 100644 >>> --- a/src/som/interpreter/nodes/nary/UnaryExpressionNode.java >>> +++ b/src/som/interpreter/nodes/nary/UnaryExpressionNode.java >>> @@ -25,6 +25,7 @@ public abstract class UnaryExpressionNode extends ExpressionNode >>> @Override >>> public final Object doPreEvaluated(final VirtualFrame frame, >>> final Object[] arguments) { >>> + assert arguments[0] != null; >>> return executeEvaluated(frame, >>> CompilerDirectives.unsafeCast(arguments[0], Object.class, true, true)); >>> } >>> diff --git a/src/som/primitives/reflection/AbstractSymbolDispatch.java b/src/som/primitives/reflection/AbstractSymbolDispatch.java >>> index df92632..f0e79a8 100644 >>> --- a/src/som/primitives/reflection/AbstractSymbolDispatch.java >>> +++ b/src/som/primitives/reflection/AbstractSymbolDispatch.java >>> @@ -94,6 +94,7 @@ public abstract class AbstractSymbolDispatch extends Node implements DispatchCha >>> if (this.selector == selector) { >>> Object[] arguments = SArguments.createSArgumentsArrayFrom(receiver, argsArr); >>> >>> + assert cachedSend instanceof PreevaluatedExpression; >>> PreevaluatedExpression realCachedSend = CompilerDirectives.unsafeCast(cachedSend, PreevaluatedExpression.class, true); >>> return realCachedSend.doPreEvaluated(frame, arguments); >>> } else { >>> diff --git a/src/som/vmobjects/SArray.java b/src/som/vmobjects/SArray.java >>> index c3dee89..36ac1d7 100644 >>> --- a/src/som/vmobjects/SArray.java >>> +++ b/src/som/vmobjects/SArray.java >>> @@ -21,6 +21,7 @@ public final class SArray { >>> public static Object get(final Object[] arr, final long idx) { >>> assert idx >= 0; >>> assert idx < arr.length; >>> + assert arr[(int) idx] != null; >>> return CompilerDirectives.unsafeCast(arr[(int) idx], Object.class, true, true); >>> } >>> >>> diff --git a/src/som/vmobjects/SObject.java b/src/som/vmobjects/SObject.java >>> index c95bc80..dd1e883 100644 >>> --- a/src/som/vmobjects/SObject.java >>> +++ b/src/som/vmobjects/SObject.java >>> @@ -106,10 +106,12 @@ public class SObject extends SAbstractObject { >>> } >>> >>> public final long[] getExtendedPrimFields() { >>> + assert extensionPrimFields instanceof long[]; >>> return CompilerDirectives.unsafeCast(extensionPrimFields, long[].class, true, true); >>> } >>> >>> public final Object[] getExtensionObjFields() { >>> + assert extensionObjFields instanceof Object[]; >>> return CompilerDirectives.unsafeCast(extensionObjFields, Object[].class, true, true); >>> } >>> >>> @@ -207,6 +209,7 @@ public class SObject extends SAbstractObject { >>> >>> @Override >>> public final SClass getSOMClass() { >>> + assert clazz instanceof SClass; >>> return CompilerDirectives.unsafeCast(clazz, SClass.class, true, true); >>> } >>> >>> >>> >>> >>>> >>>> -Gilles >>>> >>>> On Wed, Dec 10, 2014 at 12:15 AM, Stefan Marr wrote: >>>>> Hi Gilles: >>>>> >>>>> Here the log file. >>>>> >>>>> Best regards >>>>> Stefan >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> On 10 Dec 2014, at 00:04, Gilles Duboscq wrote: >>>>>> >>>>>> Hello Stefan, >>>>>> >>>>>> Thanks for the report. >>>>>> Could you send us the hs_err file as well (hs_err_pid68949.log)? >>>>>> >>>>>> -Gilles >>>>>> >>>>>> On Tue, Dec 9, 2014 at 11:35 PM, Stefan Marr wrote: >>>>>>> Hi: >>>>>>> >>>>>>> In one of my experiments, I got a hard crash of the Graal VM. >>>>>>> Error below. >>>>>>> >>>>>>> The error is somewhat dependent on either environment or for instance whether -ea and/or -esa are passed to the VM. >>>>>>> Though, I haven?t managed to find a way to avoid crashes reliably. >>>>>>> >>>>>>> To reproduced, you?ll need with a little API change (see patch below) or my version of GraalVM. >>>>>>> >>>>>>> git clone https://github.com/smarr/GraalVM.git >>>>>>> cd GraalVM >>>>>>> ./mx.sh --vm server build -p >>>>>>> cd ../ >>>>>>> git clone -b mt-vs-pe/without-control-specialization https://github.com/smarr/TruffleSOM.git >>>>>>> cd TruffleSOM >>>>>>> ant >>>>>>> ../GraalVM/mxtool/mx --vm server vm -Xbootclasspath/a:build/classes som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som DeltaBlue 1500 0 6000 >>>>>>> >>>>>>> Best regards >>>>>>> Stefan >>>>>>> >>>>>>> >>>>>>> # >>>>>>> # A fatal error has been detected by the Java Runtime Environment: >>>>>>> # >>>>>>> # SIGSEGV (0xb) at pc=0x000000010d601e5b, pid=68949, tid=4867 >>>>>>> # >>>>>>> # JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) >>>>>>> # Java VM: OpenJDK 64-Bit Server VM (25.25-b02-internal-graal-unknown-venus-2-2014-12-09_22-44-20_CET mixed mode bsd-amd64 compressed oops) >>>>>>> # Problematic frame: >>>>>>> # J 7192 Graal com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (191 bytes) @ 0x000000010d601e5b [0x000000010d601e20+0x3b] >>>>>>> # >>>>>>> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again >>>>>>> # >>>>>>> # An error report file with more information is saved as: >>>>>>> # /Users/smarr/Projects/PostDoc/Truffle/som/hs_err_pid68949.log >>>>>>> Loaded disassembler from /Users/smarr/Projects/PostDoc/Truffle/graal/jdk1.8.0_20/product/jre/lib/hsdis-amd64.dylib >>>>>>> Compiled method (Graal) 12445 7192 4 com.oracle.graal.truffle.OptimizedCallTarget::callRoot (191 bytes) >>>>>>> total in heap [0x000000010d601cd0,0x000000010d601f50] = 640 >>>>>>> relocation [0x000000010d601e08,0x000000010d601e20] = 24 >>>>>>> main code [0x000000010d601e20,0x000000010d601edd] = 189 >>>>>>> stub code [0x000000010d601edd,0x000000010d601ee0] = 3 >>>>>>> oops [0x000000010d601ee0,0x000000010d601ef8] = 24 >>>>>>> metadata [0x000000010d601ef8,0x000000010d601f00] = 8 >>>>>>> scopes data [0x000000010d601f00,0x000000010d601f18] = 24 >>>>>>> scopes pcs [0x000000010d601f18,0x000000010d601f48] = 48 >>>>>>> dependencies [0x000000010d601f48,0x000000010d601f50] = 8 >>>>>>> Compiled method (c2) 12445 2114 4 com.oracle.graal.truffle.OptimizedCallTarget::doInvoke (6 bytes) >>>>>>> total in heap [0x000000010c77b910,0x000000010c77bb58] = 584 >>>>>>> relocation [0x000000010c77ba48,0x000000010c77ba60] = 24 >>>>>>> main code [0x000000010c77ba60,0x000000010c77bac0] = 96 >>>>>>> stub code [0x000000010c77bac0,0x000000010c77bae8] = 40 >>>>>>> oops [0x000000010c77bae8,0x000000010c77baf0] = 8 >>>>>>> metadata [0x000000010c77baf0,0x000000010c77baf8] = 8 >>>>>>> scopes data [0x000000010c77baf8,0x000000010c77bb08] = 16 >>>>>>> scopes pcs [0x000000010c77bb08,0x000000010c77bb38] = 48 >>>>>>> dependencies [0x000000010c77bb38,0x000000010c77bb40] = 8 >>>>>>> handler table [0x000000010c77bb40,0x000000010c77bb58] = 24 >>>>>>> >>>>>>> >>>>>>> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>>>> index 8d00194..0670fad 100644 >>>>>>> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>>>> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java >>>>>>> @@ -104,7 +104,7 @@ public class OptimizedCallTarget extends InstalledCode implements RootCallTarget >>>>>>> if (root == null || !root.isCloningAllowed()) { >>>>>>> return null; >>>>>>> } >>>>>>> - return NodeUtil.cloneNode(root); >>>>>>> + return root.cloneRootNode(); >>>>>>> } >>>>>>> >>>>>>> public Assumption getNodeRewritingAssumption() { >>>>>>> diff --git a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>>>> index aebf748..2552eea 100644 >>>>>>> --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>>>> +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java >>>>>>> @@ -79,6 +79,10 @@ public abstract class RootNode extends Node { >>>>>>> return false; >>>>>>> } >>>>>>> >>>>>>> + public RootNode cloneRootNode() { >>>>>>> + return NodeUtil.cloneNode(this); >>>>>>> + } >>>>>>> + >>>>>>> /** >>>>>>> * Reports the execution count of a loop that is a child of this node. The optimization >>>>>>> * heuristics can use the loop count to guide compilation and inlining. >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Stefan Marr >>>>>>> INRIA Lille - Nord Europe >>>>>>> http://stefan-marr.de/research/ >>>>>>> >>>>>>> >>>>>>> >>>>> >>>>> -- >>>>> Stefan Marr >>>>> INRIA Lille - Nord Europe >>>>> http://stefan-marr.de/research/ >>>>> >>>>> >>>>> >>>>> >>> >>> -- >>> Stefan Marr >>> INRIA Lille - Nord Europe >>> http://stefan-marr.de/research/ >> >> -- >> Stefan Marr >> INRIA Lille - Nord Europe >> http://stefan-marr.de/research/ >> >> >> > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ > > > From java at stefan-marr.de Wed Dec 10 15:56:00 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 10 Dec 2014 16:56:00 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> Message-ID: Hi Gilles: > On 10 Dec 2014, at 16:42, Gilles Duboscq wrote: > > If you know that all path reaching this are dominated by some specific > check, you can use it as the condition such that the information from > this cast will only ever be used in those branches. Hm, well, there is no check. A Smalltalk method never has a lexical scope, and will thus never try to access the context field. A Smalltalk block has a lexical scope, and might access it, but it is _always_ guaranteed to have the context frame there. That?s what I am trying to say with the unsafeCast. On top of that, `context` is a final field. There is just nothing to check at runtime. At least, I don?t really see what I could check? > In general, we're planning to remove the unsafe operations from > CompilerDirectives anyway. Ok, so, your suggestions would be to just get rid of all usages of CompilerDirectives already? Thanks Stefan -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From andreas.woess at jku.at Wed Dec 10 16:09:49 2014 From: andreas.woess at jku.at (Andreas Woess) Date: Wed, 10 Dec 2014 17:09:49 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> Message-ID: <5488704D.1000002@jku.at> Hi Stefan, yes, it's best to get rid of all usages of unsafeCast; it's going to be deprecated/removed anyway as we're striving for a safe Truffle API. There shouldn't be any major performance impact from removing it. - andreas On 10/12/14 16:56, Stefan Marr wrote: > Hi Gilles: > >> On 10 Dec 2014, at 16:42, Gilles Duboscq wrote: >> >> If you know that all path reaching this are dominated by some specific >> check, you can use it as the condition such that the information from >> this cast will only ever be used in those branches. > Hm, well, there is no check. A Smalltalk method never has a lexical scope, and will thus never try to access the context field. > A Smalltalk block has a lexical scope, and might access it, but it is _always_ guaranteed to have the context frame there. > That?s what I am trying to say with the unsafeCast. > On top of that, `context` is a final field. There is just nothing to check at runtime. > > At least, I don?t really see what I could check? > >> In general, we're planning to remove the unsafe operations from >> CompilerDirectives anyway. > Ok, so, your suggestions would be to just get rid of all usages of CompilerDirectives already? > > > Thanks > Stefan > From duboscq at ssw.jku.at Wed Dec 10 16:42:46 2014 From: duboscq at ssw.jku.at (Gilles Duboscq) Date: Wed, 10 Dec 2014 17:42:46 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> Message-ID: On Wed, Dec 10, 2014 at 4:56 PM, Stefan Marr wrote: > Hi Gilles: > >> On 10 Dec 2014, at 16:42, Gilles Duboscq wrote: >> >> If you know that all path reaching this are dominated by some specific >> check, you can use it as the condition such that the information from >> this cast will only ever be used in those branches. > > Hm, well, there is no check. A Smalltalk method never has a lexical scope, and will thus never try to access the context field. > A Smalltalk block has a lexical scope, and might access it, but it is _always_ guaranteed to have the context frame there. > That?s what I am trying to say with the unsafeCast. > On top of that, `context` is a final field. There is just nothing to check at runtime. Yes but there are some objects where it's null and other where it's not. Otherwise you could put the assert in the SBlock constructor. So it means that in the end there is some kind of control-flow divergence between the handling of cases where it's null (methods) and where it's not (block). Perhaps simply through virtual dispatch? > > At least, I don?t really see what I could check? > >> In general, we're planning to remove the unsafe operations from >> CompilerDirectives anyway. > > Ok, so, your suggestions would be to just get rid of all usages of CompilerDirectives already? Yes, or at the very least, use false as the condition if there is nothing obvious/easily accessible to use. > > > Thanks > Stefan > > -- > Stefan Marr > INRIA Lille - Nord Europe > http://stefan-marr.de/research/ > > > -Gilles From java at stefan-marr.de Wed Dec 10 17:08:20 2014 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 10 Dec 2014 18:08:20 +0100 Subject: Hard Crash on OS X and Linux (but somewhat environment dependent) In-Reply-To: <5488704D.1000002@jku.at> References: <744E0127-DB78-4FF0-A130-43BD13D82889@stefan-marr.de> <67B7AECA-D2E4-40DA-B88C-EA64BC749391@stefan-marr.de> <5488704D.1000002@jku.at> Message-ID: Hi: > On 10 Dec 2014, at 17:09, Andreas Woess wrote: > > yes, it's best to get rid of all usages of unsafeCast; it's going to be > deprecated/removed anyway as we're striving for a safe Truffle API. > There shouldn?t be any major performance impact from removing it. Ok, removed all unsafe casts. Most benchmark results are unchanged. Richards sees a 15% performance drop, however. Best regards Stefan -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/ From doug.simon at oracle.com Thu Dec 11 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Thu, 11 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: fixed format string issues Message-ID: <201412110200.sBB20C3E023336@aojmv0008> Changeset: 74f612049e4e Author: Doug Simon Date: 2014-12-10 09:45 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/74f612049e4e fixed format string issues ! src/share/vm/graal/graalRuntime.cpp From doug.simon at oracle.com Thu Dec 11 19:43:31 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Thu, 11 Dec 2014 19:43:31 +0000 Subject: hg: graal/graal: 7 new changesets Message-ID: <201412111943.sBBJhVxv007496@aojmv0008> Changeset: 304b65422434 Author: Doug Simon Date: 2014-12-11 10:18 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/304b65422434 improved javadoc ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Changeset: 81a26fb13a9e Author: Doug Simon Date: 2014-12-11 10:19 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/81a26fb13a9e removed pluggable compiler support in GraalCompilerTest ! graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Changeset: e8634d0e6667 Author: adlertz Date: 2014-12-11 15:46 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/e8634d0e6667 Added GeneratePIC flag ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java Changeset: aa4f2e3629ca Author: adlertz Date: 2014-12-11 19:35 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/aa4f2e3629ca Added card table PIC support + graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java + graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableAddressNode.java + graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableShiftNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java ! src/share/vm/graal/graalCodeInstaller.cpp ! src/share/vm/graal/graalCodeInstaller.hpp ! src/share/vm/graal/vmStructs_graal.hpp Changeset: c9d57a5fb655 Author: adlertz Date: 2014-12-11 19:35 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c9d57a5fb655 Added PIC support for metaspace access ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCompare.java ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java Changeset: 058cbb02b58c Author: adlertz Date: 2014-12-11 19:35 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/058cbb02b58c Added public getters for frame and register map ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java Changeset: 54712aa2d3ee Author: Doug Simon Date: 2014-12-11 20:02 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/54712aa2d3ee Merge. From doug.simon at oracle.com Fri Dec 12 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Fri, 12 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: made CFGPrinterObserver reset (upon close) properly Message-ID: <201412120200.sBC206ux024482@aojmv0008> Changeset: 96861e3f8cc5 Author: Doug Simon Date: 2014-12-11 22:14 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/96861e3f8cc5 made CFGPrinterObserver reset (upon close) properly ! graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java From doug.simon at oracle.com Sat Dec 13 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Sat, 13 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 8 new changesets Message-ID: <201412130200.sBD207QO017850@aojmv0008> Changeset: b026b6d86ab6 Author: Lukas Stadler Date: 2014-11-28 16:07 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/b026b6d86ab6 modify binary condition profiles so that they canonicalize away sooner ! graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/BinaryConditionProfile.java Changeset: c9576b6cf7d6 Author: Stefan Anzinger Date: 2014-12-12 19:43 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c9576b6cf7d6 [SPARC] Fix when rethrowing exceptions. (Crashed the CompileTheWorld) ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java Changeset: 6ace9e5bc384 Author: Stefan Anzinger Date: 2014-12-12 20:02 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6ace9e5bc384 [SPARC] Fix trap instruction ! graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java ! graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java Changeset: 7cc21427d54b Author: Stefan Anzinger Date: 2014-12-12 20:29 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/7cc21427d54b Merge ! graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Handler.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Invocation.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/LinkedIdentityHashMap.java - graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/ProxyUtil.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/DeoptimizationStub.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UncommonTrapStub.java ! graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBreakpointOp.java ! graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java ! graal/com.oracle.graal.printer/src/com/oracle/graal/printer/HexCodeFile.java Changeset: 8aeee4179e22 Author: Stefan Anzinger Date: 2014-12-12 20:54 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8aeee4179e22 Fixing checkstyle issues. ! graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Changeset: 449583258a15 Author: Doug Simon Date: 2014-12-12 23:41 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/449583258a15 provided runtime independent toString() for HotSpotVMConfig ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Changeset: f17b2a0303db Author: Michael Van De Vanter Date: 2014-12-12 15:54 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/f17b2a0303db Truffle/Source: change signature of Source factory methods to take literal text as CharSequence instead of String. ! graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Changeset: db8ce7ad932b Author: Michael Van De Vanter Date: 2014-12-12 15:57 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/db8ce7ad932b Merge with 449583258a1575ecc8e498103770eea2a3972fff From doug.simon at oracle.com Sun Dec 14 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Sun, 14 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: First draft of option classification. Message-ID: <201412140200.sBE207Sg014917@aojmv0008> Changeset: ecb9d0cedbab Author: Thomas Wuerthinger Date: 2014-12-13 15:03 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/ecb9d0cedbab First draft of option classification. ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LocationMarker.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/OptimizingLinearScanWalker.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/HighTier.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LowTier.java ! graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java ! graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java ! graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/replacements/HSAILNewObjectSnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/InstanceOfSnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MonitorSnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java ! graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java ! graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java ! graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java ! graal/com.oracle.graal.options/src/com/oracle/graal/options/Option.java + graal/com.oracle.graal.options/src/com/oracle/graal/options/OptionType.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DeadCodeEliminationPhase.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java ! graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java ! graal/com.oracle.graal.printer/src/com/oracle/graal/printer/NoDeadCodeVerifyHandler.java ! graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapePhase.java From doug.simon at oracle.com Mon Dec 15 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Mon, 15 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: handle null in HotSpotzreferenceMap.getFrameMap()|getRegisterMap() Message-ID: <201412150200.sBF20609014001@aojmv0008> Changeset: 72d0cd2eeca4 Author: Doug Simon Date: 2014-12-14 13:43 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/72d0cd2eeca4 handle null in HotSpotzreferenceMap.getFrameMap()|getRegisterMap() ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java From jules_gosnell at yahoo.com Mon Dec 15 09:29:23 2014 From: jules_gosnell at yahoo.com (Jules Gosnell) Date: Mon, 15 Dec 2014 09:29:23 +0000 Subject: SEGV / amdkfd-1.0 Message-ID: <548EA9F3.4050908@yahoo.com> Guys, I upgraded to amdkfd-1.0 on my Fedora Rawhide on my A10 7850K box a few days ago. Since then, the testsuite that I run on my Sumatra/Graal-based project has been crashing out of its JVM fairly early on. It runs on a fresh Java9/Graal build every night. Here is the console.log: http://ouroboros.dyndns-free.com/ci/view/clumatra/job/clumatra-hardware-acceleration/572/ Here is the hs_err_pidXXXX.log: http://ouroboros.dyndns-free.com/ci/view/clumatra/job/clumatra-hardware-acceleration/ws/hs_err_pid30376.log and here is a link to the top of the project on Jenkins in case you want to take a further look around: http://ouroboros.dyndns-free.com/ci/view/clumatra/job/clumatra-hardware-acceleration/ It may well be that I have broken something in the upgrade, or that there is some new flag that I need to set ? I've looked around and can't find anything obvious - so here I am :-) Any help would be very gratefully received. Please feel free to ply me with questions for more details. regards, Jules From doug.simon at oracle.com Wed Dec 17 02:00:08 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Wed, 17 Dec 2014 02:00:08 +0000 Subject: hg: graal/graal: 27 new changesets Message-ID: <201412170200.sBH209G7019328@aojmv0008> Changeset: 1c12cf39281d Author: Michael Van De Vanter Date: 2014-12-14 18:10 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/1c12cf39281d Truffle/Source: redefine equality of FileSource objects strictly in terms of the canonicalized file path, for use as hash key. ! graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Changeset: 8d8523ed37e3 Author: Andreas Woess Date: 2014-12-13 03:23 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8d8523ed37e3 OM: copy hidden properties, too ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java Changeset: e04d70a4d3ae Author: Lukas Stadler Date: 2014-12-15 14:54 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/e04d70a4d3ae prefer profile methods during partial evaluation ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java ! graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Changeset: b7d28233da5d Author: Roland Schatz Date: 2014-12-15 15:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/b7d28233da5d Add missing //JaCoCo Exclude. ! graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java Changeset: 6707a08faa9b Author: Lukas Stadler Date: 2014-12-15 16:34 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6707a08faa9b fix bug that prevented constants from being boxed ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java Changeset: 45f8b94b3b36 Author: Josef Eisl Date: 2014-12-15 18:51 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/45f8b94b3b36 AMD64HotSpotNodeLIRBuilder: fix kinds for emitIndirectCall() values. ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Changeset: 0a109f5d5873 Author: Roland Schatz Date: 2014-12-15 19:15 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/0a109f5d5873 Add unwrap method to arithmetic operations. ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java Changeset: 823f499a247c Author: Christian Wimmer Date: 2014-12-15 11:32 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/823f499a247c Store initial value (the value set in source code) of an option ! graal/com.oracle.graal.options/src/com/oracle/graal/options/OptionValue.java Changeset: 137773e5250c Author: Christian Wimmer Date: 2014-12-15 11:33 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/137773e5250c Factor out VM-independent parts of option parsing ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java + graal/com.oracle.graal.options/src/com/oracle/graal/options/OptionUtils.java Changeset: 18d0f83cd290 Author: Christian Wimmer Date: 2014-12-15 13:01 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/18d0f83cd290 Add code missing in initial value handling for options ! graal/com.oracle.graal.options/src/com/oracle/graal/options/OptionValue.java Changeset: 3f15de59df5e Author: Christian Wimmer Date: 2014-12-15 17:00 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/3f15de59df5e Support multiple fields in StableOptionValue ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantReflectionProvider.java Changeset: 2885aafd812f Author: Tom Rodriguez Date: 2014-12-15 12:25 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/2885aafd812f Backout useless changeset c2b23f6e4603 ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Changeset: 0eba324e27db Author: Tom Rodriguez Date: 2014-12-15 12:56 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/0eba324e27db strcpy doesn't handle overlapping strings ! src/share/vm/compiler/compilerOracle.cpp Changeset: 8923610115c9 Author: Tom Rodriguez Date: 2014-12-15 13:10 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/8923610115c9 Capture worst case element type for Array.newInstance if known ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java Changeset: abcff66a23b0 Author: Tom Rodriguez Date: 2014-12-15 16:00 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/abcff66a23b0 Add ability to programmatically set the dump level + graal/com.oracle.graal.debug/src/com/oracle/graal/debug/TopLevelDebugConfig.java ! graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Changeset: 3f38534e9a10 Author: Tom Rodriguez Date: 2014-12-15 17:53 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/3f38534e9a10 Merge Changeset: d6c33eb93b9f Author: Josef Eisl Date: 2014-12-16 10:59 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d6c33eb93b9f Use Register.asValue(LIRKind) where appropriate. ! graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java ! graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Changeset: 8d7ecba12c5d Author: Roland Schatz Date: 2014-12-16 14:04 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8d7ecba12c5d Check for compatible stamps in read elimination. ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Changeset: ec1b0b097d82 Author: Roland Schatz Date: 2014-12-16 14:16 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/ec1b0b097d82 Ignore $jacocoInit methods in coverage tests. ! graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaMethod.java ! graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java Changeset: 5281f8e34a4a Author: Tom Rodriguez Date: 2014-12-16 08:56 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/5281f8e34a4a Use memmove for overlapping copy ! src/share/vm/compiler/compilerOracle.cpp Changeset: b2859128b76a Author: Tom Rodriguez Date: 2014-12-16 10:20 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/b2859128b76a Only log dependencies if LogCompilation is on ! src/share/vm/graal/graalEnv.cpp Changeset: ee26b8eb1601 Author: Tom Rodriguez Date: 2014-12-16 13:28 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/ee26b8eb1601 Check for overzeroing in the TLAB ! src/share/vm/memory/threadLocalAllocBuffer.cpp Changeset: abd10b6ef99d Author: Tom Rodriguez Date: 2014-12-16 13:30 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/abd10b6ef99d Benchmark counters should have their own LocationIdentity ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Changeset: 08b17b738500 Author: Tom Rodriguez Date: 2014-12-16 13:36 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/08b17b738500 Add hooks for verifying heap from generated code ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AssertionSnippets.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java + graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/VerifyHeapNode.java + graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/VerifyHeapAtReturnPhase.java ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Changeset: a4fbcdce06c8 Author: Stefan Anzinger Date: 2014-12-15 19:32 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a4fbcdce06c8 [GRAAL-914] SPARC VM Crash when run with -G:+PrintIdealGraphFile and -XX:+PrintDeoptimizationDetails ! src/share/vm/classfile/javaClasses.hpp Changeset: 28e46ea20c93 Author: Stefan Anzinger Date: 2014-12-16 23:36 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/28e46ea20c93 [SPARC] Attempt to fix the NullPointerException problem ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Changeset: d854f8a5256f Author: Stefan Anzinger Date: 2014-12-16 23:37 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d854f8a5256f Merge From doug.simon at oracle.com Thu Dec 18 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Thu, 18 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 6 new changesets Message-ID: <201412180200.sBI208M1027960@aojmv0008> Changeset: 41d12b67bc9e Author: Tom Rodriguez Date: 2014-12-16 19:25 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/41d12b67bc9e Improve javadoc ! graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java Changeset: 0ce6ee3d7a98 Author: Tom Rodriguez Date: 2014-12-16 19:26 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/0ce6ee3d7a98 lzcnt inferStamp reports too large values for Integer.numberOfLeadingZeros ! graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64CountLeadingZerosNode.java Changeset: 5dcb9fdea75a Author: Stefan Anzinger Date: 2014-12-17 08:04 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/5dcb9fdea75a [SPARC] use now a dedicated scratch register for isMethodHandleReturnOffset value, as o7 may contain valuable information ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java Changeset: b6e98df9ba7d Author: Josef Eisl Date: 2014-12-16 21:02 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/b6e98df9ba7d HotSpotReferenceMap: fix bitmap clearing in setOop()/clearOop() and setNarrowOop()/clearNarrowOop(). ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java Changeset: 3d4e1284d39e Author: Josef Eisl Date: 2014-12-15 18:52 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3d4e1284d39e LocationMarker: fix handling of illegal values. ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LocationMarker.java Changeset: ed8477e2561c Author: Josef Eisl Date: 2014-12-16 21:48 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/ed8477e2561c Reenable LocationMarker. ! graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LocationMarker.java From doug.simon at oracle.com Thu Dec 18 03:56:15 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Thu, 18 Dec 2014 03:56:15 +0000 Subject: hg: graal/graal: 3 new changesets Message-ID: <201412180356.sBI3uFWo017243@aojmv0008> Changeset: ae5033a78f1d Author: Doug Simon Date: 2014-12-18 12:10 +1000 URL: http://hg.openjdk.java.net/graal/graal/rev/ae5033a78f1d improved documentation around the mechanism for generating graalRuntime.inline.hpp ! graal/com.oracle.graal.hotspot.sourcegen/src/com/oracle/graal/hotspot/sourcegen/GenGraalRuntimeInlineHpp.java ! mx/mx_graal.py Changeset: 4836c2abc884 Author: Doug Simon Date: 2014-12-18 12:12 +1000 URL: http://hg.openjdk.java.net/graal/graal/rev/4836c2abc884 mx: removed hard-coded -Xms setting for the 'build' and 'checkstyle' commands to try and avoid unnecessary swapping on low(er) memory machines ! mxtool/mx.py Changeset: 88c280297bd2 Author: Doug Simon Date: 2014-12-18 13:10 +1000 URL: http://hg.openjdk.java.net/graal/graal/rev/88c280297bd2 put GeneratedSourcesSha1 into com.oracle.graal.hotspot.sourcegen package ! mx/mx_graal.py ! src/share/vm/graal/graalRuntime.cpp From vladimir.kozlov at oracle.com Fri Dec 19 01:22:57 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Thu, 18 Dec 2014 17:22:57 -0800 Subject: assert((call[0] == 0x40 || call[0] == 0x41) && call[1] == 0xFF) Message-ID: <54937DF1.20006@oracle.com> Hi, I think next assert is incorrect: # Internal Error (/export/kvn/build/AOT/121714/hotspot/src/cpu/x86/vm/graalCodeInstaller_x86.cpp:45), pid=11105, tid=2 # assert((call[0] == 0x40 || call[0] == 0x41) && call[1] == 0xFF) failed: expected call with rex/rexb prefix byte # According to Intel's manual in 64-bit mode near calls don't need REX prefix if first GP registers are used. And we follow it: private int prefixAndEncode(int regEnc, boolean byteinst) { if (regEnc >= 8) { emitByte(Prefix.REXB); return regEnc - 8; } else if (byteinst && regEnc >= 4) { emitByte(Prefix.REX); } return regEnc; } public final void call(Register src) { int encode = prefixAndEncode(src.encoding); emitByte(0xFF); emitByte(0xD0 | encode); } I hit the assert when RAX is used for destination: 0xfffffd7fe50a1e10: movq $0x0000000000000000,%rax 0xfffffd7fe50a1e1a: call *%eax So why you expect the call should have REX? Do you have somewhere hard-coded registers used for calls and don't expect RAX? Thanks, Vladimir From vladimir.kozlov at oracle.com Fri Dec 19 02:56:49 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Thu, 18 Dec 2014 18:56:49 -0800 Subject: RFR(S) fix assert in CodeInstaller::pd_next_offset() on x86 Message-ID: <549393F1.5080604@oracle.com> http://cr.openjdk.java.net/~kvn/graal_x86_assert_fix/webrev/ According to Intel's manual in 64-bit mode call instructions don't need REX prefix. Only REX_B can be added for extended registers. Thanks, Vladimir From doug.simon at oracle.com Fri Dec 19 08:34:02 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Fri, 19 Dec 2014 08:34:02 +0000 Subject: hg: graal/graal: 13 new changesets Message-ID: <201412190834.sBJ8Y2UZ018670@aojmv0008> Changeset: 37a5c6b8b930 Author: Tom Rodriguez Date: 2014-12-17 13:39 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/37a5c6b8b930 Log deopt before deoptimizing the frame ! src/share/vm/runtime/deoptimization.cpp Changeset: cbb097347545 Author: Tom Rodriguez Date: 2014-12-17 19:57 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/cbb097347545 Convert compare against Class to compare against Klass ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ClassGetHubNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Changeset: b56e88144e0a Author: Tom Rodriguez Date: 2014-12-17 20:00 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/b56e88144e0a prefer exact class matches when searching for unit tests with method name ! mx/mx_graal.py Changeset: ba61e58aafbc Author: Tom Rodriguez Date: 2014-12-18 01:32 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/ba61e58aafbc Handle NULL_POINTER when converting HubGetClassNode ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java Changeset: d1826470d1ec Author: Lukas Stadler Date: 2014-12-18 14:48 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d1826470d1ec continuously update method queue in PartialEvaluator.expandTree ! graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Changeset: 2206dae9a802 Author: Stefan Anzinger Date: 2014-12-17 16:50 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/2206dae9a802 [SPARC] Allow null base register on memory access ! graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java ! graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Changeset: 305e6a73117d Author: Stefan Anzinger Date: 2014-12-18 15:23 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/305e6a73117d Merge Changeset: 6484e5c068c7 Author: Roland Schatz Date: 2014-12-18 15:31 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6484e5c068c7 Generalize object reading in HotSpotMemoryAccessProvider. ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMemoryAccessProviderImpl.java ! src/share/vm/graal/graalCompilerToVM.cpp Changeset: ab9d3ff6829b Author: Tom Rodriguez Date: 2014-12-18 09:17 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/ab9d3ff6829b Pass constant reflection into ConvertNode.convert ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ClassGetHubNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/KlassLayoutHelperNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java Changeset: d747b9e5695c Author: Andreas Woess Date: 2014-12-18 18:31 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/d747b9e5695c ConditionalElimination: Eliminate ShortCircuitOr condition if first input is known to be false ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Changeset: f88692118a85 Author: Tom Rodriguez Date: 2014-12-18 12:24 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/f88692118a85 SPARC lowering shouldn't filter out ConvertNodes ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLoweringProvider.java Changeset: d5ea82229f01 Author: Tom Rodriguez Date: 2014-12-18 14:11 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/d5ea82229f01 handle FloatConvertNode in sparc lowering ! graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLoweringProvider.java Changeset: a49e0ed940c2 Author: Andreas Woess Date: 2014-12-19 02:27 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a49e0ed940c2 Back out changeset d747b9e5695c ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java From vladimir.kozlov at oracle.com Fri Dec 19 20:09:57 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Fri, 19 Dec 2014 12:09:57 -0800 Subject: Missing permission sets in mx_graal.py Message-ID: <54948615.2070406@oracle.com> --- a/mx/mx_graal.py Thu Dec 18 18:34:21 2014 -0800 +++ b/mx/mx_graal.py Fri Dec 19 11:37:53 2014 -0800 @@ -435,6 +435,8 @@ chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) shutil.move(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), 'original')) + if mx.get_os() != 'windows': + os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) with open(jvmCfg, 'w') as fp: for line in jvmCfgLines: fp.write(line) @@ -447,6 +449,8 @@ for line in f: releaseFileLines.append(line) + if mx.get_os() != 'windows': + os.chmod(releaseFile, JDK_UNIX_PERMISSIONS_FILE) with open(releaseFile, 'w') as fp: for line in releaseFileLines: if line.startswith("SOURCE="): Thanks, Vladimir From vladimir.kozlov at oracle.com Fri Dec 19 20:10:08 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Fri, 19 Dec 2014 12:10:08 -0800 Subject: forte.cpp:639:3: error: expression result unused Message-ID: <54948620.5050606@oracle.com> Compilation failure: src/share/vm/prims/forte.cpp:639:3: error: expression result unused [-Werror,-Wunused-value] collector_func_load((char*)name, NULL, NULL, start, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/share/vm/prims/forte.cpp:616:52: note: expanded from macro 'collector_func_load' #define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) ^ The fix: --- a/src/share/vm/prims/forte.cpp Thu Dec 18 18:34:21 2014 -0800 +++ b/src/share/vm/prims/forte.cpp Fri Dec 19 12:05:03 2014 -0800 @@ -613,7 +613,7 @@ #ifdef __APPLE__ // XXXDARWIN: Link errors occur even when __attribute__((weak_import)) // is added -#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) +#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) ((void)0) #else void collector_func_load(char* name, void* null_argument_1, Thanks, Vladimir From tom.rodriguez at oracle.com Fri Dec 19 20:29:12 2014 From: tom.rodriguez at oracle.com (Tom Rodriguez) Date: Fri, 19 Dec 2014 12:29:12 -0800 Subject: Missing permission sets in mx_graal.py In-Reply-To: <54948615.2070406@oracle.com> References: <54948615.2070406@oracle.com> Message-ID: <7A62C485-B9C6-41C8-A42B-1DCA4F5DBBE0@oracle.com> This fixes the problem with using a read-only JDK as your base image, right? tom On Dec 19, 2014, at 12:09 PM, Vladimir Kozlov wrote: > --- a/mx/mx_graal.py Thu Dec 18 18:34:21 2014 -0800 > +++ b/mx/mx_graal.py Fri Dec 19 11:37:53 2014 -0800 > @@ -435,6 +435,8 @@ > chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) > shutil.move(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), 'original')) > > + if mx.get_os() != 'windows': > + os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) > with open(jvmCfg, 'w') as fp: > for line in jvmCfgLines: > fp.write(line) > @@ -447,6 +449,8 @@ > for line in f: > releaseFileLines.append(line) > > + if mx.get_os() != 'windows': > + os.chmod(releaseFile, JDK_UNIX_PERMISSIONS_FILE) > with open(releaseFile, 'w') as fp: > for line in releaseFileLines: > if line.startswith("SOURCE="): > > Thanks, > Vladimir From christian.thalinger at oracle.com Fri Dec 19 20:36:55 2014 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Fri, 19 Dec 2014 12:36:55 -0800 Subject: forte.cpp:639:3: error: expression result unused In-Reply-To: <54948620.5050606@oracle.com> References: <54948620.5050606@oracle.com> Message-ID: > On Dec 19, 2014, at 12:10 PM, Vladimir Kozlov wrote: > > Compilation failure: > > src/share/vm/prims/forte.cpp:639:3: error: expression result unused [-Werror,-Wunused-value] > > collector_func_load((char*)name, NULL, NULL, start, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > src/share/vm/prims/forte.cpp:616:52: note: expanded from macro 'collector_func_load' > > #define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) > ^ > > The fix: > > --- a/src/share/vm/prims/forte.cpp Thu Dec 18 18:34:21 2014 -0800 > +++ b/src/share/vm/prims/forte.cpp Fri Dec 19 12:05:03 2014 -0800 > @@ -613,7 +613,7 @@ > #ifdef __APPLE__ > // XXXDARWIN: Link errors occur even when __attribute__((weak_import)) > // is added > -#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) > +#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) ((void)0) > #else > void collector_func_load(char* name, > void* null_argument_1, That was fixed in JDK 9 by: https://bugs.openjdk.java.net/browse/JDK-8022263 which was not backported to 8u. > > > Thanks, > Vladimir From tom.rodriguez at oracle.com Fri Dec 19 20:36:38 2014 From: tom.rodriguez at oracle.com (Tom Rodriguez) Date: Fri, 19 Dec 2014 12:36:38 -0800 Subject: RFR(S) fix assert in CodeInstaller::pd_next_offset() on x86 In-Reply-To: <549393F1.5080604@oracle.com> References: <549393F1.5080604@oracle.com> Message-ID: <5319F729-2B53-4FC3-B94A-531D86E11E8E@oracle.com> Thanks. I?ll push this along with your other recent fixes. tom On Dec 18, 2014, at 6:56 PM, Vladimir Kozlov wrote: > http://cr.openjdk.java.net/~kvn/graal_x86_assert_fix/webrev/ > > According to Intel's manual in 64-bit mode call instructions don't need REX prefix. Only REX_B can be added for extended registers. > > Thanks, > Vladimir From vladimir.kozlov at oracle.com Fri Dec 19 20:44:30 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Fri, 19 Dec 2014 12:44:30 -0800 Subject: Missing permission sets in mx_graal.py In-Reply-To: <7A62C485-B9C6-41C8-A42B-1DCA4F5DBBE0@oracle.com> References: <54948615.2070406@oracle.com> <7A62C485-B9C6-41C8-A42B-1DCA4F5DBBE0@oracle.com> Message-ID: <54948E2E.3070401@oracle.com> Yes, I use promoted jdk and it does not have write permission on files. When mx_graal.py copies it locally, it changes only permission of directories but not files. Thanks, Vladimir On 12/19/14 12:29 PM, Tom Rodriguez wrote: > This fixes the problem with using a read-only JDK as your base image, right? > > tom > > On Dec 19, 2014, at 12:09 PM, Vladimir Kozlov wrote: > >> --- a/mx/mx_graal.py Thu Dec 18 18:34:21 2014 -0800 >> +++ b/mx/mx_graal.py Fri Dec 19 11:37:53 2014 -0800 >> @@ -435,6 +435,8 @@ >> chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) >> shutil.move(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), 'original')) >> >> + if mx.get_os() != 'windows': >> + os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) >> with open(jvmCfg, 'w') as fp: >> for line in jvmCfgLines: >> fp.write(line) >> @@ -447,6 +449,8 @@ >> for line in f: >> releaseFileLines.append(line) >> >> + if mx.get_os() != 'windows': >> + os.chmod(releaseFile, JDK_UNIX_PERMISSIONS_FILE) >> with open(releaseFile, 'w') as fp: >> for line in releaseFileLines: >> if line.startswith("SOURCE="): >> >> Thanks, >> Vladimir > From doug.simon at oracle.com Fri Dec 19 21:43:32 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Fri, 19 Dec 2014 21:43:32 +0000 Subject: hg: graal/graal: 7 new changesets Message-ID: <201412192143.sBJLhW4B023743@aojmv0008> Changeset: fdf29cc07ec2 Author: Thomas Wuerthinger Date: 2014-12-19 14:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/fdf29cc07ec2 Improved error message in mx tool when package statement cannot be found. ! mxtool/mx.py Changeset: 8153d8cf264c Author: Thomas Wuerthinger Date: 2014-12-19 14:58 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8153d8cf264c Added unit test for StampFactoryTest.createParameterStamps. ! .hgignore + graal/com.oracle.graal.phases.common.test/src/com/oracle/graal/phases/common/test/StampFactoryTest.java ! mx/suite.py Changeset: 03861c619acb Author: Thomas Wuerthinger Date: 2014-12-19 15:05 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/03861c619acb Canonicalize project dependencies. ! mx/suite.py Changeset: e2460f2b3121 Author: Thomas Wuerthinger Date: 2014-12-19 15:28 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/e2460f2b3121 Fix Checkstyle error. ! graal/com.oracle.graal.phases.common.test/src/com/oracle/graal/phases/common/test/StampFactoryTest.java Changeset: 1efe32c9d761 Author: Thomas Wuerthinger Date: 2014-12-19 21:23 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/1efe32c9d761 Update CHANGELOG and AUTHORS file. ! AUTHORS.md ! CHANGELOG.md Changeset: 61739e1b2296 Author: Thomas Wuerthinger Date: 2014-12-19 21:27 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/61739e1b2296 Added one more reference to the CHANGELOG. ! CHANGELOG.md Changeset: 97f2038b7c4a Author: Thomas Wuerthinger Date: 2014-12-19 21:31 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/97f2038b7c4a changelog: graal-0.6 ! .hgtags ! CHANGELOG.md From doug.simon at oracle.com Fri Dec 19 22:06:53 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Fri, 19 Dec 2014 22:06:53 +0000 Subject: hg: graal/graal: 3 new changesets Message-ID: <201412192206.sBJM6raF027966@aojmv0008> Changeset: d611982fb10e Author: Tom Rodriguez Date: 2014-12-19 12:40 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/d611982fb10e Fixed decoding of call instruction Contributed-by: vladimir.kozlov at oracle.com ! src/cpu/x86/vm/graalCodeInstaller_x86.cpp Changeset: d7ec30ebb0f2 Author: Tom Rodriguez Date: 2014-12-19 12:42 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/d7ec30ebb0f2 Properly chmod files modified when creating JDK image Contributed-by: vladimir.kozlov at oracle.com ! mx/mx_graal.py Changeset: 61b6c57421c2 Author: Tom Rodriguez Date: 2014-12-19 12:44 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/61b6c57421c2 Add cast to void to fix compilation warning. Contributed-by: vladimir.kozlov at oracle.com ! src/share/vm/prims/forte.cpp From thomas.wuerthinger at oracle.com Fri Dec 19 22:12:07 2014 From: thomas.wuerthinger at oracle.com (Thomas Wuerthinger) Date: Fri, 19 Dec 2014 23:12:07 +0100 Subject: Graal Release 0.6, Truffle API Changes, New Release Schedule Message-ID: <3ECC1917-C284-4535-9184-FEC5D73CE41E@oracle.com> We are pleased to announce the release of Graal version 0.6. The main focus of the release are to make enhancements of the Truffle API available for language implementors. Some of the projects building language runtimes on top of Graal are maturing and require more frequent updates. Therefore, we will make Graal releases more frequent with one release per month. For more detailed information about the changes, see the change log [1]. There have been so far several open source language implementations on top of Graal started and we are very happy about this development. Here is a list of the most active ones: - Ruby: https://github.com/jruby/jruby/wiki/Truffle - R: https://bitbucket.org/allr/fastr - Python: https://bitbucket.org/ssllab/zippy - Smalltalk: https://github.com/smarr/TruffleSOM Please do not hesitate to start your own language implementation or join one of the existing efforts. Ping for example @ChrisGSeaton to help out with the Truffle branch of JRuby. We would like to thank everyone who helped with this release. The updated authors file reflects a further increasing number of contributors to this project [2]. We very much appreciate both direct contributions as well as feedback! The Graal Team [1] https://github.com/OracleLabs/GraalVM/blob/f56b94a134587faa06f31bb4824c6547d81b6803/CHANGELOG.md [2] https://github.com/OracleLabs/GraalVM/blob/e37ec2226b9114177c944836a20a5b2da7e32847/AUTHORS.md From vladimir.kozlov at oracle.com Sat Dec 20 00:38:06 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Fri, 19 Dec 2014 16:38:06 -0800 Subject: RFR(S) fix assert in CodeInstaller::pd_next_offset() on x86 In-Reply-To: <5319F729-2B53-4FC3-B94A-531D86E11E8E@oracle.com> References: <549393F1.5080604@oracle.com> <5319F729-2B53-4FC3-B94A-531D86E11E8E@oracle.com> Message-ID: <5494C4EE.5090100@oracle.com> Thank you, Tom Vladimir On 12/19/14 12:36 PM, Tom Rodriguez wrote: > Thanks. I?ll push this along with your other recent fixes. > > tom > > On Dec 18, 2014, at 6:56 PM, Vladimir Kozlov wrote: > >> http://cr.openjdk.java.net/~kvn/graal_x86_assert_fix/webrev/ >> >> According to Intel's manual in 64-bit mode call instructions don't need REX prefix. Only REX_B can be added for extended registers. >> >> Thanks, >> Vladimir > From doug.simon at oracle.com Sat Dec 20 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Sat, 20 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: 3 new changesets Message-ID: <201412200200.sBK207vG026898@aojmv0008> Changeset: e04e41c3cb6e Author: Tom Rodriguez Date: 2014-12-19 12:09 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/e04e41c3cb6e Handle null in readKlassPointer ! graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMemoryAccessProviderImpl.java Changeset: a61d63bd1e56 Author: Tom Rodriguez Date: 2014-12-19 15:49 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/a61d63bd1e56 Fix selecting last element of RangeSlider ! src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSlider.java Changeset: b1b5bfe4c8a7 Author: Tom Rodriguez Date: 2014-12-19 15:50 -0800 URL: http://hg.openjdk.java.net/graal/graal/rev/b1b5bfe4c8a7 Show group name as tooltip in IGV ! src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java From doug.simon at oracle.com Sun Dec 21 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Sun, 21 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: 4 new changesets Message-ID: <201412210200.sBL206Gb016037@aojmv0008> Changeset: 2bbe4ecff88c Author: Bernhard Urban Date: 2014-12-20 12:43 +0200 URL: http://hg.openjdk.java.net/graal/graal/rev/2bbe4ecff88c authors: delete duplicated entry ! AUTHORS.md Changeset: 3b60f720b955 Author: Bernhard Urban Date: 2014-12-20 11:45 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3b60f720b955 partial backout of 97f2038b7 ! .hgtags Changeset: 6279ff5170d0 Author: Bernhard Urban Date: 2014-12-20 11:45 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6279ff5170d0 Added tag graal-0.6 for changeset 3b60f720b955 ! .hgtags Changeset: c968eefb992b Author: Chris Seaton Date: 2014-12-20 15:56 +0000 URL: http://hg.openjdk.java.net/graal/graal/rev/c968eefb992b Empty commit to advance version number. From doug.simon at oracle.com Mon Dec 22 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Mon, 22 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 3 new changesets Message-ID: <201412220200.sBM208QZ014933@aojmv0008> Changeset: 5df121664e08 Author: Doug Simon Date: 2014-12-21 13:53 +1000 URL: http://hg.openjdk.java.net/graal/graal/rev/5df121664e08 added factory methods for creating sets ! graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/CollectionsFactory.java ! graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Changeset: 220d7f242e57 Author: Doug Simon Date: 2014-12-21 13:56 +1000 URL: http://hg.openjdk.java.net/graal/graal/rev/220d7f242e57 use deterministic iteration-order data structures ! graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java ! graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java ! graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java ! graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryMapNode.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java ! graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/util/HashSetNodeEventListener.java ! graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ReentrantBlockIterator.java ! graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationBlockState.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapePhase.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java ! graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Changeset: 8ac074d3e7c0 Author: Stefan Anzinger Date: 2014-12-21 10:45 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8ac074d3e7c0 SPARC support for Truffle ! graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java + graal/com.oracle.graal.truffle.hotspot.sparc/src/com/oracle/graal/truffle/hotspot/sparc/SPARCOptimizedCallTargetInstumentationFactory.java ! mx/suite.py From doug.simon at oracle.com Tue Dec 23 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Tue, 23 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: [SPARC] Fix OverflowBranch used in truffle Message-ID: <201412230200.sBN207Ie010765@aojmv0008> Changeset: fadb4e5d0f03 Author: Stefan Anzinger Date: 2014-12-22 18:34 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/fadb4e5d0f03 [SPARC] Fix OverflowBranch used in truffle ! graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java From thomas.wuerthinger at oracle.com Tue Dec 23 08:38:47 2014 From: thomas.wuerthinger at oracle.com (Thomas Wuerthinger) Date: Tue, 23 Dec 2014 09:38:47 +0100 Subject: intermediate representation In-Reply-To: <5498596A.9090902@supsi.ch> References: <5498596A.9090902@supsi.ch> Message-ID: <8BEB3057-0C79-4F80-B5DD-FC19687D0A7A@oracle.com> Raffaello, Regarding your question about state of the art, you might also want to look at this paper from 2013: http://lafo.ssw.uni-linz.ac.at/papers/2013_Onward_OneVMToRuleThemAll.pdf . I do not think that it is the future dynamic languages toolkit Attila speaks about, but it might be related work. It is a dynamic languages toolkit with several open source projects building implementations on top of it: - Ruby: https://github.com/jruby/jruby/wiki/Truffle - R: https://bitbucket.org/allr/fastr - Python: https://bitbucket.org/ssllab/zippy - Smalltalk: https://github.com/smarr/TruffleSOM Cheers, thomas > On 22 Dec 2014, at 18:48, Raffaello Giulietti wrote: > > Hi, > > in some of the published presentations about Nashorn, Attila (on behalf of the Nashourn team, I guess) speaks about his vision for a dynamic languages toolkit to be used by language implementers targeting the JVM. One of its main components is a new IR resembling untyped JVM bytecode. > > I would be interested in hearing something more specific about this topic. > > What is the current state-of-the-art? > What can be expected in the next few months? > Is there a discussion group somewhere? > > Greetings > Raffaello From thomas.wuerthinger at oracle.com Tue Dec 23 14:07:12 2014 From: thomas.wuerthinger at oracle.com (Thomas Wuerthinger) Date: Tue, 23 Dec 2014 15:07:12 +0100 Subject: intermediate representation In-Reply-To: References: <5498596A.9090902@supsi.ch> <8BEB3057-0C79-4F80-B5DD-FC19687D0A7A@oracle.com> <5499469F.7030603@supsi.ch> Message-ID: Thanks for your comments, Raffaello. I understood your question to be more about the state-of-the-art from a technical perspective. Btw, there is in addition to the mentioned large-scale Ruby, R, and Python efforts also a 100% ECMAScript compatible JavaScript implementation using the open source Truffle dynamic language framework based on the Graal OpenJDK project available. Check out the OTN (Oracle Technology Network) technology preview download at http://www.oracle.com/technetwork/oracle-labs/program-languages/overview/index.html . Please feel invited to test our implementation on workloads you care about! Early feedback will help us improve the artefact. Cheers, thomas > On 23 Dec 2014, at 12:23, Marcus Lagergren wrote: > > Raffaello, > > Thanks for your interest! > > Nashorn indeed, like you say, has to run well on existing JVMs, so significant development time is spent on this. It also already has several customers and is productized as part of the JDK. This means that it follows the rest of the JDK release cycle with zero bug bounce days, ramp downs, testing criteria and so on. This, sadly, makes us a little less flexible than Truffle, but that is what we need to do in order to ship with the JDK as a supported product. > > We have spent the autumn implementing a TypeScript implementation on top of Nashorn and also using Ruby and Python as example languages to understand what the IR will require. We have a very good understanding of where we are going. It feels like most of the ?thinking? is complete. > > We have incorporated new IR ideas with earlier IR drafts that existed solely to make code generation in Nashorn for JavaScript only much simpler - a lot of transforms don?t do so well on an AST. > > We have also looked at the IR in JRuby 9000 to find as much common future direction as we can for a multi language dynamic language IR. > > As soon as the thesis is available for publication, I will post a link on this list. > > The serious _implementation_ IR work for 9 will start in January, with Attila tech leading. I think we should try to keep it as open as possible on this list, so you can contribute from the beginning. > I also suggest we try to do this in the new sandbox forest, so you can be with us from the start, Raffaello. > (I am going to move my drastic warmup improvement branch there as soon as it becomes test compliant, and other 9 projects, such as ec6 support would probably do well there too.) > > http://www.javaworld.com/article/2689365/java-platform/openjdk-project-opens-up-java-9-to-collaboration-experimentation.html > > /M > >> On 23 Dec 2014, at 11:40, Raffaello Giulietti wrote: >> >> Hi Thomas, >> >> I'm familiar with the beautiful and elegant Truffle/Graal framework, the related papers and presentations, and the ongoing work on the languages you mention. >> >> What is attractive about the Nashorn team's approach, however, is that the 100% compliant ECMAScript implementation works today on a pristine JVMs, has official support (which is an immensely important selling point in commercial environments) and has impressive performance. If you add that the Nashorn people would like to put their experience and work further by offering a complete toolkit for dynamic language implementors, well, the choice whether to implement a language on Truffle/Graal or on a Nashorn-like framework becomes a hard task. >> >> Both approaches are interesting enough to be tried out. >> >> On the one hand, I feel that Truffle/Graal is more productive today, partly because of its intuitive DSL, partly because of its AST interpreter approach. Unfortunately, as far as I know, it still doesn't have the official support that would convince commercial customers. Hence, although the chances are in its favor (it's too interesting to be ignored), it's still unclear to me if Truffle/Graal will become a mainstream product or if it will be confined in labs and be used by aficionados only. (Too many interesting projects have followed this sad fate.) >> >> On the other hand, Nashorn is fully supported as a product but the framework is probably not mature enough to be usable as a toolkit for other languages. But since it has already won the battle against (often stubborn and shortsighted) product managers, it has perhaps more concrete chances for further development and further ideas. >> >> Hard choice! >> >> Cheers >> Raffaello >> >> >> >> On 2014-12-23 09:38, Thomas Wuerthinger wrote: >>> Raffaello, >>> >>> Regarding your question about state of the art, you might also want to look at this paper from 2013: http://lafo.ssw.uni-linz.ac.at/papers/2013_Onward_OneVMToRuleThemAll.pdf. I do not think that it is the future dynamic languages toolkit Attila speaks about, but it might be related work. It is a dynamic languages toolkit with several open source projects building implementations on top of it: >>> - Ruby: https://github.com/jruby/jruby/wiki/Truffle >>> - R: https://bitbucket.org/allr/fastr >>> - Python: https://bitbucket.org/ssllab/zippy >>> - Smalltalk: https://github.com/smarr/TruffleSOM >>> >>> Cheers, thomas >>> >>> >>>> On 22 Dec 2014, at 18:48, Raffaello Giulietti > wrote: >>>> >>>> Hi, >>>> >>>> in some of the published presentations about Nashorn, Attila (on behalf of the Nashourn team, I guess) speaks about his vision for a dynamic languages toolkit to be used by language implementers targeting the JVM. One of its main components is a new IR resembling untyped JVM bytecode. >>>> >>>> I would be interested in hearing something more specific about this topic. >>>> >>>> What is the current state-of-the-art? >>>> What can be expected in the next few months? >>>> Is there a discussion group somewhere? >>>> >>>> Greetings >>>> Raffaello >>> >> > From doug.simon at oracle.com Wed Dec 24 02:00:07 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Wed, 24 Dec 2014 02:00:07 +0000 Subject: hg: graal/graal: 3 new changesets Message-ID: <201412240200.sBO207sb009641@aojmv0008> Changeset: 5294b624e2f0 Author: Matthias Grimmer Date: 2014-12-23 11:56 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/5294b624e2f0 Interop: add interface + graal/com.oracle.truffle.api.interop/src/com/oracle/truffle/api/interop/ForeignAccessFactory.java + graal/com.oracle.truffle.api.interop/src/com/oracle/truffle/api/interop/InteropPredicate.java + graal/com.oracle.truffle.api.interop/src/com/oracle/truffle/api/interop/TruffleObject.java + graal/com.oracle.truffle.api.interop/src/com/oracle/truffle/api/interop/exception/AccessException.java + graal/com.oracle.truffle.api.interop/src/com/oracle/truffle/api/interop/exception/TypeException.java + graal/com.oracle.truffle.api.interop/src/com/oracle/truffle/api/interop/messages/Message.java ! mx/suite.py Changeset: 6db7923af642 Author: Matthias Grimmer Date: 2014-12-23 12:13 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6db7923af642 OM: DynamicObject extends TruffleObject, add default implementation ! graal/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/DynamicObject.java ! graal/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/ObjectType.java ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java ! graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java Changeset: 3d6e630a72f1 Author: Matthias Grimmer Date: 2014-12-17 11:24 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3d6e630a72f1 Fix GNFI class loader problem ! src/share/vm/graal/graalRuntime.cpp From christian.thalinger at oracle.com Mon Dec 29 23:58:14 2014 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Mon, 29 Dec 2014 15:58:14 -0800 Subject: RFR: remove ASM dependency Message-ID: <76BA493A-D705-4B40-A2FC-7F09EA0586DF@oracle.com> This patch replaces the only use of org.objectweb.asm with jdk.internal.org.objectweb.asm and removes the ASM dependency. From doug.simon at oracle.com Tue Dec 30 02:00:08 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Tue, 30 Dec 2014 02:00:08 +0000 Subject: hg: graal/graal: 19 new changesets Message-ID: <201412300200.sBU208E0021612@aojmv0008> Changeset: 6fa518bf5d1b Author: Christian Humer Date: 2014-12-29 23:37 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6fa518bf5d1b SL: add boundaries for BigInteger add and String add. ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLAddNode.java Changeset: 8a758dce7d80 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/8a758dce7d80 Truffle: added new deepCopy method to Node. ! CHANGELOG.md ! graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java ! graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Changeset: e55e18c1f40d Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/e55e18c1f40d Truffle: add putObject to node reflection. ! graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Changeset: 1acaa69ff61b Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/1acaa69ff61b Truffle-DSL: refactor generator classes ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/AbstractClassElementFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/AbstractCodeElementFactory.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeFactoryFactory.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/PolymorphicNodeFactory.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/SpecializedNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java Changeset: f6b8787dc113 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/f6b8787dc113 Truffle-DSL: replace complex factory system with a much simpler version ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/AnnotationProcessor.java - graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/AbstractClassElementFactory.java - graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/AbstractCodeElementFactory.java - graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/AbstractCompilationUnitFactory.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/CodeTypeElementFactory.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/GeneratorUtils.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeFactoryFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/PolymorphicNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/SpecializedNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTypeElement.java Changeset: 59bf50cc5a32 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/59bf50cc5a32 Truffle-DSL: implemented @GenerateNodeFactory to enable generation of factories. Factory generation is now disabled by default. + graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/GenerateNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/TruffleTypes.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeFactoryFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/PolymorphicNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/SpecializedNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/NodeData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Changeset: 59953a46c56f Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/59953a46c56f Truffle-DSL: migrate DSL tests to use @GenerateNodeFactory. ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ArrayTest.java ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TypeSystemTest.java Changeset: c22714b214d0 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c22714b214d0 Truffle-DSL: fixed auto import if imported class is declared in super class but is also a super class. ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/transform/OrganizedImports.java Changeset: 0ec5f5a2e720 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/0ec5f5a2e720 Truffle-DSL: disable automatic static imports. ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/transform/OrganizedImports.java Changeset: 3912400fc33a Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/3912400fc33a Truffle-DSL: remove type system singleton ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImplicitCastTest.java ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TypeSystemTest.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/SpecializedNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTreeBuilder.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/ImplicitCastParser.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeCastParser.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeCheckParser.java Changeset: 86cd6bc305fc Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/86cd6bc305fc Truffle-DSL: remove outdated test package-info. - graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/package-info.java Changeset: 6fa3999631d8 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/6fa3999631d8 Truffle-DSL: added test for null + graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/NullTest.java Changeset: a665483c3881 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a665483c3881 Truffle-DSL: new node layout implementation. ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ContainsTest.java ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ExecuteEvaluatedTest.java ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/LazyClassLoadingTest.java ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/PolymorphicTest2.java ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SourceSectionTest.java ! graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SpecializationGroupingTest.java + graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TestSerialization.java ! graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/GeneratedBy.java + graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/DSLOptions.java + graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/RewriteEvent.java + graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java + graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializedNode.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/ProcessorContext.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/TruffleProcessor.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/GeneratorUtils.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/ImplicitCastNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeFactoryFactory.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeGenFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/PolymorphicNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/SpecializedNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java + graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeElement.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeElementScanner.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeExecutableElement.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTree.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTreeBuilder.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/transform/AbstractCodeWriter.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/ExecutableTypeData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/NodeData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/ShortCircuitData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/Template.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TemplateMethod.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/ExecutableTypeMethodParser.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/GenericParser.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/ImplicitCastParser.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeMethodParser.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/SpecializationGroup.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeSystemParser.java Changeset: 0ef23ff7d5a1 Author: Christian Humer Date: 2014-12-29 23:38 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/0ef23ff7d5a1 SL: make lookup of NodeInfo annotation more rebust. ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java Changeset: 301fea50e42e Author: Christian Humer Date: 2014-12-29 23:39 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/301fea50e42e SL: migrate SL to use @GenerateNodeFactory. ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLBuiltinNode.java ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLAddNode.java ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLNodeFactory.java Changeset: ccb97347d874 Author: Christian Humer Date: 2014-12-29 23:39 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/ccb97347d874 SL: adapt SL to type system singleton removal. ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLExpressionNode.java ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLTypes.java ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/access/SLReadPropertyCacheNode.java ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/instrument/SLExpressionWrapperNode.java Changeset: 924bf48a5d6a Author: Christian Humer Date: 2014-12-29 23:39 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/924bf48a5d6a SL: enable new DSL layout for SimpleLanguage. ! graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLTypes.java Changeset: a720bf2e2f43 Author: Christian Humer Date: 2014-12-30 00:37 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/a720bf2e2f43 Truffle-DSL: checkstyle fixes. ! graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/DSLOptions.java ! graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/DSLShare.java ! graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeFactoryFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeGenFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/PolymorphicNodeFactory.java ! graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/SpecializedNodeFactory.java Changeset: 7ff41ad072ef Author: Christian Humer Date: 2014-12-30 02:21 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/7ff41ad072ef SL: fix NodeInfo lookup for SLGraalRuntimeBuiltins. ! graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/builtins/SLGraalRuntimeBuiltin.java From christian.humer at gmail.com Tue Dec 30 02:14:36 2014 From: christian.humer at gmail.com (Christian Humer) Date: Tue, 30 Dec 2014 03:14:36 +0100 Subject: Truffle DSL incompatible changes Message-ID: Hi folks, I just pushed some breaking changes to latest version of Truffle-DSL. This will make some guest language adaptations necessary. 1) Previously with every DSL node there was an NodeFactory implementation generated. This is now disabled by default. To create a new node instance use the new {NodeName}Gen#create instead of the old {NodeName}Factory#create. In case you need a NodeFactory implementation annotate your Node with the new @GenerateNodeFactory annotation. I would recommend guest language developers to use @GenerateNodeFactory only if really required (for example for builtin nodes) to save some bits. 2) All methods enclosed in a @TypeSystem must now be static. This is enforced by the DSL. 3) The singleton used in the generated type system classes is now deprecated and is going to be removed soon. To migrate your code change patters like: SLTypesGen.SLTYPES.expectInteger(value) to SLTypesGen.expectInteger(value) Please let me know in case you experience any problems. - Christian Humer From christian.thalinger at oracle.com Tue Dec 30 03:24:08 2014 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Mon, 29 Dec 2014 19:24:08 -0800 Subject: RFR: remove ASM dependency In-Reply-To: <76BA493A-D705-4B40-A2FC-7F09EA0586DF@oracle.com> References: <76BA493A-D705-4B40-A2FC-7F09EA0586DF@oracle.com> Message-ID: <0F681270-4324-4363-9FDD-ACB618A88CAE@oracle.com> > On Dec 29, 2014, at 3:58 PM, Christian Thalinger wrote: > > This patch replaces the only use of org.objectweb.asm with jdk.internal.org.objectweb.asm and removes the ASM dependency. > Seems patches are not enabled on this list. Here is the patch inlined: diff -r 7ff41ad072ef graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java Tue Dec 30 02:21:15 2014 +0100 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java Mon Dec 29 19:23:25 2014 -0800 @@ -23,7 +23,7 @@ package com.oracle.graal.jtt.except; import org.junit.*; -import org.objectweb.asm.*; +import jdk.internal.org.objectweb.asm.*; import com.oracle.graal.jtt.*; @@ -45,20 +45,20 @@ public class UntrustedInterfaces extends * public void setField() { * field = new TestConstant(); * } - * + * * public void setStaticField() { * staticField = new TestConstant(); * } - * + * * public int callMe(CallBack callback) { * return callback.callBack(new TestConstant()); * } - * + * * public TestInterface get() { * return new TestConstant(); * } * } - * + * * private static final class TestConstant implements TestInterface { * public int method() { * return 42; diff -r 7ff41ad072ef mx/suite.py --- a/mx/suite.py Tue Dec 30 02:21:15 2014 +0100 +++ b/mx/suite.py Mon Dec 29 19:23:25 2014 -0800 @@ -139,21 +139,6 @@ suite = { ], }, - "ASM" : { - "path" : "lib/asm-5.0.3.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3.jar", - "https://search.maven.org/remotecontent?filepath=org/ow2/asm/asm/5.0.3/asm-5.0.3.jar", - ], - "sha1" : "dcc2193db20e19e1feca8b1240dbbc4e190824fa", - "sourcePath" : "lib/asm-5.0.3-sources.jar", - "sourceSha1" : "f0f24f6666c1a15c7e202e91610476bd4ce59368", - "sourceUrls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3-sources.jar", - "https://search.maven.org/remotecontent?filepath=org/ow2/asm/asm/5.0.3/asm-5.0.3-sources.jar", - ], - }, - "JAVA_ALLOCATION_INSTRUMENTER" : { "path" : "lib/java-allocation-instrumenter.jar", "sourcePath" : "lib/java-allocation-instrumenter.jar", @@ -947,7 +932,6 @@ suite = { "sourceDirs" : ["src"], "dependencies" : [ "com.oracle.graal.compiler.test", - "ASM", ], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", From bernhard.urban at jku.at Tue Dec 30 09:41:38 2014 From: bernhard.urban at jku.at (Bernhard Urban) Date: Tue, 30 Dec 2014 10:41:38 +0100 Subject: RFR: remove ASM dependency In-Reply-To: <0F681270-4324-4363-9FDD-ACB618A88CAE@oracle.com> References: <76BA493A-D705-4B40-A2FC-7F09EA0586DF@oracle.com> <0F681270-4324-4363-9FDD-ACB618A88CAE@oracle.com> Message-ID: what is the version in the JDK? is it likely to be changed? -Bernhard On Dec 30, 2014 4:30 AM, "Christian Thalinger" < christian.thalinger at oracle.com> wrote: > > > On Dec 29, 2014, at 3:58 PM, Christian Thalinger < > christian.thalinger at oracle.com> wrote: > > > > This patch replaces the only use of org.objectweb.asm with > jdk.internal.org.objectweb.asm and removes the ASM dependency. > > > > Seems patches are not enabled on this list. Here is the patch inlined: > > diff -r 7ff41ad072ef > graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java > --- > a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java > Tue Dec 30 02:21:15 2014 +0100 > +++ > b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java > Mon Dec 29 19:23:25 2014 -0800 > @@ -23,7 +23,7 @@ > package com.oracle.graal.jtt.except; > > import org.junit.*; > -import org.objectweb.asm.*; > +import jdk.internal.org.objectweb.asm.*; > > import com.oracle.graal.jtt.*; > > @@ -45,20 +45,20 @@ public class UntrustedInterfaces extends > * public void setField() { > * field = new TestConstant(); > * } > - * > + * > * public void setStaticField() { > * staticField = new TestConstant(); > * } > - * > + * > * public int callMe(CallBack callback) { > * return callback.callBack(new TestConstant()); > * } > - * > + * > * public TestInterface get() { > * return new TestConstant(); > * } > * } > - * > + * > * private static final class TestConstant implements TestInterface { > * public int method() { > * return 42; > diff -r 7ff41ad072ef mx/suite.py > --- a/mx/suite.py Tue Dec 30 02:21:15 2014 +0100 > +++ b/mx/suite.py Mon Dec 29 19:23:25 2014 -0800 > @@ -139,21 +139,6 @@ suite = { > ], > }, > > - "ASM" : { > - "path" : "lib/asm-5.0.3.jar", > - "urls" : [ > - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3.jar > ", > - " > https://search.maven.org/remotecontent?filepath=org/ow2/asm/asm/5.0.3/asm-5.0.3.jar > ", > - ], > - "sha1" : "dcc2193db20e19e1feca8b1240dbbc4e190824fa", > - "sourcePath" : "lib/asm-5.0.3-sources.jar", > - "sourceSha1" : "f0f24f6666c1a15c7e202e91610476bd4ce59368", > - "sourceUrls" : [ > - " > http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3-sources.jar", > - " > https://search.maven.org/remotecontent?filepath=org/ow2/asm/asm/5.0.3/asm-5.0.3-sources.jar > ", > - ], > - }, > - > "JAVA_ALLOCATION_INSTRUMENTER" : { > "path" : "lib/java-allocation-instrumenter.jar", > "sourcePath" : "lib/java-allocation-instrumenter.jar", > @@ -947,7 +932,6 @@ suite = { > "sourceDirs" : ["src"], > "dependencies" : [ > "com.oracle.graal.compiler.test", > - "ASM", > ], > "checkstyle" : "com.oracle.graal.graph", > "javaCompliance" : "1.8", > > From forax at univ-mlv.fr Tue Dec 30 11:45:02 2014 From: forax at univ-mlv.fr (Remi Forax) Date: Tue, 30 Dec 2014 12:45:02 +0100 Subject: RFR: remove ASM dependency In-Reply-To: References: <76BA493A-D705-4B40-A2FC-7F09EA0586DF@oracle.com> <0F681270-4324-4363-9FDD-ACB618A88CAE@oracle.com> Message-ID: <54A2903E.3070206@univ-mlv.fr> On 12/30/2014 10:41 AM, Bernhard Urban wrote: > what is the version in the JDK? is it likely to be changed? > > -Bernhard Hi Bernhard, Using my ASM developer hat, since ASM4, ASM is backward compatible and usually the ASM version integrated in the JDK is directly pulled from the trunk so the version of the JDK is likely to be more recent than the last published version on maven central. cheers, R?mi > On Dec 30, 2014 4:30 AM, "Christian Thalinger" < > christian.thalinger at oracle.com> wrote: > >>> On Dec 29, 2014, at 3:58 PM, Christian Thalinger < >> christian.thalinger at oracle.com> wrote: >>> This patch replaces the only use of org.objectweb.asm with >> jdk.internal.org.objectweb.asm and removes the ASM dependency. >> Seems patches are not enabled on this list. Here is the patch inlined: >> >> diff -r 7ff41ad072ef >> graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java >> --- >> a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java >> Tue Dec 30 02:21:15 2014 +0100 >> +++ >> b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/UntrustedInterfaces.java >> Mon Dec 29 19:23:25 2014 -0800 >> @@ -23,7 +23,7 @@ >> package com.oracle.graal.jtt.except; >> >> import org.junit.*; >> -import org.objectweb.asm.*; >> +import jdk.internal.org.objectweb.asm.*; >> >> import com.oracle.graal.jtt.*; >> >> @@ -45,20 +45,20 @@ public class UntrustedInterfaces extends >> * public void setField() { >> * field = new TestConstant(); >> * } >> - * >> + * >> * public void setStaticField() { >> * staticField = new TestConstant(); >> * } >> - * >> + * >> * public int callMe(CallBack callback) { >> * return callback.callBack(new TestConstant()); >> * } >> - * >> + * >> * public TestInterface get() { >> * return new TestConstant(); >> * } >> * } >> - * >> + * >> * private static final class TestConstant implements TestInterface { >> * public int method() { >> * return 42; >> diff -r 7ff41ad072ef mx/suite.py >> --- a/mx/suite.py Tue Dec 30 02:21:15 2014 +0100 >> +++ b/mx/suite.py Mon Dec 29 19:23:25 2014 -0800 >> @@ -139,21 +139,6 @@ suite = { >> ], >> }, >> >> - "ASM" : { >> - "path" : "lib/asm-5.0.3.jar", >> - "urls" : [ >> - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3.jar >> ", >> - " >> https://search.maven.org/remotecontent?filepath=org/ow2/asm/asm/5.0.3/asm-5.0.3.jar >> ", >> - ], >> - "sha1" : "dcc2193db20e19e1feca8b1240dbbc4e190824fa", >> - "sourcePath" : "lib/asm-5.0.3-sources.jar", >> - "sourceSha1" : "f0f24f6666c1a15c7e202e91610476bd4ce59368", >> - "sourceUrls" : [ >> - " >> http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3-sources.jar", >> - " >> https://search.maven.org/remotecontent?filepath=org/ow2/asm/asm/5.0.3/asm-5.0.3-sources.jar >> ", >> - ], >> - }, >> - >> "JAVA_ALLOCATION_INSTRUMENTER" : { >> "path" : "lib/java-allocation-instrumenter.jar", >> "sourcePath" : "lib/java-allocation-instrumenter.jar", >> @@ -947,7 +932,6 @@ suite = { >> "sourceDirs" : ["src"], >> "dependencies" : [ >> "com.oracle.graal.compiler.test", >> - "ASM", >> ], >> "checkstyle" : "com.oracle.graal.graph", >> "javaCompliance" : "1.8", >> >> From doug.simon at oracle.com Wed Dec 31 02:00:06 2014 From: doug.simon at oracle.com (doug.simon at oracle.com) Date: Wed, 31 Dec 2014 02:00:06 +0000 Subject: hg: graal/graal: Split negated short-circuit-or guard into two guards Message-ID: <201412310200.sBV2060g027972@aojmv0008> Changeset: c16786645355 Author: Andreas Woess Date: 2014-12-30 14:52 +0100 URL: http://hg.openjdk.java.net/graal/graal/rev/c16786645355 Split negated short-circuit-or guard into two guards ! graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java