1. 21 Aug, 2015 1 commit
  2. 19 Aug, 2015 1 commit
  3. 08 Apr, 2015 3 commits
  4. 07 Apr, 2015 9 commits
    • Benoit Lamarche's avatar
    • Benoit Lamarche's avatar
    • Benoit Lamarche's avatar
      Bump dx version to 1.11 · b3ee08c0
      Benoit Lamarche authored
      This version includes "Support --num-threads with --multi-dex"
      
      (cherry picked from commit 7d97556f)
      
      Change-Id: I712145094205d56358ef0b9ff51f137907d972e9
      b3ee08c0
    • Peter Jensen's avatar
      Fix potential dex index overflow in dx · 635aecf3
      Peter Jensen authored
      Revert change to dex rotation algorithm made as part of commit:
      845d9d0e
      
      Bug: https://code.google.com/p/android/issues/detail?id=161887
      
      Signed-off-by: default avatarPeter Jensen <jensenp@google.com>
      
      (cherry picked from commit d024c067)
      
      Change-Id: Iede742620854cef3542bf98b77e66aa8a305195e
      635aecf3
    • Peter Jensen's avatar
      Support --num-threads with --multi-dex (take 2) · bd3b381a
      Peter Jensen authored
      
        With fix for regression introduced in original commit.
      
      The current dx implementation supports options --multi-dex, for applications
      not fitting within the dex format limitations; and --num-threads=N, triggers
      concurrent processing of multiple input files. However, the implementation
      has the following limitations:
      
      The --num-threads option is disabled when used together with --multi-dex.
      The --num-threads option implements concurrency at the level of classpath
      entries, and does nothing when the classes to be translated are specified
      with a single classpath element (e.g. single jar output from Proguard).
      The existing --num-threads implementation may produce indeterministic output.
      The heuristic used by the --multi-dex option to determine when to rotate the
      dex output file is overly conservative.
      
      The primary objective of this change is:
      Concurrent translation of classes, independently of input specification format.
      Support --num-threads=N in both mono- and multi-dex mode.
      Deterministic class output order.
      Near optimal use of dex file format capacity.
      
      This is accomplished by reorganizing the dx workflow in a pipeline of
      concurrent phases.
      
      read-class  | parse-class | translate-class | add-to-dex | convert-dex-to-byte[];
      output-dex-files-or-jar
      
      To manage dex file rotation (i.e. --multi-dex support), the parse-class and
      add-to-dex phases are synchronized to prevent forwarding classes to the
      translate-class phase if it could potentially result in breaking the dex
      format limitations. The heuristic currently used to estimate the number of
      indices needed for a class is improved, to minimize the amount of serialization
      imposed by this feedback mechanism, and to improve the use of dex file capacity.
      
      The translate-class and convert-dex-to-byte[] phases are further parallelized
      with configurable (--num-threads=N option) thread pools. This allow translating
      classes concurrently, while also performing output conversion in parallel.
      Separate collector threads are used to collect results from the thread pools
      in deterministic order.
      
      Testing was performed on an Ubuntu system, with 6 cores and 12 hardware threads.
      The taskset command was used to experimentally establish that running with more
      than 8 hardware threads does not provide any additional benefit.
      
      Experiments shows that the argument to --num-threads should not exceed the
      lesser of the number of available hardware threads, and 5. Setting it to a
      higher value results in no additional benefit.
      
      The gain is generally larger for larger applications, and not significant for
      small applications with less than a few thousands classes. Experiments with
      generated classes shows that for large applications gains as high as 50% may
      be possible.
      
      For an existing real-life application with more than 11k classes, and requiring
      2 dex files, a speed-up of 37% was achieved (--num-threads=5, 8 hardware
      threads, 4g Java heap). A speedup of 31% was observed for another application
      with ~7 classes.
      
      For small applications, use of --num-threads=N>1 doesn’t provide significant
      benefit. Running with --num-threads=1, the modified dx is slightly faster,
      but no significant gain is observed unless the application requires multiple
      dex files.
      
      The one case where a significant regression may be observed is when using
      --num-threads=N>1, with a single hardware thread. This is an inappropriate
      configuration, even with the current implementation. However, because of
      the limitations of the current implementation, such configurations may exist.
      For instance, a configuration using both --multi-dex and --num-threads=5 will
      currently generate a warning about using the two options together. With the
      new implementation, the options can legitimately be used together, and could
      result in an ~20% regression running on a single hardware thread.
      Note: the current dx implementation, without --num-threads option, is already
      approximately 50% slower  with 1 hardware thread, compared to running with 2
      or more. With 2 hardware threads the implementations are practically at par
      (a little better, or a little worse, depending on the application).
      
      Testing:
      Tested with 6 existing applications ranging in size from 1K - 12K classes.
      Updated and tested with relevant existing unit tests (one test changed to
      account for better dex rotation heuristic).
      Added unit test to test deterministic output.
      Added unit performance test. By default run script merely validates that
      --multi-dex and --num-threads can be used together (fast). However, the test
      is configurable to perform performance test, over sets of generated classes.
      Signed-off-by: default avatarPeter Jensen <jensenp@google.com>
      
      (cherry picked from commit 845d9d0e)
      
      (cherry picked from commit dd140a22)
      
      Change-Id: I33a8ea0451efc0af7eb1d72e80cb926d6583d569
      bd3b381a
    • Narayan Kamath's avatar
      Don't discard directory entries in jar files. · 90fcf359
      Narayan Kamath authored
      This is a structural change, and breaks code that looks up
      directory resource names (icu4j for example).
      
      This change also includes a minor cosmetic change to use a
      while() loop instead of for(;;).
      
      bug: 19108324
      
      (cherry picked from commit 7736e8ff)
      
      Change-Id: Ifcbc60cc7808334cdfdd4f27bf137a8f6455117d
      90fcf359
    • Benoit Lamarche's avatar
      Do not keep the DexFile field in Main between runs · dff33a10
      Benoit Lamarche authored
      Bug: 18486731
      
      (cherry picked from commit bb404aa9)
      
      Change-Id: I048f6064cc49c78df21a1c42316761502a0a5366
      dff33a10
    • Csaba Kozák's avatar
      Command line option for disabling warnings · e345a356
      Csaba Kozák authored
      This commit adds a new command line option to dx:
      --no-warning.
      If the caller appends this to the arguments, dx won't print
      warnings to System.err. This can be useful if the user
      dexes external jars with old class format, so dx would
      print lot of warning about those.
      
      Bug: https://code.google.com/p/android/issues/detail?id=78285
      
      Signed-off-by: default avatarCsaba Kozák <kozakcsabi@gmail.com>
      
      (cherry picked from commit ef1de423)
      
      Change-Id: I6d09c684b5eb97aa28e0b12e3ef44b46293c7dec
      e345a356
    • Yohann Roussel's avatar
      Descriptor references are direct references · 008da7d4
      Yohann Roussel authored
      We have to parse descriptors and treat the types they reference as direct
      reference as we do for other direct type references. This is required because
      Dalvik verifier is checking those descriptor the same way as it does for other
      type references. See:
      https://android.googlesource.com/platform/dalvik/+/kitkat-mr2.2-release/vm/analysis/CodeVerify.cpp#637
      
      Bug: 19626444
      
      (cherry picked from commit 8f9fb34f)
      
      Change-Id: Ib9f43dd0c5f0b983fcc80e13caa13fd8b2dc2244
      008da7d4
  5. 22 Mar, 2015 1 commit
    • Yohann Roussel's avatar
      Allow to disable forced keep of annotated · 45e4d877
      Yohann Roussel authored
      We force all classes annotated with runtime annotation to be kept
      in the main dex list. This allow to workaround a Dalvik bug when
      accessing the annotations. But this increase the pressure in the
      main dex indexes. The new option is to allow to disable this
      workaround for application facing the index limit in their main
      dex and that don't access annotation at runtime or that have only
      annotations not subject to the resolution bug.
      
      Bug: 18928046
      Change-Id: Ibcd7e579a7fef3451ec8aeb266ea67514d82cd50
      45e4d877
  6. 02 Dec, 2014 1 commit
  7. 01 Dec, 2014 1 commit
  8. 21 Nov, 2014 1 commit
    • Jeff Sharkey's avatar
      Offer to exclude Zygote when converting heaps. · 3db80b57
      Jeff Sharkey authored
      Dumps from Android devices have multiple heaps, including Zygote,
      image, etc.  When investigating RAM usage, it's most useful to focus
      on "real" allocations from the app, ignoring the other heaps.
      
      This change introduces the "-z" flag which will drop allocations
      on non-app heaps during conversion.
      
      Bug: 18473132
      Change-Id: Ib1d5256b7bc4cfd7791f00c18a1cff920e0e3f46
      3db80b57
  9. 14 Nov, 2014 1 commit
    • Xavier Ducrohet's avatar
      Keep --input-list order. · 97479500
      Xavier Ducrohet authored
      Merging dex files starting with smaller ones can have
      a big impact on performance as it potentially reduces
      the number of compact events during the merge.
      
      Gradle will now send the list sorted in ascending order
      of file size, and dex should keep this order when parsing
      the input list file.
      
      Change-Id: Iff3ae4d30106fe70dca0764b33addfecceb84d09
      97479500
  10. 31 Oct, 2014 1 commit
  11. 09 Sep, 2014 4 commits
  12. 08 Sep, 2014 1 commit
  13. 04 Sep, 2014 1 commit
    • Ying Wang's avatar
      Add libcore src to the dx docs module. · 4de3efd5
      Ying Wang authored
      This fixed bogus docs build errors like:
      dalvik/dx/src/com/android/dx/io/DexIndexPrinter.java:19: error: package
      com.android.dex does not exist
      
      Change-Id: I3217a51c1562194974410c54f936c0713455a93c
      4de3efd5
  14. 05 Aug, 2014 1 commit
    • Brian Carlstrom's avatar
      Dalvik is dead, long live Dalvik! · 870b4f2d
      Brian Carlstrom authored
      croot
      cd dalvik
      repo start dalvik-is-dead-long-live-dalvik .
      repo sync -c .
      git rm -r README.txt
      git rm -r dexopt
      git rm -r tools/deadcode.py
      git rm -r tools/dex-preopt
      git rm -r tools/dexcheck
      git rm -r tools/gdbjithelper
      git rm -r unit-tests
      git rm -r vm
      git checkout HEAD vm/Common.h (needed by libdex)
      git checkout HEAD vm/DalvikVersion.h (needed by libdex)
      git checkout HEAD vm/Profile.h (needed by dmtracedump)
      git add Android.mk (after removing vm, dexopt, and unit-tests references)
      git commit -a -m 'Dalvik is dead, long live Dalvik!'
      
      Bug: 14298175
      Change-Id: I9dd13053677629d13496d4238af4374452cda415
      870b4f2d
  15. 29 Jul, 2014 1 commit
  16. 24 Jul, 2014 1 commit
  17. 25 Jul, 2014 1 commit
    • Yohann Roussel's avatar
      Do not generate empty dex in multidex. · 084b7f10
      Yohann Roussel authored
      This was possible when the first class considered for adding in a dex was too
      big to be sure it will fit. Now DX will try to add the class in the current dex
      and crash if the class causes one index to overflow.
      
      (cherry picked from commit f15dafe6)
      
      Change-Id: I323f8111c2be6bace908d0539ff324c4bd033c05
      084b7f10
  18. 23 Jul, 2014 1 commit
  19. 17 Jul, 2014 1 commit
  20. 21 Jul, 2014 2 commits
  21. 17 Jul, 2014 1 commit
  22. 16 Jul, 2014 1 commit
  23. 12 Jul, 2014 1 commit
  24. 11 Jul, 2014 2 commits
  25. 08 Jul, 2014 1 commit