DIRECTORY Rope USING [ROPE], SaffronBaseDef USING [ValueNode]; SaffronProgramGraphPrivateTypes: CEDAR DEFINITIONS = BEGIN OPEN BD: SaffronBaseDef; ParameterizedFieldDescriptorNode: TYPE = REF ParameterizedFieldDescriptorNodeBody; ParameterizedFieldDescriptorNodeBody: TYPE = RECORD [ firstCell: ParameterizedFieldDescriptorCell, lastCell: ParameterizedFieldDescriptorCell ]; ParameterizedFieldDescriptorCell: TYPE = REF ParameterizedFieldDescriptorCellBody; ParameterizedFieldDescriptorCellBody: TYPE = RECORD [ next: ParameterizedFieldDescriptorCell, k: SELECT kind: * FROM index => [], -- find it on the stack! nested => [], staticLink => [], vars => [name: Rope.ROPE], fieldName => [name: Rope.ROPE] ENDCASE ]; ProgramGraphNode: TYPE = REF ProgramGraphNodeBody; ProgramGraphNodeBody: TYPE = RECORD [ main: ProcedureGraphNode, firstSubroutine: ProcedureGraphCell, lastSubroutine: ProcedureGraphCell ]; ProcedureGraphCell: TYPE = REF ProcedureGraphCellBody; ProcedureGraphCellBody: TYPE = RECORD [ next: ProcedureGraphCell, procedureGraph: ProcedureGraphNode ]; ProcedureGraphNode: TYPE = REF ProcedureGraphNodeBody; ProcedureGraphNodeBody: TYPE = RECORD [ code: ProgramFragmentNode ]; ProgramFragmentNode: TYPE = REF ProgramFragmentNodeBody; ProgramFragmentNodeBody: TYPE = RECORD [ firstOperation: OperationNode, exitingOperations: LIST OF OperationNode ]; OperationNode: TYPE = REF OperationNodeBody; OperationNodeBody: TYPE = RECORD [ signalCatchNode: SignalCatchNode, outgoingActionEdges: OutgoingActionsCell, effects: REF ANY ]; OutgoingActionsCell: TYPE = REF OutgoingActionsCellBody; OutgoingActionsCellBody: TYPE = RECORD [ label: OutgoingActionKind, to: OperationNode, next: OutgoingActionsCell ]; OutgoingActionKind: TYPE = {next, ifTrue, ifFalse}; SignalCatchNode: TYPE = REF SignalCatchNodeBody; SignalCatchNodeBody: TYPE = RECORD []; OpPushConstant: TYPE = REF OpPushConstantBody; OpPushConstantBody: TYPE = RECORD [ constant: BD.ValueNode ]; OpTest: TYPE = REF OpTestBody; OpTestBody: TYPE = RECORD []; OpUnaryFunction: TYPE = REF OpUnaryFunctionBody; OpUnaryFunctionBody: TYPE = RECORD [ f: SELECT function: * FROM negate => [], -- these fields should contain next actions for unsatisfactory arguments. not => [], ENDCASE ]; OpBinaryFunction: TYPE = REF OpBinaryFunctionBody; OpBinaryFunctionBody: TYPE = RECORD [ f: SELECT function: * FROM add => [], subtract => [], multiply => [], divide => [], mod => [], and => [], or => [], equal => [], notEqual => [], ENDCASE ]; OpLoadLocal: TYPE = REF OpLoadLocalBody; OpLoadLocalBody: TYPE = RECORD [ pfd: ParameterizedFieldDescriptorNode, nextActionIfUnsatisfactoryIndices: OperationNode ]; OpLoadIndirect: TYPE = REF OpLoadIndirectBody; OpLoadIndirectBody: TYPE = RECORD [ pfd: ParameterizedFieldDescriptorNode, nextActionIfUnsatisfactoryIndices: OperationNode, nextActionIfNilPointer: OperationNode ]; OpStoreLocal: TYPE = REF OpStoreLocalBody; OpStoreLocalBody: TYPE = RECORD [ pfd: ParameterizedFieldDescriptorNode, nextActionIfUnsatisfactoryIndices: OperationNode ]; OpStoreIndirect: TYPE = REF OpStoreIndirectBody; OpStoreIndirectBody: TYPE = RECORD [ pfd: ParameterizedFieldDescriptorNode, nextActionIfUnsatisfactoryIndices: OperationNode, nextActionIfNilPointer: OperationNode ]; OpReturn: TYPE = REF OpReturnBody; OpReturnBody: TYPE = RECORD [ ]; END. ŒSaffronProgramGraphPrivateTypes.Mesa James Rauen, August 7, 1988 4:19:15 pm PDT Last edited by: James Rauen August 23, 1988 3:55:44 pm PDT Parameterized Field Descriptor index => [index: BD.ValueNode], Program Graph Invariant: code.exitingOperations = NIL Invariant: A operation: OperationNode B exitingOperations: operation.outgoingActionEdges = [label: next, to: NIL, next: NIL] Also note that we represent a no-op program fragment as [NIL, NIL]. operation: SELECT primitiveOperation: * FROM NoOp => [op: OpNoOp], PushConstant => [op: OpPushConstant], Test => [op: OpTest], UnaryFunction => [op: OpUnaryFunction], BinaryFunction => [op: OpBinaryFunction], LoadLocal => [op: OpLoadLocal], LoadIndirect => [op: OpLoadIndirect], StoreLocal => [op: OpStoreLocal], StoreIndirect => [op: OpStoreIndirect], New => [op: OpNew], Call => [op: OpCall], Return => [op: OpReturn], CreateProcedureDescriptor => [op: OpCreateProcedureDescriptor], SetLock => [op: OpSetLock], Sleep => [op: OpSleep], Wake => [op: OpWake], LoadOwnProcess => [op: OpLoadOwnProcess], Fork => [op: OpFork], Join => [op: OpJoin], Detach => [op: OpDetach], WaitForCondition => [op: OpWaitForCondition], NotifyCondition => [op: OpNotifyCondition], BroadcastToCondition => [op: OpBroadcastToCondition], EnterMonitor => [op: OpEnterMonitor], ExitMonitor => [op: OpExitMonitor], EnQueueSelf => [op: OpEnQueueSelf], DeQueueSelf => [op: OpDeQueueSelf], WakeOneOnQueue => [op: OpWakeOneOnQueue], WakeAllOnQueue => [op: OpWakeAllOnQueue], LockQueue => [op: OpLockQueue], ReleaseQueue => [op: OpReleaseQueue], SaveSignalParamters => [op: OpSaveSignalParamters], GetCatchNode => [op: OpGetCatchNode], GetCatchCodeProcedureDescriptor => [op: OpGetCatchCodeProcedureDescriptor], GetNextCatchNode => [op: OpGetNextCatchNode], AcquireSignalParameters => [op: OpAcquireSignalParameters], DeleteCallerPFrame => [op: OpDeleteCallerPFrame], ENDCASE ]; Stack Primitives nextActionIfSatisfactoryArguments: OperationNode, nextActionIfSatisfactoryArguments: OperationNode, Load/Store Operations nextActionIfSatisfactoryIndices: OperationNode, nextActionIfSatisfactoryIndices: OperationNode, nextActionIfSatisfactoryIndices: OperationNode, nextActionIfSatisfactoryIndices: OperationNode, Κν˜™$Jšœ'Οk™*Icode™:J˜—š ˜ Jšœœœ˜Jšœœ ˜!—J˜šΟnœœ œ˜:J˜Jšœœ˜J˜headšΟz™Jšœ"œœ&˜Ršœ&œœ˜5J˜,J˜*J˜J˜—Jšœ"œœ&˜Ršœ&œœ˜5Jšœ'˜'šœœ ˜JšœΟc˜(Jšœœ ™"J˜J˜Jšœœ˜Jšœœ˜Jš˜J˜J˜———šŸ ™ Jšœœœ˜2šœœœ˜%J˜Jšœ$˜$Jšœ"˜"J˜J˜—Jšœœœ˜6šœœœ˜'Jšœ˜J˜"J˜J˜—Jšœœœ˜6šœœœ˜'J˜J˜Jšœ$™'—J˜Jšœœœ˜8šœœœ˜(Jšœ˜Jšœœœ˜(J˜šœ Οmœ‘œ™:Jšœ3œœ™C—Jšœ9œœ™C—J˜Jšœœœ˜,šœœœ˜"J˜!J˜)Jšœ œ˜J˜J˜šœ œ™,J™J™*J™J™,J™.J™%J™+J™'J™-J™J™J™ J™AJ™"J™J™J™.J™J™J™ J™1Jšœ0™0Jšœ8™8Jšœ*™*Jšœ)™)Jšœ)™)Jšœ)™)Jšœ-™-Jšœ-™-Jšœ%™%Jšœ*™*Jšœ7™7Jšœ*™*JšœK™KJšœ1™1Jšœ=™=Jšœ5™5Jš™—J™J˜—Jšœœœ˜8šœœœ˜(J˜Jšœ˜Jšœ˜J˜J˜—šœœ˜3J˜—Jšœœœ˜0Jšœœœ˜&—šŸ™Jšœœœ˜.šœœœ˜#Jšœ œ ˜J˜J˜—Jšœœœ ˜šœ œœ˜J˜—Jšœœœ˜0šœœœ˜$Jšœ1™1šœœ ˜Jšœ I˜WJšœ ˜ Jš˜—J˜J˜—Jšœœœ˜2šœœœ˜%Jšœ1™1šœœ ˜J˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšœ˜Jš˜—J˜J˜——šŸ™Jšœ œœ˜(šœœœ˜ Jšœ&˜&Jšœ/™/Jšœ0˜0J˜J˜—Jšœœœ˜.šœœœ˜#Jšœ&˜&Jšœ/™/Jšœ1˜1Jšœ%˜%J˜J˜—Jšœœœ˜*šœœœ˜!Jšœ&˜&Jšœ/™/Jšœ0˜0J˜J˜—Jšœœœ˜0šœœœ˜$Jšœ&˜&Jšœ/™/Jšœ1˜1Jšœ%˜%J˜J˜—Jšœ œœ˜"šœœœ˜J˜J˜—J˜—Jšœ˜——…— $