Simple debugging support for portable path.
Change-Id: Ibdc33b8d7f644c091fdb3ba3ce2ba45804bc4078
diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc
index f3ebf09..1e81458 100644
--- a/src/compiler/codegen/MethodBitcode.cc
+++ b/src/compiler/codegen/MethodBitcode.cc
@@ -61,6 +61,17 @@
llvm::Instruction* inst = llvm::dyn_cast<llvm::Instruction>(placeholder);
DCHECK(inst != NULL);
inst->eraseFromParent();
+
+ // Set vreg for debugging
+ if (!cUnit->compiler->IsDebuggingSupported()) {
+ greenland::IntrinsicHelper::IntrinsicId id =
+ greenland::IntrinsicHelper::SetVReg;
+ llvm::Function* func = cUnit->intrinsic_helper->GetIntrinsicFunction(id);
+ int vReg = SRegToVReg(cUnit, sReg);
+ llvm::Value* tableSlot = cUnit->irb->getInt32(vReg);
+ llvm::Value* args[] = { tableSlot, val };
+ cUnit->irb->CreateCall(func, args);
+ }
}
llvm::Type* llvmTypeFromLocRec(CompilationUnit* cUnit, RegLocation loc)
@@ -1837,7 +1848,9 @@
greenland::IntrinsicHelper::AllocaShadowFrame;
llvm::Function* func = cUnit->intrinsic_helper->GetIntrinsicFunction(id);
llvm::Value* entries = cUnit->irb->getInt32(cUnit->numShadowFrameEntries);
- cUnit->irb->CreateCall(func, entries);
+ llvm::Value* dalvikRegs = cUnit->irb->getInt32(cUnit->numDalvikRegisters);
+ llvm::Value* args[] = { entries, dalvikRegs };
+ cUnit->irb->CreateCall(func, args);
} else if (bb->blockType == kExitBlock) {
/*
* Because of the differences between how MIR/LIR and llvm handle exit
@@ -2998,6 +3011,7 @@
case greenland::IntrinsicHelper::AllocaShadowFrame:
case greenland::IntrinsicHelper::SetShadowFrameEntry:
case greenland::IntrinsicHelper::PopShadowFrame:
+ case greenland::IntrinsicHelper::SetVReg:
// Ignore shadow frame stuff for quick compiler
break;
case greenland::IntrinsicHelper::CopyInt: