@Override public BValue copy(Map<BValue, BValue> refs) { return new BFunctionPointer(functionInfo); } }
private static void beginRemoteParticipant(Strand strand, int transactionBlockIdIndex, int committedFuncIndex, int abortedFuncIndex) { TransactionLocalContext localTransactionContext = strand.getLocalTransactionContext(); if (localTransactionContext == null) { // No transaction available to participate, // We have no business here. This is a no-op. return; } // Register committed function handler if exists. BFunctionPointer fpCommitted = null; if (committedFuncIndex != -1) { FunctionRefCPEntry funcRefCPEntry = (FunctionRefCPEntry) strand.currentFrame.constPool[committedFuncIndex]; fpCommitted = new BFunctionPointer(funcRefCPEntry.getFunctionInfo()); } // Register aborted function handler if exists. BFunctionPointer fpAborted = null; if (abortedFuncIndex != -1) { FunctionRefCPEntry funcRefCPEntry = (FunctionRefCPEntry) strand.currentFrame.constPool[abortedFuncIndex]; fpAborted = new BFunctionPointer(funcRefCPEntry.getFunctionInfo()); } String transactionBlockId = getTrxBlockIdFromCP(strand, transactionBlockIdIndex); localTransactionContext.setResourceParticipant(true); String globalTransactionId = localTransactionContext.getGlobalTransactionId(); localTransactionContext.beginTransactionBlock(transactionBlockId, -1); TransactionResourceManager.getInstance() .registerParticipation(globalTransactionId, transactionBlockId, fpCommitted, fpAborted, strand); strand.currentFrame.trxParticipant = StackFrame.TransactionParticipantType.REMOTE_PARTICIPANT; }
private static void beginTransactionLocalParticipant(Strand strand, int transactionBlockIdCpIndex, int committedFuncIndex, int abortedFuncIndex) { TransactionLocalContext transactionLocalContext = strand.getLocalTransactionContext(); if (transactionLocalContext == null) { // No transaction available to participate, // We have no business here. This is a no-op. return; } String transactionBlockId = getTrxBlockIdFromCP(strand, transactionBlockIdCpIndex); // Register committed function handler if exists. TransactionResourceManager transactionResourceManager = TransactionResourceManager.getInstance(); BFunctionPointer fpCommitted = null; if (committedFuncIndex != -1) { FunctionRefCPEntry funcRefCPEntry = (FunctionRefCPEntry) strand.currentFrame.constPool[committedFuncIndex]; fpCommitted = new BFunctionPointer(funcRefCPEntry.getFunctionInfo()); transactionResourceManager.registerCommittedFunction(transactionBlockId, fpCommitted); } // Register aborted function handler if exists. BFunctionPointer fpAborted = null; if (abortedFuncIndex != -1) { FunctionRefCPEntry funcRefCPEntry = (FunctionRefCPEntry) strand.currentFrame.constPool[abortedFuncIndex]; fpAborted = new BFunctionPointer(funcRefCPEntry.getFunctionInfo()); transactionResourceManager.registerAbortedFunction(transactionBlockId, fpAborted); } transactionLocalContext.beginTransactionBlock(transactionBlockId, 1); transactionResourceManager.registerParticipation(transactionLocalContext.getGlobalTransactionId(), transactionBlockId, fpCommitted, fpAborted, strand); // this call frame is a transaction participant. strand.currentFrame.trxParticipant = StackFrame.TransactionParticipantType.LOCAL_PARTICIPANT; }
funcRefCPEntry = (FunctionRefCPEntry) sf.constPool[i]; typeEntry = (TypeRefCPEntry) sf.constPool[k]; BFunctionPointer functionPointer = new BFunctionPointer(funcRefCPEntry.getFunctionInfo(), typeEntry.getType()); sf.refRegs[j] = functionPointer; .get(funcRefCPEntry.getFunctionInfo().getName()); BFunctionPointer fPointer = new BFunctionPointer(attachedFuncInfo, typeEntry.getType()); sf.refRegs[j] = fPointer; findAndAddAdditionalVarRegIndexes(sf, operands, fPointer);