Fix a race condition in JIT state refresh under debugging / misc code cleanup.
Bug: 2561283
Change-Id: I9fd94928f3e661de97098808340ea92b28cafa07
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index e3ac5bb..695f18c 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -911,7 +911,7 @@
ArmLIR *branch = genUnconditionalBranch(cUnit, NULL);
/* Set up the place holder to reconstruct this Dalvik PC */
ArmLIR *pcrLabel = dvmCompilerNew(sizeof(ArmLIR), true);
- pcrLabel->opCode = ARM_PSEUDO_kPCReconstruction_CELL;
+ pcrLabel->opCode = kArmPseudoPCReconstructionCell;
pcrLabel->operands[0] = dPC;
pcrLabel->operands[1] = mir->offset;
/* Insert the place holder to the growable list */
@@ -1148,7 +1148,7 @@
if (pcrLabel == NULL) {
int dPC = (int) (cUnit->method->insns + mir->offset);
pcrLabel = dvmCompilerNew(sizeof(ArmLIR), true);
- pcrLabel->opCode = ARM_PSEUDO_kPCReconstruction_CELL;
+ pcrLabel->opCode = kArmPseudoPCReconstructionCell;
pcrLabel->operands[0] = dPC;
pcrLabel->operands[1] = mir->offset;
/* Insert the place holder to the growable list */
@@ -2811,7 +2811,7 @@
if (pcrLabel == NULL) {
int dPC = (int) (cUnit->method->insns + mir->offset);
pcrLabel = dvmCompilerNew(sizeof(ArmLIR), true);
- pcrLabel->opCode = ARM_PSEUDO_kPCReconstruction_CELL;
+ pcrLabel->opCode = kArmPseudoPCReconstructionCell;
pcrLabel->operands[0] = dPC;
pcrLabel->operands[1] = mir->offset;
/* Insert the place holder to the growable list */
@@ -3487,7 +3487,7 @@
{
/* Set up the place holder to reconstruct this Dalvik PC */
ArmLIR *pcrLabel = dvmCompilerNew(sizeof(ArmLIR), true);
- pcrLabel->opCode = ARM_PSEUDO_kPCReconstruction_CELL;
+ pcrLabel->opCode = kArmPseudoPCReconstructionCell;
pcrLabel->operands[0] =
(int) (cUnit->method->insns + entry->startOffset);
pcrLabel->operands[1] = entry->startOffset;
@@ -3598,7 +3598,7 @@
}
if (blockList[i]->blockType == kEntryBlock) {
- labelList[i].opCode = ARM_PSEUDO_kEntryBlock;
+ labelList[i].opCode = kArmPseudoEntryBlock;
if (blockList[i]->firstMIRInsn == NULL) {
continue;
} else {
@@ -3606,7 +3606,7 @@
&labelList[blockList[i]->fallThrough->id]);
}
} else if (blockList[i]->blockType == kExitBlock) {
- labelList[i].opCode = ARM_PSEUDO_kExitBlock;
+ labelList[i].opCode = kArmPseudoExitBlock;
goto gen_fallthrough;
} else if (blockList[i]->blockType == kDalvikByteCode) {
labelList[i].opCode = kArmPseudoNormalBlockLabel;
@@ -3617,14 +3617,14 @@
} else {
switch (blockList[i]->blockType) {
case kChainingCellNormal:
- labelList[i].opCode = ARM_PSEUDO_kChainingCellNormal;
+ labelList[i].opCode = kArmPseudoChainingCellNormal;
/* handle the codegen later */
dvmInsertGrowableList(
&chainingListByType[kChainingCellNormal], (void *) i);
break;
case kChainingCellInvokeSingleton:
labelList[i].opCode =
- ARM_PSEUDO_kChainingCellInvokeSingleton;
+ kArmPseudoChainingCellInvokeSingleton;
labelList[i].operands[0] =
(int) blockList[i]->containingMethod;
/* handle the codegen later */
@@ -3634,7 +3634,7 @@
break;
case kChainingCellInvokePredicted:
labelList[i].opCode =
- ARM_PSEUDO_kChainingCellInvokePredicted;
+ kArmPseudoChainingCellInvokePredicted;
/* handle the codegen later */
dvmInsertGrowableList(
&chainingListByType[kChainingCellInvokePredicted],
@@ -3642,7 +3642,7 @@
break;
case kChainingCellHot:
labelList[i].opCode =
- ARM_PSEUDO_kChainingCellHot;
+ kArmPseudoChainingCellHot;
/* handle the codegen later */
dvmInsertGrowableList(
&chainingListByType[kChainingCellHot],
@@ -3651,7 +3651,7 @@
case kPCReconstruction:
/* Make sure exception handling block is next */
labelList[i].opCode =
- ARM_PSEUDO_kPCReconstruction_BLOCK_LABEL;
+ kArmPseudoPCReconstructionBlockLabel;
assert (i == cUnit->numBlocks - 2);
handlePCReconstruction(cUnit, &labelList[i+1]);
break;
@@ -3667,7 +3667,7 @@
#if defined(WITH_SELF_VERIFICATION) || defined(WITH_JIT_TUNING)
case kChainingCellBackwardBranch:
labelList[i].opCode =
- ARM_PSEUDO_kChainingCellBackwardBranch;
+ kArmPseudoChainingCellBackwardBranch;
/* handle the codegen later */
dvmInsertGrowableList(
&chainingListByType[kChainingCellBackwardBranch],
@@ -3703,7 +3703,7 @@
InstructionFormat dalvikFormat =
dexGetInstrFormat(gDvm.instrFormat, dalvikOpCode);
ArmLIR *boundaryLIR =
- newLIR2(cUnit, ARM_PSEUDO_kDalvikByteCode_BOUNDARY,
+ newLIR2(cUnit, kArmPseudoDalvikByteCodeBoundary,
mir->offset,
(int) dvmCompilerGetDalvikDisassembly(&mir->dalvikInsn)
);