summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/mir_to_lir.cc
diff options
context:
space:
mode:
authorRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2014-08-04 09:38:46 -0700
committerRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2014-08-20 17:42:10 +0000
commit7642324bc8a5c839c669aebbb1fba61c05418651 (patch)
tree1abf21ecf589c62c47ba320bf35d00bbff7d4e97 /compiler/dex/quick/mir_to_lir.cc
parent07277a700cdc7de2f40773a05c7a791b71abd581 (diff)
downloadart-7642324bc8a5c839c669aebbb1fba61c05418651.tar.gz
art-7642324bc8a5c839c669aebbb1fba61c05418651.tar.bz2
art-7642324bc8a5c839c669aebbb1fba61c05418651.zip
ART: Implement kMirOpNullCheck
The semantics of kMirOpNullCheck is to check object for null and throw exception in that case. However, the implementation for it is empty. This has been changed and appropriate dataflow have been added to correctly reflect behavior. In order to allow testing of implementation, the SpecialMethodInliner has been updated to get rid of invoke and use this instead. This helps all optimizations which do not check the MIR_INLINED flag because when invoke is left in, they believe that invoke will still be done. Change-Id: I62e425e42bdbc6357246fb949db5f79de73cf358 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Diffstat (limited to 'compiler/dex/quick/mir_to_lir.cc')
-rw-r--r--compiler/dex/quick/mir_to_lir.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/dex/quick/mir_to_lir.cc b/compiler/dex/quick/mir_to_lir.cc
index e5190118eb..c4dfcb99d2 100644
--- a/compiler/dex/quick/mir_to_lir.cc
+++ b/compiler/dex/quick/mir_to_lir.cc
@@ -1077,9 +1077,17 @@ void Mir2Lir::HandleExtendedMethodMIR(BasicBlock* bb, MIR* mir) {
case kMirOpSelect:
GenSelect(bb, mir);
break;
+ case kMirOpNullCheck: {
+ RegLocation rl_obj = mir_graph_->GetSrc(mir, 0);
+ rl_obj = LoadValue(rl_obj, kRefReg);
+ // An explicit check is done because it is not expected that when this is used,
+ // that it will actually trip up the implicit checks (since an invalid access
+ // is needed on the null object).
+ GenExplicitNullCheck(rl_obj.reg, mir->optimization_flags);
+ break;
+ }
case kMirOpPhi:
case kMirOpNop:
- case kMirOpNullCheck:
case kMirOpRangeCheck:
case kMirOpDivZeroCheck:
case kMirOpCheck: