Index: vmcore/include/jit_export.h =================================================================== --- vmcore/include/jit_export.h (revision 478769) +++ vmcore/include/jit_export.h (working copy) @@ -176,6 +176,11 @@ */ Boolean exe_restore_context_after_unwind : 1; + /** + * Sent CompileMethodLoad event when a method is compiled and loaded into memory + */ + Boolean exe_notify_compile_method_load : 1; + } OpenMethodExecutionParams; Index: vmcore/src/jit/compile.cpp =================================================================== --- vmcore/src/jit/compile.cpp (revision 478769) +++ vmcore/src/jit/compile.cpp (working copy) @@ -961,4 +961,11 @@ } } +VMEXPORT void compile_method_load(Method_Handle method, uint32 codeSize, + void* codeAddr, uint32 mapLength, + AddrLocation* addrLocationMap, + void* compileInfo, Method_Handle outer_method) +{ +} + ////////////////////////////////////////////////////////////////////////// Index: jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp =================================================================== --- jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp (revision 478769) +++ jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp (working copy) @@ -134,7 +134,7 @@ }; class CompiledMethodInfo { public: - CompiledMethodInfo(MemoryManager& mm): locationList(mm) {} + CompiledMethodInfo(MemoryManager& mm): locationList(mm), codeSize(0) {} uint32 getCodeSize() { return codeSize; } void* getCodeAddr() { return codeAddr; } @@ -143,6 +143,7 @@ StlList* > locationList; uint32 codeSize; void* codeAddr; + void addCodeSize(uint32 size) { codeSize+= size; } void setCodeSize(uint32 size) { codeSize = size; } void setCodeAddr(void* addr) { codeAddr = addr; } void addLocation(std::pair* entry) { @@ -348,7 +349,12 @@ uint8 * blockStartIp = ip; bb->setCodeOffset( blockStartIp-codeStreamStart ); for (Inst* inst = (Inst*)bb->getFirstInst(); inst!=NULL; inst = inst->getNextInst()) { - if( inst->hasKind(Inst::Kind_PseudoInst)) continue; + if( inst->hasKind(Inst::Kind_PseudoInst)) { + + uint8 * instStartIp = ip; + inst->setCodeOffset( instStartIp-blockStartIp ); + continue; + } #ifdef _EM64T_ if (inst->hasKind(Inst::Kind_ControlTransferInst) && @@ -688,12 +694,6 @@ methMarkerInst = (MethodMarkerPseudoInst*)inst; assert(((MethodMarkerPseudoInst*)inlineStack.back())->getMethodDesc() == methMarkerInst->getMethodDesc()); entryExitMap[methMarkerInst] = inlineStack.back(); - if (methInfo != NULL) { - Inst* entryInst = inlineStack.back(); - POINTER_SIZE_INT codeSize = (POINTER_SIZE_INT)entryInst->getCodeStartAddr() - - (POINTER_SIZE_INT)methMarkerInst->getCodeStartAddr(); - methInfo->setCodeSize((uint32)codeSize); - } inlineStack.pop_back(); methMarkerInst = NULL; } else { //handle usual instructions @@ -701,6 +701,7 @@ assert(methInfo == methodLocationMap[methMarkerInst]); uint64 instID = inst->getId(); uint64 bcOffset = bc2LIRMapHandler->getVectorEntry(instID); + methInfo->addCodeSize(inst->getCodeSize()); if (bcOffset != ILLEGAL_VALUE) { POINTER_SIZE_INT instStartAddr = (POINTER_SIZE_INT) inst->getCodeStartAddr(); Index: jitrino/src/vm/drl/DrlVMInterface.cpp =================================================================== --- jitrino/src/vm/drl/DrlVMInterface.cpp (revision 478769) +++ jitrino/src/vm/drl/DrlVMInterface.cpp (working copy) @@ -987,14 +987,11 @@ void DrlVMCompilationInterface::sendCompiledMethodLoadEvent(MethodDesc * methodDesc, uint32 codeSize, void* codeAddr, uint32 mapLength, AddrLocation* addrLocationMap, void* compileInfo) { - // VM-JIT interface function should be called here instead of logging - if (Log::isEnabled()) { - Log::out() << " ** Inlined method: " - << methodDesc->getName() << std::endl; - Log::out() << " ** Number of locations:" << mapLength - << std::endl; - } - + + Method_Handle method = (Method_Handle)getRuntimeMethodHandle(methodDesc); + Method_Handle outer = (Method_Handle)getRuntimeMethodHandle(getMethodToCompile()); + + compile_method_load(method, codeSize, codeAddr, mapLength, addrLocationMap, compileInfo, outer); } bool DrlVMDataInterface::areReferencesCompressed() { Index: jitrino/src/vm/drl/DrlJITInterface.cpp =================================================================== --- jitrino/src/vm/drl/DrlJITInterface.cpp (revision 478769) +++ jitrino/src/vm/drl/DrlJITInterface.cpp (working copy) @@ -327,6 +327,9 @@ false, // exe_do_code_mapping false, // exe_do_local_var_mapping false, // exe_insert_write_barriers + false, // exe_provide_access_to_this + false, // exe_restore_context_after_unwind + false, // exe_notify_compile_method_load }; return compilation_capabilities; } Index: jitrino/src/vm/drl/DrlVMInterface.h =================================================================== --- jitrino/src/vm/drl/DrlVMInterface.h (revision 478769) +++ jitrino/src/vm/drl/DrlVMInterface.h (working copy) @@ -546,8 +546,7 @@ } bool isCompileLoadEventRequired() { - // additional compilation param is needed to handle this event - return false; + return compilation_params.exe_notify_compile_method_load; } virtual void sendCompiledMethodLoadEvent(MethodDesc * methodDesc, Index: jitrino/src/vm/VMInterface.h =================================================================== --- jitrino/src/vm/VMInterface.h (revision 478769) +++ jitrino/src/vm/VMInterface.h (working copy) @@ -31,6 +31,7 @@ #include "open/types.h" #include "jit_export.h" +#include "jit_intf.h" #include #include #include "PlatformDependant.h" @@ -49,7 +50,6 @@ class PersistentInstructionId; class MemoryManager; class CompilationContext; -struct AddrLocation; /////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////// @@ -564,12 +564,6 @@ CompilationContext* compilationContext; }; -// AddrLocation data structure should be put in VM-JIT interface -struct AddrLocation { - void* start_addr; - uint16 location; -}; - class DataInterface { public: virtual ~DataInterface() {}