From 78baed5ec51a6e2d113e8b29aafa5c6203b46845 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 11 Oct 2018 10:44:58 +0100 Subject: 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 --- runtime/interpreter/interpreter_common.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/interpreter/interpreter_common.cc') 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 +#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(static_cast(shadow_frame->GetVReg(i)))); + reinterpret_cast32(shadow_frame->GetVReg(i))); shadow_frame->SetVRegReference(i, result.GetL()); DCHECK_EQ(shadow_frame->GetVRegReference(i), - reinterpret_cast(static_cast(shadow_frame->GetVReg(i)))); + reinterpret_cast32(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(o.Ptr())) { + if (src_value == reinterpret_cast32(o.Ptr())) { new_shadow_frame->SetVRegReference(dest_reg, o); } else { new_shadow_frame->SetVReg(dest_reg, src_value); -- cgit v1.2.3-59-g8ed1b