2 +----------------------------------------------------------------------+
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 #ifndef incl_HPHP_NORMALIZED_INSTRUCTION_H_
18 #define incl_HPHP_NORMALIZED_INSTRUCTION_H_
23 #include "hphp/runtime/vm/jit/containers.h"
24 #include "hphp/runtime/vm/bytecode.h"
25 #include "hphp/runtime/vm/srckey.h"
26 #include "hphp/runtime/vm/jit/translator.h"
27 #include "hphp/runtime/vm/jit/type.h"
29 namespace HPHP
{ namespace jit
{
30 ///////////////////////////////////////////////////////////////////////////////
33 * A NormalizedInstruction contains information about a decoded bytecode
34 * instruction, including the unit it lives in, decoded immediates, and a few
35 * flags of interest the various parts of the jit.
37 struct NormalizedInstruction
{
39 const Func
* funcd
; // The Func in the topmost AR on the stack. Guaranteed to
40 // be accurate. Don't guess about this. Note that this is
41 // *not* the function whose body the NI belongs to.
42 // Note that for an FPush* may be set to the (statically
43 // known Func* that /this/ instruction is pushing)
46 ArgUnion imm
[kMaxHhbcImms
];
47 ImmVector immVec
; // vector immediate; will have !isValid() if the
48 // instruction has no vector immediate
52 bool ignoreInnerType
:1;
55 * Used with HHIR. Instruction shoud be interpreted, because previous attempt
56 * to translate it has failed.
59 // The inst can be marked so that later on we emit a surprise check
61 bool forceSurpriseCheck
:1;
65 const Unit
* unit() const;
66 const Func
* func() const;
67 Offset
offset() const;
68 SrcKey
nextSk() const;
70 NormalizedInstruction();
71 NormalizedInstruction(SrcKey
, const Unit
*);
72 ~NormalizedInstruction();
74 std::string
toString() const;
77 ///////////////////////////////////////////////////////////////////////////////