summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/MethodBitcode.cc
diff options
context:
space:
mode:
author TDYa127 <tdy@google.com> 2012-11-02 09:58:19 -0700
committer TDYa127 <tdy@google.com> 2012-11-14 15:45:03 -0800
commit8e950c117975d23f50ed7e32ca5db01a813c25d0 (patch)
tree2d4363de95db34aae624ff90929d4ec215ac63cd /src/compiler/codegen/MethodBitcode.cc
parent8bb8e8653b4c3ad5d87863f98ffec5f95a96c1fa (diff)
Simple debugging support for portable path.
Change-Id: Ibdc33b8d7f644c091fdb3ba3ce2ba45804bc4078
Diffstat (limited to 'src/compiler/codegen/MethodBitcode.cc')
-rw-r--r--src/compiler/codegen/MethodBitcode.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc
index f3ebf09ab1..1e81458dca 100644
--- a/src/compiler/codegen/MethodBitcode.cc
+++ b/src/compiler/codegen/MethodBitcode.cc
@@ -61,6 +61,17 @@ void defineValue(CompilationUnit* cUnit, llvm::Value* val, int sReg)
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 @@ bool methodBlockBitcodeConversion(CompilationUnit* cUnit, BasicBlock* bb)
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 @@ bool methodBitcodeBlockCodeGen(CompilationUnit* cUnit, llvm::BasicBlock* bb)
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: