From: <ta...@us...> - 2010-02-08 17:09:13
|
Revision: 12826 http://x10.svn.sourceforge.net/x10/?rev=12826&view=rev Author: tardieu Date: 2010-02-08 17:08:57 +0000 (Mon, 08 Feb 2010) Log Message: ----------- added experimental annotation to request an object to be stack allocated (actual stack allocation is not implemented yet) Modified Paths: -------------- trunk/x10.compiler/src/x10cpp/visit/MessagePassingCodeGenerator.java Added Paths: ----------- trunk/x10.runtime/src-x10/x10/compiler/StackAllocate.x10 Modified: trunk/x10.compiler/src/x10cpp/visit/MessagePassingCodeGenerator.java =================================================================== --- trunk/x10.compiler/src/x10cpp/visit/MessagePassingCodeGenerator.java 2010-02-08 16:28:01 UTC (rev 12825) +++ trunk/x10.compiler/src/x10cpp/visit/MessagePassingCodeGenerator.java 2010-02-08 17:08:57 UTC (rev 12826) @@ -3206,6 +3206,14 @@ X10TypeSystem xts = (X10TypeSystem)context.typeSystem(); ConstructorInstance constructor = n.constructorInstance(); + // TODO: implement @StackAllocate + try { + Type annotation = (Type) xts.systemResolver().find(QName.make("x10.compiler.StackAllocate")); + if (!((X10Ext) n.ext()).annotationMatching(annotation).isEmpty()) { + System.err.println("@StackAllocate " + n); + } + } catch (SemanticException e) {} + if (n.qualifier() != null) throw new InternalCompilerError("Qualified new not supported"); if (n.body() != null) Added: trunk/x10.runtime/src-x10/x10/compiler/StackAllocate.x10 =================================================================== --- trunk/x10.runtime/src-x10/x10/compiler/StackAllocate.x10 (rev 0) +++ trunk/x10.runtime/src-x10/x10/compiler/StackAllocate.x10 2010-02-08 17:08:57 UTC (rev 12826) @@ -0,0 +1,17 @@ +/* + * + * (C) Copyright IBM Corporation 2006-2008. + * + * This file is part of X10 Language. + * + */ + +package x10.compiler; + +import x10.lang.annotations.ExpressionAnnotation; + +/** An annotation on "new" that requests the compiler to stack allocate the object + * EXPERIMENTAL + * @author Olivier Tardieu + */ +public interface StackAllocate extends ExpressionAnnotation { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |