Home | History | Annotate | Download | only in JIT

Lines Matching refs:Function

63 // This function returns true if F is fully read and is still a declaration.
64 static bool isNonGhostDeclaration(const Function *F) {
84 struct CallSiteValueMapConfig : public NoRAUWValueMapConfig<Function*> {
86 static void onDelete(JITResolverState *JRS, Function *F);
91 typedef ValueMap<Function*, void*, NoRAUWValueMapConfig<Function*> >
93 typedef std::map<void*, AssertingVH<Function> > CallSiteToFunctionMapTy;
94 typedef ValueMap<Function *, SmallPtrSet<void*, 1>,
99 /// particular function so that we can reuse them if necessary.
102 /// CallSiteToFunctionMap - Keep track of the function that each lazy call
135 std::pair<void *, Function *> LookupFunctionFromCallSite(
150 void AddCallSite(const MutexGuard &locked, void *CallSite, Function *F) {
160 void EraseAllCallSitesForPrelocked(Function *F);
162 // Erases _all_ call sites regardless of their function. This is used to
175 /// LazyResolverFn - The target lazy resolver function that we actually
205 /// getLazyFunctionStubIfAvailable - This returns a pointer to a function's
207 void *getLazyFunctionStubIfAvailable(Function *F);
209 /// getLazyFunctionStub - This returns a pointer to a function's
211 void *getLazyFunctionStub(Function *F);
213 /// getExternalFunctionStub - Return a stub for the function at the
222 /// an address. This function only manages slots, it does not manage the
226 /// JITCompilerFn - This function is called to resolve a stub to a compiled
227 /// address. If the LLVM Function corresponding to the stub has not yet
228 /// been compiled, this function compiles it first.
286 // When outputting a function stub in the context of some other function, we
290 // When reattempting to JIT a function after running out of space, we store
291 // the estimated size of the function we're trying to JIT here, so we can
293 // successfully emit the function, we reset this back to zero.
296 /// Relocations - These are the relocations that the function needs, as
305 /// ConstantPool - The constant pool for the current function.
317 /// JumpTable - The jump tables for the current function.
338 // CurFn - The llvm function being emitted. Only valid during
340 const Function *CurFn;
348 void *FunctionBody; // Beginning of the function's allocation.
349 void *Code; // The address the function's code actually starts at.
353 struct EmittedFunctionConfig : public ValueMapConfig<const Function*> {
355 static void onDelete(JITEmitter *, const Function*);
356 static void onRAUW(JITEmitter *, const Function*, const Function*);
358 ValueMap<const Function *, EmittedCode,
410 /// because a global may live longer than the current function.
438 /// given function. Increase the minimum allocation size so that we get
443 /// function body.
444 void deallocateMemForFunction(const Function *F);
473 void CallSiteValueMapConfig::onDelete(JITResolverState *JRS, Function *F) {
477 void JITResolverState::EraseAllCallSitesForPrelocked(Function *F) {
487 assert(Erased && "Missing call site->function mapping");
510 /// getLazyFunctionStubIfAvailable - This returns a pointer to a function stub
512 void *JITResolver::getLazyFunctionStubIfAvailable(Function *F) {
515 // If we already have a stub for this function, recycle it.
519 /// getFunctionStub - This returns a pointer to a function stub, creating
521 void *JITResolver::getLazyFunctionStub(Function *F) {
524 // If we already have a lazy stub for this function, recycle it.
528 // Call the lazy resolver function if we are JIT'ing lazily. Otherwise we
546 // external function, if it was resolved.
551 // If we are getting the stub for an external function, we really want the
553 // of the external function.
557 DEBUG(dbgs() << "JIT: Lazy stub emitted at [" << Stub << "] for function '"
565 // Finally, keep track of the stub-to-Function mapping so that the
566 // JITCompilerFn knows which function to compile!
569 // If we are JIT'ing non-lazily but need to call a function that does not
599 /// getExternalFunctionStub - Return a stub for the function at the
602 // If we already have a stub for this function, recycle it.
612 << "] for external function at '" << FnAddr << "'\n");
627 /// JITCompilerFn - This function is called when a lazy compilation stub has
628 /// been entered. It looks up which function this stub corresponds to, compiles
629 /// it if necessary, then returns the resultant function pointer.
634 Function* F = 0;
638 // Only lock for getting the Function. The call getPointerToFunction made
639 // in this function might trigger function materializing, which requires
645 std::pair<void*, Function*> I =
651 // If we have already code generated the function, just return the address.
660 " function '"
664 DEBUG(dbgs() << "JIT: Lazily resolving function '" << F->getName()
677 // lock above. As soon as the 1st function finishes compiling the function,
678 // the next one will be released, and needs to be able to find the function it
683 // What we will do is set the compiled function address to map to the
705 // If we have already compiled the function, return a pointer to its body.
706 Function *F = cast<Function>(V);
710 // Return the function stub if it's already created. We do this first so
711 // that we're returning the same address for the function as any previous
724 // If this is an external function pointer, we can force the JIT to
777 DEBUG(dbgs() << "JIT: Starting CodeGen of Function "
801 // About to start emitting the machine code for the function.
825 // other per-function data.
829 // FnEnd is the end of the function's machine code.
847 // If the target REALLY wants a stub for this function, emit it now.
909 // Now that we've succeeded in emitting the function, reset the
927 << "] Function: " << F.getName()
1023 /// function body. Also drop any references the function has to stubs.
1024 /// May be called while the Function is being destroyed inside ~Value().
1025 void JITEmitter::deallocateMemForFunction(const Function *F) {
1026 ValueMap<const Function *, EmittedCode, EmittedFunctionConfig>::iterator
1244 JITEmitter *Emitter, const Function *F) {
1248 JITEmitter *, const Function*, const Function*) {
1263 // getPointerToFunctionOrStub - If the specified function has been
1264 // code-gen'd, return a pointer to the function. If not, compile it, or use
1267 void *JIT::getPointerToFunctionOrStub(Function *F) {
1268 // If we have already code generated the function, just return the address.
1277 void JIT::updateFunctionStub(Function *F) {
1282 assert(Addr != Stub && "Function must have non-stub address to be updated.");
1292 /// freeMachineCodeForFunction - release machine code memory for given Function.
1294 void JIT::freeMachineCodeForFunction(Function *F) {
1299 // Free the actual memory for the function body and related stuff.