diff options
author | 2018-10-11 10:44:58 +0100 | |
---|---|---|
committer | 2018-10-12 17:53:50 +0100 | |
commit | 78baed5ec51a6e2d113e8b29aafa5c6203b46845 (patch) | |
tree | 57ca544020f309e3529e33300ad4867ca4579c1e /runtime/interpreter/interpreter_common.cc | |
parent | a48eb7e0690187618d2824a7d9b5601e7f5cdf80 (diff) |
ART: Use reinterpret_cast{32,64}<> when appropriate.
And fix UnstartedRuntime checking for null arguments in all
functions where we now use reinterpret_cast32<>.
This is a follow-up to
https://android-review.googlesource.com/783607 .
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: m test-art-target-gtest
Test: testrunner.py --target --optimizing
Bug: 117427174
Change-Id: I58f8ad59f70e3fbb1d06aef419cd26555706fa65
Diffstat (limited to 'runtime/interpreter/interpreter_common.cc')
-rw-r--r-- | runtime/interpreter/interpreter_common.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 657772619c..60c8ef34b6 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -18,6 +18,7 @@ #include <cmath> +#include "base/casts.h" #include "base/enums.h" #include "class_root.h" #include "debugger.h" @@ -584,10 +585,10 @@ void SetStringInitValueToAllAliases(ShadowFrame* shadow_frame, for (uint32_t i = 0, e = shadow_frame->NumberOfVRegs(); i < e; ++i) { if (shadow_frame->GetVRegReference(i) == existing) { DCHECK_EQ(shadow_frame->GetVRegReference(i), - reinterpret_cast<mirror::Object*>(static_cast<uint32_t>(shadow_frame->GetVReg(i)))); + reinterpret_cast32<mirror::Object*>(shadow_frame->GetVReg(i))); shadow_frame->SetVRegReference(i, result.GetL()); DCHECK_EQ(shadow_frame->GetVRegReference(i), - reinterpret_cast<mirror::Object*>(static_cast<uint32_t>(shadow_frame->GetVReg(i)))); + reinterpret_cast32<mirror::Object*>(shadow_frame->GetVReg(i))); } } } @@ -1445,7 +1446,7 @@ static inline void AssignRegister(ShadowFrame* new_shadow_frame, const ShadowFra // If both register locations contains the same value, the register probably holds a reference. // Note: As an optimization, non-moving collectors leave a stale reference value // in the references array even after the original vreg was overwritten to a non-reference. - if (src_value == reinterpret_cast<uintptr_t>(o.Ptr())) { + if (src_value == reinterpret_cast32<uint32_t>(o.Ptr())) { new_shadow_frame->SetVRegReference(dest_reg, o); } else { new_shadow_frame->SetVReg(dest_reg, src_value); |