Remove the `CanTriggerGC` side-effects on a few instructions. The side-effect was specified for these instructions as they call runtime. We now have a list of entrypoints that we know cannot trigger GC. We can avoid requiring the side-effect for those. Test: Run ART test suite on Nexus 5X and host. Change-Id: I0e0e6a4d701ce6c75aff486cb0d1bc7fe2e8dda4
diff --git a/runtime/entrypoints/quick/quick_entrypoints_enum.cc b/runtime/entrypoints/quick/quick_entrypoints_enum.cc index 7b80af6..81f152b 100644 --- a/runtime/entrypoints/quick/quick_entrypoints_enum.cc +++ b/runtime/entrypoints/quick/quick_entrypoints_enum.cc
@@ -71,4 +71,55 @@ } } +bool EntrypointCanTriggerGC(QuickEntrypointEnum entrypoint) { + switch (entrypoint) { + // Listed in the same order as in quick_entrypoints_list.h. + case kQuickCmpgDouble: + case kQuickCmpgFloat: + case kQuickCmplDouble: + case kQuickCmplFloat: + case kQuickCos: + case kQuickSin: + case kQuickAcos: + case kQuickAsin: + case kQuickAtan: + case kQuickAtan2: + case kQuickCbrt: + case kQuickCosh: + case kQuickExp: + case kQuickExpm1: + case kQuickHypot: + case kQuickLog: + case kQuickLog10: + case kQuickNextAfter: + case kQuickSinh: + case kQuickTan: + case kQuickTanh: + case kQuickFmod: + case kQuickL2d: + case kQuickFmodf: + case kQuickL2f: + case kQuickD2iz: + case kQuickF2iz: + case kQuickIdivmod: + case kQuickD2l: + case kQuickF2l: + case kQuickLdiv: + case kQuickLmod: + case kQuickLmul: + case kQuickShlLong: + case kQuickShrLong: + case kQuickUshrLong: + return false; + + /* Used by mips for 64bit volatile load/stores. */ + case kQuickA64Load: + case kQuickA64Store: + return false; + + default: + return true; + } +} + } // namespace art
diff --git a/runtime/entrypoints/quick/quick_entrypoints_enum.h b/runtime/entrypoints/quick/quick_entrypoints_enum.h index 7674873..abf2c34 100644 --- a/runtime/entrypoints/quick/quick_entrypoints_enum.h +++ b/runtime/entrypoints/quick/quick_entrypoints_enum.h
@@ -63,6 +63,7 @@ #undef ENTRYPOINT_ENUM bool EntrypointRequiresStackMap(QuickEntrypointEnum trampoline); +bool EntrypointCanTriggerGC(QuickEntrypointEnum entrypoint); } // namespace art