[Swift-commit] Cog update
David Kelly
davidk at ci.uchicago.edu
Thu May 3 11:24:15 CDT 2012
Thank you buggy svn script for sending cog updates from months ago. Very useful. Not. Who would write such a bugg.. oh, wait, nevermind.
----- Original Message -----
> From: swift at ci.uchicago.edu
> To: swift-commit at ci.uchicago.edu
> Sent: Thursday, May 3, 2012 11:22:20 AM
> Subject: [Swift-commit] Cog update
> ------------------------------------------------------------------------
> r3400 | hategan | 2012-04-30 22:51:26 -0500 (Mon, 30 Apr 2012) | 1
> line
>
> slightly faster and cleaner variable frame cachin code
> ------------------------------------------------------------------------
> Index:
> modules/karajan/src/org/globus/cog/karajan/workflow/nodes/functions/Variable.java
> ===================================================================
> ---
> modules/karajan/src/org/globus/cog/karajan/workflow/nodes/functions/Variable.java
> (revision 3399)
> +++
> modules/karajan/src/org/globus/cog/karajan/workflow/nodes/functions/Variable.java
> (working copy)
> @@ -40,44 +40,35 @@
>
> public Object function(VariableStack stack) throws ExecutionException
> {
> synchronized (this) {
> - if (name == null) {
> - name = TypeUtil.toString(A_NAME.getStatic(this)).toLowerCase();
> - if (getStaticArguments().size() == 1) {
> - java.util.Map<String, Object> m = Collections.emptyMap();
> - setStaticArguments(m);
> + if (frame == UNINITIALIZED || frame == VariableStack.NO_FRAME) {
> + if (name == null) {
> + name = TypeUtil.toString(A_NAME.getStatic(this)).toLowerCase();
> + if (getStaticArguments().size() == 1) {
> + java.util.Map<String, Object> m = Collections.emptyMap();
> + setStaticArguments(m);
> + }
> }
> - }
> - }
> -
> - switch (frame) {
> - case UNINITIALIZED:
> - case VariableStack.NO_FRAME:
> +
> if (stack.parentFrame().isDefined("#quoted")) {
> Object value = new Identifier(name);
> setSimple(value);
> return value;
> }
> - else {
> - frame = stack.getVarFrameFromTop(name);
> - switch (frame) {
> - case VariableStack.NO_FRAME:
> - throw new VariableNotFoundException(name);
> - case VariableStack.FIRST_FRAME:
> - Object value = stack.firstFrame().getVar(name);
> - setSimple(value);
> - return value;
> - case VariableStack.DYNAMIC_FRAME:
> - return stack.getVar(name);
> - default:
> - return stack.getFrameFromTop(frame).getVar(name);
> - }
> - }
> + frame = stack.getVarFrameFromTop(name);
> + }
> + }
> +
> + switch (frame) {
> + case VariableStack.NO_FRAME:
> + throw new VariableNotFoundException(name);
> case VariableStack.FIRST_FRAME:
> - return stack.firstFrame().getVar(name);
> + Object value = stack.firstFrame().getVar(name);
> + setSimple(value);
> + return value;
> case VariableStack.DYNAMIC_FRAME:
> - return stack.getVar(name);
> + return stack.getVar(name);
> default:
> - return stack.getFrameFromTop(frame).getVar(name);
> + return stack.getFrameFromTop(frame).getVar(name);
> }
> }
> }
> Index:
> modules/karajan/src/org/globus/cog/karajan/util/ElementProperty.java
> ===================================================================
> ---
> modules/karajan/src/org/globus/cog/karajan/util/ElementProperty.java
> (revision 3399)
> +++
> modules/karajan/src/org/globus/cog/karajan/util/ElementProperty.java
> (working copy)
> @@ -130,24 +130,17 @@
> this.name = ident.getName();
> }
>
> - public synchronized Object getValue(VariableStack stack) throws
> VariableNotFoundException {
> + public Object getValue(VariableStack stack) throws
> VariableNotFoundException {
> + synchronized(this) {
> + if (frame == UNINITIALIZED || frame == VariableStack.NO_FRAME) {
> + frame = stack.getVarFrameFromTop(name);
> + }
> + }
> switch (frame) {
> - case UNINITIALIZED:
> case VariableStack.NO_FRAME:
> - frame = stack.getVarFrameFromTop(name);
> - switch (frame) {
> - case VariableStack.NO_FRAME:
> - throw new VariableNotFoundException(name);
> - case VariableStack.FIRST_FRAME:
> - value = stack.firstFrame().getVar(name);
> - return value;
> - case VariableStack.DYNAMIC_FRAME:
> - return stack.getVar(name);
> - default:
> - return stack.getFrameFromTop(frame).getVar(name);
> - }
> + throw new VariableNotFoundException(name);
> case VariableStack.FIRST_FRAME:
> - return value;
> + return stack.firstFrame().getVar(name);
> case VariableStack.DYNAMIC_FRAME:
> return stack.getVar(name);
> default:
> _______________________________________________
> Swift-commit mailing list
> Swift-commit at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-commit
More information about the Swift-commit
mailing list