Replace REQ_RETRANSLATE_OPT with a regular C++ call via ustub
[hiphop-php.git] / hphp / runtime / vm / jit / service-request-handlers.h
blob0f01eec4bdc89cb07251ce3b62810a7d83a1ec1f
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #pragma once
19 #include "hphp/runtime/vm/jit/service-requests.h"
20 #include "hphp/runtime/vm/jit/types.h"
22 namespace HPHP {
24 struct ActRec;
25 struct SrcKey;
27 namespace jit {
29 struct ReqInfo;
31 namespace svcreq {
34 * Handle a service request.
36 * This often involves looking up or creating a translation, smashing a jmp
37 * target or other address in the code, and returning the smashed-in value.
38 * This address indicates where the caller should resume execution.
40 TCA handleServiceRequest(ReqInfo& info) noexcept;
43 * Handle a request to retranslate the current function, leveraging profiling
44 * data to produce a set of larger, more optimized translations. Only used when
45 * PGO is enabled. Execution will resume at `bcOff' whether or not retranslation
46 * is successful.
48 TCA handleRetranslateOpt(Offset bcOff, SBInvOffset spOff) noexcept;
51 * Handle a situation where the translated code in the TC executes a return
52 * for a frame that was pushed by the interpreter, i.e. there is no TCA to
53 * return to.
55 TCA handlePostInterpRet(uint32_t callOffAndFlags) noexcept;
58 * Handle a bindcall request---i.e., look up (or create) the appropriate func
59 * prologue for `func' and `numArgs', then smash the call instruction
60 * at `toSmash'.
62 * If we can't find or make a translation, may return fcallHelperThunk instead,
63 * which uses C++ helpers to act like a prologue.
65 TCA handleBindCall(TCA toSmash, Func* func, int32_t numArgs);
68 * Look up (or create) and return the address of a translation for the current
69 * VM location.
71 * If no translation can be found or created, execute code in the interpreter
72 * until we find one, possibly throwing exceptions or reentering the VM.
74 * If `interpFirst' is true, at least one basic block will be interpreted
75 * before attempting to look up a translation. This is necessary to ensure
76 * forward progress in certain situations, such as hitting the translation
77 * limit for a SrcKey.
79 TCA handleResume(bool interpFirst);
80 TCA handleResumeNoTranslate(bool interpFirst);
83 * Look up (or create) the translation for the body of func.
85 TCA getFuncBody(const Func* func);
87 }}}