diff options
| author | 2015-08-11 17:39:37 -0700 | |
|---|---|---|
| committer | 2015-08-12 18:20:56 -0700 | |
| commit | 57b81ecbe74138992dd447251e94ed06cd5eb802 (patch) | |
| tree | ec855a19b35d41eb62ac653fde12a5b14cdc2988 /compiler/optimizing/nodes.h | |
| parent | 82b844fb449ddc5d7b4e43e71a55eb934a1b0b45 (diff) | |
Add support to indicate whether intrinsics require an environment
A structural change to indicate whether a given intrinsic requires
access to an environment. I added a field to HInvoke objects to indicate
if they need an environment whose default value is true and is only updated
if an intrinsic is marked as not requiring an environment. At this point
there is no functional change, as all intrinsics are marked as requiring
an environment. This change adds the structure for future inliner work
which will allow us to inline more intrinsified calls.
Change-Id: I2930e3cef7b785384bf95b95a542d34af442f3b9
Diffstat (limited to 'compiler/optimizing/nodes.h')
| -rw-r--r-- | compiler/optimizing/nodes.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index dba9233240..e6df429622 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2890,7 +2890,7 @@ class HDoubleConstant : public HConstant { }; enum class Intrinsics { -#define OPTIMIZING_INTRINSICS(Name, IsStatic) k ## Name, +#define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironment) k ## Name, #include "intrinsics_list.h" kNone, INTRINSICS_LIST(OPTIMIZING_INTRINSICS) @@ -2899,13 +2899,18 @@ enum class Intrinsics { }; std::ostream& operator<<(std::ostream& os, const Intrinsics& intrinsic); +enum IntrinsicNeedsEnvironment { + kNoEnvironment, // Intrinsic does not require an environment. + kNeedsEnvironment // Intrinsic requires an environment. +}; + class HInvoke : public HInstruction { public: size_t InputCount() const OVERRIDE { return inputs_.Size(); } // Runtime needs to walk the stack, so Dex -> Dex calls need to // know their environment. - bool NeedsEnvironment() const OVERRIDE { return true; } + bool NeedsEnvironment() const OVERRIDE { return needs_environment_ == kNeedsEnvironment; } void SetArgumentAt(size_t index, HInstruction* argument) { SetRawInputAt(index, argument); @@ -2930,8 +2935,9 @@ class HInvoke : public HInstruction { return intrinsic_; } - void SetIntrinsic(Intrinsics intrinsic) { + void SetIntrinsic(Intrinsics intrinsic, IntrinsicNeedsEnvironment needs_environment) { intrinsic_ = intrinsic; + needs_environment_ = needs_environment; } bool IsFromInlinedInvoke() const { @@ -2958,7 +2964,8 @@ class HInvoke : public HInstruction { dex_pc_(dex_pc), dex_method_index_(dex_method_index), original_invoke_type_(original_invoke_type), - intrinsic_(Intrinsics::kNone) { + intrinsic_(Intrinsics::kNone), + needs_environment_(kNeedsEnvironment) { uint32_t number_of_inputs = number_of_arguments + number_of_other_inputs; inputs_.SetSize(number_of_inputs); } @@ -2975,6 +2982,7 @@ class HInvoke : public HInstruction { const uint32_t dex_method_index_; const InvokeType original_invoke_type_; Intrinsics intrinsic_; + IntrinsicNeedsEnvironment needs_environment_; private: DISALLOW_COPY_AND_ASSIGN(HInvoke); |