1. 10 Dec, 2017 7 commits
  2. 09 Dec, 2017 2 commits
    • Eric Bruneton's avatar
    • Eric Bruneton's avatar
      Improve the code quality of Label and add a Constants interface for internal constants. · 617f4f38
      Eric Bruneton authored
      In more details:
      - add a Constants interface to avoid some magic constants in the code
      - remove the INSTRUCTION_TYPES indirection in ClassReader, and use (table)switch statements on raw opcode values instead
      - remove unnecessary flags BASIC_BLOCK_CHANGED, VISITED and VISITED2 in Label (replaced with a simpler algorithm using an EMPTY_LIST sentinel), as well as the redundant STORE flag
      - add an otherLineNumbers field in Label to store line numbers in a cleaner way than with nextChangedBlock
      - remove the inputStackTop field in Label, which was used to store different values depending on the compute options or basic block types. Replace it with new inputStackSize and outputStackSize fields in Label, and a new (private) outputStackStart field in Frame.
      - use 'short' fields when possible in Frame and Label. Object size in memory with OpenJDK 1.8.0, measured with https://www.javaworld.com/article/2077496/testing-debugging/java-tip-130--do-you-know-your-data-size-.html, decreased from 64 to 56 bytes for Label (despite the added fields), and stayed unchanged (48 bytes) for Frame (despite the added field outputStackStart).
      - split the large visitMaxs method in two smaller methods.
      - performance is unchanged or improved: 1.02-1.04 speedup for ClassReader, no change for ClassReader+ClassWriter, 1.11 speedup for CR+CW with compute maxs, 1.05 speedup for CR+CW with compute frames.
      617f4f38
  3. 03 Dec, 2017 2 commits
  4. 26 Nov, 2017 4 commits
  5. 25 Nov, 2017 7 commits
  6. 19 Nov, 2017 2 commits
  7. 14 Nov, 2017 5 commits
  8. 12 Nov, 2017 3 commits
  9. 01 Nov, 2017 5 commits
  10. 31 Oct, 2017 3 commits
    • Eric Bruneton's avatar
      Improve the code quality of Item and of related code in ClassWriter and ClassReader. · 7e7842b5
      Eric Bruneton authored
      - Item was a mutable class with many set* methods, used to set predefined Item key instances in ClassWriter, to perform lookups (while avoiding the creation of new instances for this). These preallocated keys were error prone, due to the nested calls (a nested call could inadvertently modify the key used by a caller).
      - The Javadoc was largely obsolete, refering mostly to the constant pool, while Item was also used for bootstrap methods and for the ASM specific type table.
      - The number of elements in ClassWriter#items was poorly tracked, for instance bootstrap methods were not taken into account in ClassWriter#put.
      - The threshold to limit hash collisions was not always respected (for instance in copyPool, items was created with a size equal to the constant pool count, without margin).
      - Lookups in ClassWriter#get were not optimal: a check on hashcode could be used before calling the expensive isEqualTo method.
      
      Now Item is replaced with Symbol, which is immutable (except for the lazily computed info field). Also the hashCode and next fields are hidden in a private subclass (they are only used inside SymbolTable).
      The preallocated Item key, key2, ... fields are removed, while keeping the zero allocation property for lookups.
      The number of elements in entries is now explicitely tracked with entryCount, and the threshold is correctly used.
      Lookups are now optimized to do a quick hashcode comparison before slow equality tests.
      All Symbol management is now done is a separate SymbolTable class, allowing a cleaner implementation for the copyPool option (more private fields, less exposure of internal details to other classes).
      
      According to performance tests using benchmarks/read-write, this new code is slightly faster than before (e.g. ~1.05 speedup for R+W with or without copyPool).
      The jar size is now 99581 bytes vs 95209 for ASM 6.0.
      7e7842b5
    • Eric Bruneton's avatar
      Ignore the files generated by Eclipse. · aa6c7002
      Eric Bruneton authored
      aa6c7002
    • Eric Bruneton's avatar
      Merge branch 'fix-javadoc' · 48f0e02e
      Eric Bruneton authored
      48f0e02e