Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement AR transformation variant that uses Atomic classes without field updaters #17

Open
elizarov opened this issue Aug 13, 2018 · 6 comments

Comments

@elizarov
Copy link
Contributor

elizarov commented Aug 13, 2018

We need to implement a new transformation variant AR (in addition to existing FU and VH variants) that would transform classes using atomic objects to java.util.concurrent.Atomic* classes without using *FieldUpdater classes. The behavior of the (default) BOTH variant is to be decided later. See discussion in Kotlin/kotlinx.coroutines#490 on why this is needed and what should be the default.

@elizarov elizarov changed the title Implement AR transformation variant that uses Atomic* classes Implement AR transformation variant that uses Atomic classes without field updaters Aug 13, 2018
@elizarov
Copy link
Contributor Author

The decision is that we introduce a separate AR variant and leave BOTH working as it is now.

@elizarov
Copy link
Contributor Author

(On hold for now, until we figure out how to reproduce original problem)

@xBlackCat
Copy link

Any updates for the two-years-old issue?

@qwwdfsad
Copy link
Collaborator

It's unlikely we are going to implement regular atomics transformation. The number of "bugged" devices in use is reducing each year and without them, such change has no benefits, only maintenance burden.

Additionally, we have to investigate the current state of Android multi-release JAR support

@JakeWharton
Copy link

The Android toolchain currently ignores MR jar classes as of sometime in the AGP 3.x series (~2-3 years ago).

@elizarov
Copy link
Contributor Author

MR jars allow use to use BOTH strategy by default:

  • FU variant by for Androind and JDK <= 8
  • VH variant for JDK >= 9

However, I don't immeditely see how it helps with AR (Updater-less) transformation variant. Let's brainstorm. Is it somehow possible via ProGuard/R8 to ask for a class file replacement under specific circumstances (e.g for a specific range of min API versions). If that were possible, then we could implement AR variant, package these classes into some "normally hidden" place and ask Android toolchain to use them instead of FU variants when building DEX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants