From: <jsa...@us...> - 2008-10-21 20:23:38
|
Revision: 27 http://flexotask.svn.sourceforge.net/flexotask/?rev=27&view=rev Author: jsauerbach Date: 2008-10-21 20:23:28 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Remove remaining special case accesses to the flexotask.system package, replacing with alternative mechanisms and stop exporting that package. Modified Paths: -------------- trunk/flexotask/META-INF/MANIFEST.MF trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/builder/FlexotaskBuilder.java trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/CodeRewriter.java trunk/flexotask-tuningfork/src/com/ibm/realtime/flexotask/tuningfork/TFTracerFactory.java Added Paths: ----------- trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/vm/ trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskVMBridge.java Removed Paths: ------------- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java Modified: trunk/flexotask/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask/META-INF/MANIFEST.MF 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/META-INF/MANIFEST.MF 2008-10-21 20:23:28 UTC (rev 27) @@ -10,7 +10,6 @@ com.ibm.realtime.flexotask.distribution, com.ibm.realtime.flexotask.scheduling, com.ibm.realtime.flexotask.scheduling.simple, - com.ibm.realtime.flexotask.system, com.ibm.realtime.flexotask.template, com.ibm.realtime.flexotask.timing, com.ibm.realtime.flexotask.timing.simple, @@ -18,5 +17,6 @@ com.ibm.realtime.flexotask.tracing, com.ibm.realtime.flexotask.util, com.ibm.realtime.flexotask.validation, + com.ibm.realtime.flexotask.vm, com.ibm.realtime.xrts Require-Bundle: com.ibm.realtime.analysis Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java 2008-10-21 20:23:28 UTC (rev 27) @@ -32,7 +32,7 @@ FlexotaskControllerImpl outputTask, FlexotaskConnectionMode mode, FlexotaskTracer tracer) { super(input, inputTask, output, outputTask, mode, tracer); - lockObject = (AtomicFlexotask) outputTask.root.task; + lockObject = (AtomicFlexotask) outputTask.root.getTask(); } /* (non-Javadoc) Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java 2008-10-21 20:23:28 UTC (rev 27) @@ -14,6 +14,7 @@ package com.ibm.realtime.flexotask.system; import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; /** * A specialization of the normal FlexotaskController for use with transactional @@ -33,7 +34,7 @@ */ public boolean collect() { - AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.task; + AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.getTask(); boolean ans = false; synchronized (ttask.lock) { ttask.schedulerEntry(); @@ -50,7 +51,7 @@ */ public void run() { - AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.task; + AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.getTask(); synchronized (ttask.lock) { ttask.schedulerEntry(); super.run(); Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,31 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.flexotask.AtomicFlexotask; - -/** - * Interface that must be implemented by all objects that will function as public interfaces to - * AtomicFlexotasks. The actual guard object remains on the external heap (pinned) and points to the - * AtomicFlexotask delegate. - */ -public interface AtomicFlexotaskGuard -{ - /** - * Method to store the AtomicFlexotask "delegate" for which this guard object is a guard. The - * delegate pointer must not be leaked. This is checked (conservatively) during validation. - * @param delegate the delegate or null (during termination) - */ - public void setDelegate(AtomicFlexotask delegate); -} Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java 2008-10-21 20:23:28 UTC (rev 27) @@ -40,6 +40,7 @@ import com.ibm.realtime.flexotask.validation.TypeRuleViolationException; import com.ibm.realtime.flexotask.validation.ValidationContext; import com.ibm.realtime.flexotask.validation.TypeRuleViolation.Severity; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; /** * This class validates the code of the flexotasks of a graph. The current version is quite imprecise, Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,6 +13,8 @@ */ package com.ibm.realtime.flexotask.system; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; import com.ibm.realtime.flexotask.scheduling.ConnectionDriver; import com.ibm.realtime.flexotask.template.FlexotaskConnectionMode; import com.ibm.realtime.flexotask.tracing.FlexotaskTracer; @@ -167,14 +169,16 @@ { int inIndex = -1; int outIndex = -1; - for (int i = 0; i < inputTask.root.outputPorts.length; i++) { - if (inputTask.root.outputPorts[i] == input) { + FlexotaskOutputPort[] outputPorts = inputTask.root.getOutputPorts(); + for (int i = 0; i < outputPorts.length; i++) { + if (outputPorts[i] == input) { inIndex = i; break; } } - for (int i = 0; i < outputTask.root.inputPorts.length; i++) { - if (outputTask.root.inputPorts[i] == output) { + FlexotaskInputPort[] inputPorts = inputTask.root.getInputPorts(); + for (int i = 0; i < inputPorts.length; i++) { + if (inputPorts[i] == output) { outIndex = i; break; } Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -15,6 +15,7 @@ import com.ibm.realtime.flexotask.scheduling.FlexotaskController; import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; class FlexotaskControllerImpl implements FlexotaskController { /** The flexotask root for this flexotask */ @@ -73,7 +74,7 @@ if (oldSpace == 0L) { throw new IllegalStateException(taskName); } - root.task.execute(); + root.getTask().execute(); FlexotaskSystemSupport.resetTransient(); } finally { if (oldSpace != 0L) { Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -20,6 +20,7 @@ import com.ibm.realtime.flexotask.FlexotaskGraph; import com.ibm.realtime.flexotask.FlexotaskRunner; import com.ibm.realtime.flexotask.distribution.FlexotaskDistributer; +import com.ibm.realtime.flexotask.validation.AtomicFlexotaskGuard; /** * Contains the system's implementation of the FlexotaskGraph interface Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -16,6 +16,7 @@ import com.ibm.realtime.flexotask.FlexotaskPredicate; import com.ibm.realtime.flexotask.scheduling.FlexotaskPredicateController; import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; /** * Implementation of FlexotaskPredicateController @@ -34,6 +35,6 @@ */ public boolean isTrue() { - return ((FlexotaskPredicate) root.task).isTrue(); + return ((FlexotaskPredicate) root.getTask()).isTrue(); } } Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,39 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.flexotask.Flexotask; -import com.ibm.realtime.flexotask.FlexotaskInputPort; -import com.ibm.realtime.flexotask.FlexotaskOutputPort; - -/** - * The root memory object in every flexotask: keeps the task and ports live and makes them accessible - * to the FlexotaskController objects used by the scheduler. - */ -public final class FlexotaskRoot -{ - /** The input ports of 'task'. */ - FlexotaskInputPort[] inputPorts; - - /** The output ports of 'task'. */ - FlexotaskOutputPort[] outputPorts; - - /** The task */ - Flexotask task; - - /** In a flexotask VM with RTSJ support, the MemoryArea representing this Flexotask memory space. - * Otherwise, null. Declared 'Object' to avoid static dependence on an RTSJ library. - */ - public Object memoryArea; -} Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java 2008-10-21 20:23:28 UTC (rev 27) @@ -24,6 +24,8 @@ import com.ibm.realtime.flexotask.FlexotaskOutputPort; import com.ibm.realtime.flexotask.cloning.CloningSupport; import com.ibm.realtime.flexotask.util.ESystem; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; +import com.ibm.realtime.flexotask.vm.FlexotaskVMBridge; /* * (c) Copyright IBM Corp. 2006 - 2008 All Rights Reserved @@ -34,12 +36,6 @@ * be used by schedulers and other system-aware components. */ public class FlexotaskSystemSupport { - /** Indicator passed to createMemorySpace to indicate a "normal" flexotask space */ - public static final int NORMAL_MEMORY = 0; - - /** Indicator passed to createMemorySpace to indicate the scheduler heap */ - public static final int SCHEDULER_MEMORY = 1; - /** * Default size of flexotask heap (initial and maximum) in bytes (for compatibility with past versions of * flexotask support). @@ -189,9 +185,9 @@ * @param type the primitive type that is the element type of the array. Must be one of the primitive * classes int.class, boolean.class, etc. * @param size the number of elements in the array - * @param target the StableArray objects whose array field will receive the result + * @param target the StableArrayImpl object whose array field will receive the result */ - static void allocateStablePrimitiveArray(Class type, int size, StableArray target) + static void allocateStablePrimitiveArray(Class type, int size, StableArrayImpl target) { checkSecurity(target, "StableArray"); if (vmBridge != null) { @@ -235,7 +231,7 @@ */ static long createMemorySpace(boolean scheduler) { - return createMemorySpace(scheduler ? SCHEDULER_MEMORY : NORMAL_MEMORY, DEFAULT_HEAP_SIZE, DEFAULT_HEAP_SIZE); + return createMemorySpace(scheduler ? FlexotaskVMBridge.SCHEDULER_MEMORY : FlexotaskVMBridge.NORMAL_MEMORY, DEFAULT_HEAP_SIZE, DEFAULT_HEAP_SIZE); } /** Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,149 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.analysis.Service; -import com.ibm.realtime.flexotask.util.Notifier; - -/** - * Define the methods that bridge between the Flexotask Java support and the underlying support that must - * be present in the VM. The development-time VM need not contain an implementation, since the functions - * will then be simulated. However, to achieve realtime behavior an implementation must be provided. - */ -public interface FlexotaskVMBridge extends Service.Implementation { - /** @see FlexotaskSystemSupport#allocateStablePrimitiveArray(Class, int, StableArray) */ - Object allocateStablePrimitiveArray(Class type, int size); - /** @see FlexotaskSystemSupport#becomeFlexotaskThread(boolean) */ - void becomeFlexotaskThread(boolean state); - /** @see FlexotaskSystemSupport#collectHeap(FlexotaskRoot) */ - void collectHeap(FlexotaskRoot heapToCollect); - /** @see TransactionalOperations#commit() */ - void commitTransaction(); - /** @see FlexotaskSystemSupport#createMemorySpace(int, long, long) */ - long createMemorySpace(int type, long initialSize, long maxSize); - /** @see FlexotaskSystemSupport#deepClone(Object, Object) */ - Object deepClone(Object toClone, Object source); - /** @see TransactionalOperations#commit() */ - boolean getBooleanArrayElement(boolean[] object, int index); - /** @see TransactionalOperations#getBooleanArrayElement(boolean[], int) */ - boolean getBooleanField(Object object, int index); - /** @see TransactionalOperations#getBooleanField(Object, int) */ - byte getByteArrayElement(byte[] object, int index); - /** @see TransactionalOperations#getByteArrayElement(byte[], int) */ - byte getByteField(Object object, int index); - /** @see TransactionalOperations#getByteField(Object, int) */ - char getCharArrayElement(char[] object, int index); - /** @see TransactionalOperations#getCharArrayElement(char[], int) */ - char getCharField(Object object, int index); - /** @see TransactionalOperations#getCharField(Object, int) */ - double getDoubleArrayElement(double[] object, int index); - /** @see TransactionalOperations#getDoubleArrayElement(double[], int) */ - double getDoubleField(Object object, int index); - /** @see TransactionalOperations#getDoubleField(Object, int) */ - int getFieldOffset(Class clazz, String fieldName, String signature); - /** @see TransactionalOperations#getFloatArrayElement(float[], int) */ - float getFloatArrayElement(float[] object, int index); - /** @see TransactionalOperations#getFloatField(Object, int) */ - float getFloatField(Object object, int index); - /** @see FlexotaskSystemSupport#getHeapSize(Object) */ - long getHeapSize(Object target); - /** @see TransactionalOperations#getIntArrayElement(int[], int) */ - int getIntArrayElement(int[] object, int index); - /** @see TransactionalOperations#getIntField(Object, int) */ - int getIntField(Object object, int index); - /** @see TransactionalOperations#getLongArrayElement(long[], int) */ - long getLongArrayElement(long[] object, int index); - /** @see TransactionalOperations#getLongField(Object, int) */ - long getLongField(Object object, int index); - /** @see FlexotaskSystemSupport#getObjectMonitor(Notifier) */ - long getMonitor(Object object); - /** @see TransactionalOperations#getReferenceArrayElement(Object[], int) */ - Object getReferenceArrayElement(Object[] object, int index); - /** @see TransactionalOperations#getReferenceField(Object, int) */ - Object getReferenceField(Object object, int index); - /** @see TransactionalOperations#getShortArrayElement(short[], int) */ - short getShortArrayElement(short[] object, int index); - /** @see TransactionalOperations#getShortField(Object, int) */ - short getShortField(Object object, int index); - /** @see FlexotaskSystemSupport#isFlexotaskMemorySpace() */ - boolean isFlexotaskMemorySpace(); - /** @see FlexotaskSystemSupport#isOnPrivateHeap(Object) */ - boolean isOnPrivateHeap(Object value); - /** @see FlexotaskSystemSupport#nanosleep(long) */ - void nanosleep(long nextDeadline); - /** @see FlexotaskSystemSupport#nanoTime() */ - long nanoTime(); - /** @see FlexotaskSystemSupport#notifyIfWaiting(Notifier) */ - void notifyIfWaiting(long monitor); - /** @see FlexotaskSystemSupport#pin(Object[]) */ - boolean pin(Object[] toPin); - /** @see TransactionalOperations#registerFields(com.ibm.realtime.analysis.FieldWrapper[]) */ - void registerFieldOffsets(int[] offsets); - /** @see FlexotaskSystemSupport#resetTransient() */ - void resetTransient(); - /** @see FlexotaskSystemSupport#restoreMemorySpace(long) */ - void restoreMemorySpace(long spaceToRestore); - /** @see FlexotaskSystemSupport#runOnPublicHeap() */ - long runOnPublicHeap(); - /** @see TransactionalOperations#setBooleanArrayElement(boolean[], int, boolean) */ - void setBooleanArrayElement(boolean[] object, int index, boolean value); - /** @see TransactionalOperations#setBooleanField(Object, boolean, int) */ - void setBooleanField(Object object, boolean value, int fieldIndex); - /** @see TransactionalOperations#setByteArrayElement(byte[], int, byte) */ - void setByteArrayElement(byte[] object, int index, byte value); - /** @see TransactionalOperations#setByteField(Object, byte, int) */ - void setByteField(Object object, byte value, int fieldIndex); - /** @see TransactionalOperations#setCharArrayElement(char[], int, char) */ - void setCharArrayElement(char[] object, int index, char value); - /** @see TransactionalOperations#setCharField(Object, char, int) */ - void setCharField(Object object, char value, int fieldIndex); - /** @see TransactionalOperations#setDoubleArrayElement(double[], int, double) */ - void setDoubleArrayElement(double[] object, int index, double value); - /** @see TransactionalOperations#setDoubleField(Object, double, int) */ - void setDoubleField(Object object, double value, int fieldIndex); - /** @see FlexotaskSystemSupport#setFlexotaskRoot(FlexotaskRoot) */ - void setFlexotaskRoot(FlexotaskRoot toSet); - /** @see TransactionalOperations#setFloatArrayElement(float[], int, float) */ - void setFloatArrayElement(float[] object, int index, float value); - /** @see TransactionalOperations#setFloatField(Object, float, int) */ - void setFloatField(Object object, float value, int fieldIndex); - /** @see TransactionalOperations#setIntArrayElement(int[], int, int) */ - void setIntArrayElement(int[] object, int index, int value); - /** @see TransactionalOperations#setIntField(Object, int, int) */ - void setIntField(Object object, int value, int fieldIndex); - /** @see TransactionalOperations#setLongArrayElement(long[], int, long) */ - void setLongArrayElement(long[] object, int index, long value); - /** @see TransactionalOperations#setLongField(Object, long, int) */ - void setLongField(Object object, long value, int fieldIndex); - /** @see FlexotaskSystemSupport#setOThreadShouldAbort() */ - void setOThreadShouldAbort(); - /** @see TransactionalOperations#setReferenceArrayElement(Object[], int, Object) */ - void setReferenceArrayElement(Object[] object, int index, Object value); - /** @see TransactionalOperations#setReferenceField(Object, Object, int) */ - void setReferenceField(Object object, Object value, int fieldIndex); - /** @see TransactionalOperations#setShortArrayElement(short[], int, short) */ - void setShortArrayElement(short[] object, int index, short value); - /** @see TransactionalOperations#setShortField(Object, short, int) */ - void setShortField(Object object, short value, int fieldIndex); - /** @see FlexotaskSystemSupport#setStable(Class, boolean) */ - void setStable(Class clazz, boolean isStable); - /** @see FlexotaskSystemSupport#setTransientPolicy(boolean) */ - void setTransientPolicy(boolean status); - /** @see TransactionalOperations#startTransaction(Object) */ - long startTransaction(Object target); - /** @see FlexotaskSystemSupport#switchMemorySpace(Object) */ - long switchMemorySpace(Object target); - /** @see FlexotaskSystemSupport#unpin(Object[]) */ - void unpin(Object[] objects); -} Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-21 20:23:28 UTC (rev 27) @@ -51,6 +51,9 @@ import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; import com.ibm.realtime.flexotask.tracing.FlexotaskTracer; import com.ibm.realtime.flexotask.tracing.FlexotaskTracerFactory; +import com.ibm.realtime.flexotask.validation.AtomicFlexotaskGuard; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; +import com.ibm.realtime.flexotask.vm.FlexotaskVMBridge; /** * Not part of the external interface. Invoked via @@ -203,7 +206,7 @@ try { Class guardClass = CodeValidator.resolveClass(task.getGuard(), cl); AtomicFlexotaskGuard guard = (AtomicFlexotaskGuard) guardClass.newInstance(); - AtomicFlexotaskBase atomicTask = (AtomicFlexotaskBase) ((FlexotaskControllerImpl) controller).root.task; + AtomicFlexotaskBase atomicTask = (AtomicFlexotaskBase) ((FlexotaskControllerImpl) controller).root.getTask(); guard.setDelegate((AtomicFlexotask) atomicTask); atomicTask.lock = guard; guards.put(task.getName(), guard); @@ -448,10 +451,10 @@ FlexotaskTracer tracer = tracerFactory.newConnectionTracer(conn.getName()); FlexotaskTaskTemplate source = conn.getInput(); FlexotaskControllerImpl sourceController = (FlexotaskControllerImpl) taskMap.get(source); - FlexotaskOutputPortImpl sourcePort = (FlexotaskOutputPortImpl) sourceController.root.outputPorts[conn.getOutputPortToRead()]; + FlexotaskOutputPortImpl sourcePort = (FlexotaskOutputPortImpl) sourceController.root.getOutputPorts()[conn.getOutputPortToRead()]; FlexotaskTaskTemplate target = conn.getOutput(); FlexotaskControllerImpl targetController = (FlexotaskControllerImpl) taskMap.get(target); - FlexotaskInputPortImpl targetPort = (FlexotaskInputPortImpl) targetController.root.inputPorts[conn.getInputPortToWrite()]; + FlexotaskInputPortImpl targetPort = (FlexotaskInputPortImpl) targetController.root.getInputPorts()[conn.getInputPortToWrite()]; FlexotaskConnectionMode mode = conn.getConnectionMode(); ConnectionDriver driver; if (targetController instanceof AtomicFlexotaskController) { @@ -542,7 +545,7 @@ oldSpace = FlexotaskSystemSupport.createMemorySpace(false); } else { - oldSpace = FlexotaskSystemSupport.createMemorySpace(FlexotaskSystemSupport.NORMAL_MEMORY, heapSizes[0], heapSizes[1]); + oldSpace = FlexotaskSystemSupport.createMemorySpace(FlexotaskVMBridge.NORMAL_MEMORY, heapSizes[0], heapSizes[1]); } if (oldSpace == 0L) { throw new FlexotaskValidationException("Unable to instantiate private heap for " + @@ -566,46 +569,48 @@ /* Create FlexotaskRoot */ FlexotaskRoot root = new FlexotaskRoot(); /* Create input port array */ - root.inputPorts = new FlexotaskInputPort[numInputPorts]; + FlexotaskInputPort[] inputPorts = new FlexotaskInputPort[numInputPorts]; + root.setInputPorts(inputPorts); /* Create input ports */ - for (int i = 0; i < root.inputPorts.length; i++) { - root.inputPorts[i] = new FlexotaskInputPortImpl(task.getInputPortBuffering()[i]); + for (int i = 0; i < inputPorts.length; i++) { + inputPorts[i] = new FlexotaskInputPortImpl(task.getInputPortBuffering()[i]); } /* Create output port array */ - root.outputPorts = new FlexotaskOutputPort[outputPortClasses.length]; + FlexotaskOutputPort[] outputPorts = new FlexotaskOutputPort[outputPortClasses.length]; + root.setOutputPorts(outputPorts); /* Create output ports */ - for (int i = 0; i < root.outputPorts.length; i++) { + for (int i = 0; i < outputPorts.length; i++) { boolean isByRef = false; List byRefOutputPorts = (List) byRefConnMap.get(task.getName()); if (byRefOutputPorts != null) isByRef = (byRefOutputPorts.contains(task.getOutputPortNames()[i])); - root.outputPorts[i] = new FlexotaskOutputPortImpl(outputPortClasses[i], task.getOutputPortBuffering()[i], isByRef); + outputPorts[i] = new FlexotaskOutputPortImpl(outputPortClasses[i], task.getOutputPortBuffering()[i], isByRef); } try { /* Instantiate the Flexotask and store it in the root */ - root.task = (Flexotask) implClass.newInstance(); + root.setTask((Flexotask) implClass.newInstance()); } catch (Exception e) { throw new FlexotaskValidationException("Could not instantiate Runnable of class " + implClass.getName() + " for task " + task.getName(), e); } /* If the Flexotask is atomic, initialize the transactional system with its fields */ - if (root.task instanceof AtomicFlexotask) { - TransactionalOperations.registerFields(((AtomicFlexotask) root.task).getReachableFieldTable()); + if (root.getTask() instanceof AtomicFlexotask) { + TransactionalOperations.registerFields(((AtomicFlexotask) root.getTask()).getReachableFieldTable()); } /* If the Flexotask is strongly isolated, clone its parameter */ if (!task.isWeaklyIsolated()) { parameter = FlexotaskSystemSupport.deepClone(parameter, null); } /* Initialize the Flexotask */ - root.task.initialize(root.inputPorts, root.outputPorts, parameter); + root.getTask().initialize(root.getInputPorts(), root.getOutputPorts(), parameter); /* Initialize the ports iff communicator */ if (portInitValue != null) { portInitValue = FlexotaskSystemSupport.deepClone(portInitValue, null); - if (root.inputPorts.length > 0) { - ((FlexotaskInputPortImpl) root.inputPorts[0]).setValue(portInitValue); + if (root.getInputPorts().length > 0) { + ((FlexotaskInputPortImpl) root.getInputPorts()[0]).setValue(portInitValue); } - if (root.outputPorts.length > 0) { - root.outputPorts[0].setValue(portInitValue); + if (root.getOutputPorts().length > 0) { + root.getOutputPorts()[0].setValue(portInitValue); } } /* Identify the FlexotaskController as the root for GC in this memory space */ @@ -621,7 +626,7 @@ FlexotaskTaskTracer tracer = tracerFactory.newTaskTracer(task.getName()); if (task instanceof FlexotaskPredicateTemplate) { return new FlexotaskPredicateControllerImpl(root, task.getName(), tracer); - } else if (root.task instanceof AtomicFlexotask){ + } else if (root.getTask() instanceof AtomicFlexotask){ return new AtomicFlexotaskController(root, task.getName(), tracer); } else { Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,22 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -/** - * Class used for the type of a dummy parameter added to the method signature - * of privatized methods. - */ -public class Privatized { - private Privatized() {} -} Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,75 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.flexotask.Stable; - - -/** - * Special abstract class that indicates to the type checker that this is a stable array - */ -public abstract class StableArray implements Stable -{ - /** The encapsulated array (not accessible outside this package) */ - Object array; - - /** The length of the array */ - public final int length; - - /** - * Create a new encapsulated array. Subclasses must be loaded from a secure classpath - * @param type the element type of the array (a primitive class like int.class) - * @param size the size of the array - */ - protected StableArray(Class type, int size) - { - FlexotaskSystemSupport.allocateStablePrimitiveArray(type, size, this); - length = size; - } - - /** - * Provide access to the array from subclasses - * @return the encapsulated array - */ - protected Object getArray() - { - return array; - } - - /** - * Perform arraycopy into this array - * @param source the source array (must match this array in type) - * @param sourceOffset offset in source where to start - * @param targetOffset offset in target where to start - * @param length number of bytes to copy - * @throws ArrayIndexOutOfBoundsException like System.arraycopy - */ - public void copyIn(Object source, int sourceOffset, int targetOffset, int length) - { - System.arraycopy(source,sourceOffset, array,targetOffset, length); - } - - /** - * Perform arraycopy from this array - * @param sourceOffset offset in source where to start - * @param target the target array (must match this array in type) - * @param targetOffset offset in target where to start - * @param length number of bytes to copy - * @throws ArrayIndexOutOfBoundsException like System.arraycopy - */ - public void copyOut(int sourceOffset, Object target, int targetOffset, int length) - { - System.arraycopy(array,sourceOffset, target,targetOffset, length); - } -} Added: trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,69 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.system; + + +public abstract class StableArrayImpl { + /** The encapsulated array (not accessible outside this package) */ + Object array; + + /** The length of the array */ + public final int length; + + /** + * Create a new encapsulated array. Subclasses must be loaded from a secure classpath + * @param type the element type of the array (a primitive class like int.class) + * @param size the size of the array + */ + protected StableArrayImpl(Class type, int size) + { + FlexotaskSystemSupport.allocateStablePrimitiveArray(type, size, this); + length = size; + } + + /** + * Provide access to the array from subclasses + * @return the encapsulated array + */ + protected Object getArray() + { + return array; + } + + /** + * Perform arraycopy into this array + * @param source the source array (must match this array in type) + * @param sourceOffset offset in source where to start + * @param targetOffset offset in target where to start + * @param length number of bytes to copy + * @throws ArrayIndexOutOfBoundsException like System.arraycopy + */ + public void copyIn(Object source, int sourceOffset, int targetOffset, int length) + { + System.arraycopy(source,sourceOffset, array,targetOffset, length); + } + + /** + * Perform arraycopy from this array + * @param sourceOffset offset in source where to start + * @param target the target array (must match this array in type) + * @param targetOffset offset in target where to start + * @param length number of bytes to copy + * @throws ArrayIndexOutOfBoundsException like System.arraycopy + */ + public void copyOut(int sourceOffset, Object target, int targetOffset, int length) + { + System.arraycopy(array,sourceOffset, target,targetOffset, length); + } +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java 2008-10-21 20:23:28 UTC (rev 27) @@ -17,6 +17,7 @@ import java.lang.reflect.Field; import com.ibm.realtime.analysis.FieldWrapper; +import com.ibm.realtime.flexotask.vm.FlexotaskVMBridge; /** * Provides invokestatic targets for the byte code rewriter for the following opcodes: Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,6 +13,8 @@ */ package com.ibm.realtime.flexotask.tracing; +import com.ibm.realtime.flexotask.util.NanoTime; + /** * An FlexotaskTracer that measures interarrival between the same or a different task * Uses an ancillary IntervalStatistics class @@ -40,7 +42,7 @@ */ public void startRun() { - long time = TracingSupport.nanoTime() / 1000; + long time = NanoTime.nanoTime() / 1000; ends.end(time); starts.start(time); } Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java 2008-10-21 20:23:28 UTC (rev 27) @@ -14,6 +14,7 @@ package com.ibm.realtime.flexotask.tracing; import com.ibm.realtime.flexotask.util.ESystem; +import com.ibm.realtime.flexotask.util.NanoTime; /** * A specialized Tracer factory that just supplies a given FlexotaskTaskTracer for a set of specific @@ -86,7 +87,7 @@ { if (verboseInitialization) { ESystem.err.print("Instantiation time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - intervalStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - intervalStart); ESystem.err.println("usec"); } } @@ -98,7 +99,7 @@ { if (verboseInitialization) { ESystem.err.print("Scheduling time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - intervalStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - intervalStart); ESystem.err.println("usec"); } } @@ -110,7 +111,7 @@ { if (verboseInitialization) { ESystem.err.print("Thread creation time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - threadStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - threadStart); ESystem.err.println("usec"); } } @@ -122,7 +123,7 @@ { if (verboseInitialization) { ESystem.err.print("Validation time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - intervalStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - intervalStart); ESystem.err.println("usec"); } } @@ -146,7 +147,7 @@ public void startInstantiation() { if (verboseInitialization) { - intervalStart = TracingSupport.nanoTime() / 1000; + intervalStart = NanoTime.nanoTime() / 1000; } } @@ -156,7 +157,7 @@ public void startScheduling() { if (verboseInitialization) { - intervalStart = TracingSupport.nanoTime() / 1000; + intervalStart = NanoTime.nanoTime() / 1000; } } @@ -166,14 +167,14 @@ public void startThreadCreation() { if (verboseInitialization) { - threadStart = TracingSupport.nanoTime() / 1000; + threadStart = NanoTime.nanoTime() / 1000; } } public void startValidation() { if (verboseInitialization) { - intervalStart = TracingSupport.nanoTime() / 1000; + intervalStart = NanoTime.nanoTime() / 1000; } } } Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,25 +13,15 @@ */ package com.ibm.realtime.flexotask.tracing; -import com.ibm.realtime.flexotask.system.FlexotaskSystemSupport; import com.ibm.realtime.flexotask.system.FlexotaskValidator; /** - * Contains utility method used by tracers and the setTracing method that establishes the tracing - * factory for this process. + * Contains the setTracing method that establishes the tracing factory for this process. */ public class TracingSupport { private TracingSupport() {} + /** - * Get the nanoTime (using System.nanoTime if available, otherwise via FlexotaskVMBridge natives, - * if available, otherwise approximating with millisecond time) - * @return the time in nanoseconds since an arbitrary origin - */ - public static long nanoTime() { - return FlexotaskSystemSupport.nanoTime(); - } - - /** * Set the tracer factory to be used in subsequently instantiated graphs. The factory and the * objects it creates must obey the rules for tracers so as not to perturb execution * @param tracerFactory the FlexotaskTracerFactory to be used. As a bow to security concerns, Added: trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,41 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.util; + +import com.ibm.realtime.flexotask.system.FlexotaskSystemSupport; + +/** + * Provides static methods that provide up to nanotime resolution for time-telling and sleeping depending + * on the underlying OS. Note that Timer.nanoTime() and System.nanoTime() are equivalent on a Java5 system + * but use of these functions is preferable since they will work on a pre-Java5 system. + */ +public class NanoTime { + private NanoTime() {} /* not instantiable */ + /** + * Get an arbitrary-origin clock at nanotime resolution + * @return the time in nanoseconds since an arbitrary origin + */ + public static long nanoTime() { + return FlexotaskSystemSupport.nanoTime(); + } + + /** + * Sleep until an absolute time in the future, using the same time scale as nanoTime(). + * @param nextDeadline a time in the future at which this thread should wake up (note <em>very well</em> + * and then <em>note again</em> that this argument is an absolute time and <em>not</em> an interval!) + */ + public static void nanosleep(long nextDeadline) { + FlexotaskSystemSupport.nanosleep(nextDeadline); + } +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a boolean[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a bytean[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a char[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a double[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a float[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a int[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a long[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a short[] to reside in stable storage in cases when primitive arrays are not allowed there Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,31 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.validation; + +import com.ibm.realtime.flexotask.AtomicFlexotask; + +/** + * Interface that must be implemented by all objects that will function as public interfaces to + * AtomicFlexotasks. The actual guard object remains on the external heap (pinned) and points to the + * AtomicFlexotask delegate. + */ +public interface AtomicFlexotaskGuard +{ + /** + * Method to store the AtomicFlexotask "delegate" for which this guard object is a guard. The + * delegate pointer must not be leaked. This is checked (conservatively) during validation. + * @param delegate the delegate or null (during termination) + */ + public void setDelegate(AtomicFlexotask delegate); +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java 2008-10-21 20:23:28 UTC (rev 27) @@ -41,7 +41,6 @@ import com.ibm.realtime.flexotask.FlexotaskInputPort; import com.ibm.realtime.flexotask.FlexotaskOutputPort; import com.ibm.realtime.flexotask.system.FlexotaskSystemSupport; -import com.ibm.realtime.flexotask.system.StableArray; import com.ibm.realtime.flexotask.system.TransactionalOperations; import com.ibm.realtime.flexotask.template.FlexotaskStableMode; import com.ibm.realtime.flexotask.template.FlexotaskTaskTemplate; Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,22 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.validation; + +/** + * Class used for the type of a dummy parameter added to the method signature + * of privatized methods. + */ +public class Privatized { + private Privatized() {} +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,27 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.validation; + +import com.ibm.realtime.flexotask.Stable; +import com.ibm.realtime.flexotask.system.StableArrayImpl; + +/** + * Special abstract class that indicates to the type checker that this is a stable array + */ +public abstract class StableArray extends StableArrayImpl implements Stable { + + protected StableArray(Class type, int size) { + super(type, size); + } +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,99 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.vm; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; + +/** + * The root memory object in every flexotask: keeps the task and ports live and makes them accessible + * to the FlexotaskController objects used by the scheduler. + */ +public final class FlexotaskRoot +{ + /** The input ports of 'task'. */ + private FlexotaskInputPort[] inputPorts; + + /** The output ports of 'task'. */ + private FlexotaskOutputPort[] outputPorts; + + /** The task */ + private Flexotask task; + + /** In a flexotask VM with RTSJ support, the MemoryArea representing this Flexotask memory space. + * Otherwise, n... [truncated message content] |