[vmkit-commits] [vmkit] r91451 - in /vmkit/trunk: include/mvm/MethodInfo.h lib/Mvm/Runtime/MethodInfo.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue Dec 15 13:02:34 PST 2009
Author: geoffray
Date: Tue Dec 15 15:02:34 2009
New Revision: 91451
URL: http://llvm.org/viewvc/llvm-project?rev=91451&view=rev
Log:
Get the CamlFrame of a statically generated function only when needed.
Modified:
vmkit/trunk/include/mvm/MethodInfo.h
vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp
Modified: vmkit/trunk/include/mvm/MethodInfo.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/MethodInfo.h?rev=91451&r1=91450&r2=91451&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/MethodInfo.h (original)
+++ vmkit/trunk/include/mvm/MethodInfo.h Tue Dec 15 15:02:34 2009
@@ -32,7 +32,7 @@
}
unsigned MethodType;
-
+ void* InstructionPointer;
};
class CamlFrame {
Modified: vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp?rev=91451&r1=91450&r2=91451&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp (original)
+++ vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Tue Dec 15 15:02:34 2009
@@ -22,6 +22,13 @@
using namespace mvm;
void CamlMethodInfo::scan(void* TL, void* ip, void* addr) {
+ if (!CF && InstructionPointer) {
+ MethodInfo* MI = VirtualMachine::SharedStaticFunctions.IPToMethodInfo(ip);
+ if (MI != &DefaultMethodInfo::DM) {
+ CF = ((CamlMethodInfo*)MI)->CF;
+ }
+ }
+
if (CF) {
//uintptr_t spaddr = (uintptr_t)addr + CF->FrameSize + sizeof(void*);
uintptr_t spaddr = ((uintptr_t*)addr)[0];
@@ -132,12 +139,7 @@
}
CamlMethodInfo::CamlMethodInfo(CamlFrame* C, void* ip) {
- if (!C) {
- MethodInfo* MI = VirtualMachine::SharedStaticFunctions.IPToMethodInfo(ip);
- if (MI != &DefaultMethodInfo::DM) {
- C = ((CamlMethodInfo*)MI)->CF;
- }
- }
+ InstructionPointer = ip;
CF = C;
}
More information about the vmkit-commits
mailing list