Jasm

Post modern age integration focused jvm bytecode assembler

Stars
54
Jasm - 2.4.0 Latest Release

Published by Col-E 8 months ago

What's new

  • WIP Dalvik AST model
    • Not intended for use just yet as things are not fully fleshed out, but if you're curious it is there
  • Changes Compiler result from ClassRepresentation to ClassResult which will hold analysis data even if a full ClassRepresentation could not be built
    • This allows getting partial analysis data even if there were build problems
    • Before, analysis data required the class be fully buildable in order to access
  • AST to CodeElement and CodeElement to AST lookups in AnalysisResults
    • Pairs will with the prior change above with partial builds
    • Allows easy look-ups of compilation mappings without having to do a lot of work yourself
  • Shortcuts for common invokedynamic bootstrap methods
    • LambdaMetaFactory.metafactory -> java.lang.invoke.LambdaMetafactory.metafactory(MethodHandles.Lookup, String, MethodType, MethodType, MethodHandle, MethodType)
    • LambdaMetaFactory.altMetafactory -> java.lang.invoke.LambdaMetafactory.altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)
    • ConstantBootstraps.nullConstant -> java.lang.invoke.ConstantBootstraps.nullConstant(MethodHandles.Lookup, String, Class)
    • ConstantBootstraps.primitiveClass -> java.lang.invoke.ConstantBootstraps.primitiveClass(MethodHandles.Lookup, String, Class)
    • ConstantBootstraps.enumConstant -> java.lang.invoke.ConstantBootstraps.enumConstant(MethodHandles.Lookup, String, Class)
    • ConstantBootstraps.getStaticFinal -> java.lang.invoke.ConstantBootstraps.getStaticFinal(MethodHandles.Lookup, String, Class, Class)
    • ConstantBootstraps.invoke -> java.lang.invoke.ConstantBootstraps.invoke(MethodHandles.Lookup, String, Class, MethodHandle, Object...)
    • ConstantBootstraps.fieldVarHandle -> java.lang.invoke.ConstantBootstraps.fieldVarHandle(MethodHandles.Lookup, String, Class, Class, Class)
    • ConstantBootstraps.staticFieldVarHandle -> java.lang.invoke.ConstantBootstraps.staticFieldVarHandle(MethodHandles.Lookup, String, Class, Class, Class)
    • ConstantBootstraps.arrayVarHandle -> java.lang.invoke.ConstantBootstraps.arrayVarHandle(MethodHandles.Lookup, String, Class, Class)
    • ConstantBootstraps.explicitCast -> java.lang.invoke.ConstantBootstraps.explicitCast(MethodHandles.Lookup, String, Class, Object)
    • SwitchBootstraps.enumSwitch -> java.lang.runtime.SwitchBootstraps.enumSwitch(MethodHandles.Lookup, String, MethodType, Object...)
    • SwitchBootstraps.stringSwitch -> java.lang.runtime.SwitchBootstraps.typeSwitch(MethodHandles.Lookup, String, MethodType, Object...)
    • ObjectMethods.bootstrap -> java.lang.runtime.ObjectMethods.bootstrap(MethodHandles.Lookup, String, TypeDescriptor, Class, String, MethodHandle...)
  • Field and method descriptors are now verified for correct formatting
  • More supported values in the provided BasicMethodValueLookup (which got moved to a new package)
  • Value lookups for fields/methods are only attempted when value content is known

What's Fixed

  • Tokenizer associating tokens with wrong column
  • OOBE when printing a virtual method with no parameters
  • Unintended breakage of annotation path selection in CompilerOptions
  • ASTElement.range() yielding unexpected positions due to unsorted children
  • Missing special case handling for numbers (NaN and the like)
  • Incorrectly creating additional parameters when disassembling methods with wide-type parameters
  • Many analysis engine problems
    • nop, arraylength, *aload and *astore instructions not being implemented
    • anewarray not popping array size off the stack
    • checkcase not changing the value type on the stack
    • Value analysis truncating small floats and doubles
    • Analysis engine errors not being reported in the common error collector system
    • Revisiting control flow would not merge frames, but overwrite them with the last visited iteration
    • Jump target frames being put at the wrong index
    • Unmatched push and pop in a variety of stack-manipulating and math instructions
    • Incorrect handling of frame merging for terminal instructions
    • Incorrect printing of annotation enum values
    • Incorrect printing of annotation class values
    • Unexpected re-ordering of annotation values
    • Missing char/special-case-number support for annotation values

Full Changelog: https://github.com/jumanji144/Jasm/compare/2.3.0...2.4.0

Jasm - 2.3.0-beta pre release

Published by Col-E 11 months ago

What's Changed

  • ASTElement will no longer have null children
  • ASTElement children are sorted by position
  • ASTElement.range() will now consider children
  • ASTMethod now has children: modifiers, exception, code
    • Fixes its range() computation
  • Fixes in analysis with missing opcode handling

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/2.2.0...2.3.0

Jasm - 2.2.0-beta pre release

Published by Col-E 11 months ago

What's Changed

  • Split method analysis into typed/valued engines - #11
  • Annotation support
  • Constant dynamic support
  • Various parser fixes

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/2.1.0...2.2.0

Jasm - 2.1.0-beta pre release

Published by Col-E 12 months ago

  • Expose stack analysis results in compiler interface

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/2.0.2...2.1.0

Jasm - 2.0.2-beta pre release

Published by Col-E almost 1 year ago

  • Fix class replacing visitor scrambling field/method order

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/2.0.1...2.0.2

Jasm - 2.0.1-beta pre release

Published by Nowilltolife about 1 year ago

  • fully fixed up analyzer thanks to @xxDark
  • added exception handlers

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/2.0.0.1...2.0.1

Jasm - 2.0.0.1-beta pre release

Published by Nowilltolife about 1 year ago

What's Changed

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/2.0.0...2.0.0.1

Jasm - 2.0.0-beta pre release

Published by Nowilltolife about 1 year ago

This is the first release of the new JASM format and backend parser.

The feature set is the same as the previous jasm but with the following additions:

  • builtin class -> jasm
  • builtin ast -> class
  • way more checking and verification
  • more robust syntax and parsing
  • errors instead of exceptions
  • partial results
Jasm - Expression fix

Published by Nowilltolife almost 2 years ago

Changes

  • Fixed expressions not parsing as part of body
  • Added test Suit

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/1.4.3.2...1.4.3.3

Jasm - Package refactor, additions to match spec

Published by Nowilltolife almost 2 years ago

Changes

  • Added record and deprecated attributes
  • Added local variable instruction from localvariabletable
  • Added frame instruction for stackmapframes
  • Package refactor for groups

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/1.4.3.1...1.4.3.2

Jasm - Invokedynamic fix and minor fixes

Published by Nowilltolife almost 2 years ago

Jasm - Argument rework and more control over parsing behaviour

Published by Nowilltolife almost 2 years ago

Changes

  • Argument class system
  • One line instructions
  • Argument validation both jasm and support methods for own

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/1.4.2...1.4.3

Jasm - Maybe keyword for module

Published by Nowilltolife almost 2 years ago

Changes:

  • version ??? for requires and module declaration

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/1.4.2...1.4.2.1

Jasm - Maybe keyword framework & extends / implements rework

Published by Nowilltolife almost 2 years ago

Changes:

  • Changed extends and implements to being included in the ClassDeclarationGroup to fix the fact that Attribute parser expected them to be before the class declaration
  • Added a framework for maybe keywords which might exist.
  • Made to and with keyword optional for modules
  • Made args keyword optional
  • Test fixes

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/1.4.1...1.4.2

Jasm - Minor fix for child being null

Published by Nowilltolife almost 2 years ago

Jasm - Minor fix for access mods

Published by Nowilltolife almost 2 years ago

Jasm - Minor fix for access mods

Published by Nowilltolife almost 2 years ago

Jasm - Minor fix for access mods

Published by Nowilltolife almost 2 years ago

Fixed interface and annotation-interface not being a acccess modifier

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/1.4.1...1.4.1.1

Jasm - Class attributes

Published by Nowilltolife almost 2 years ago

Added:

  • Nest Host & Nest Member Attributes
  • Inner Class Attribute
  • Permitted Subclass Attribute
  • Module Attribute
  • Version Attribute
  • Source File Attribute

Full Changelog: https://github.com/Nowilltolife/Jasm/compare/1.4.0...1.4.1

Jasm - Visitor model, getter and setter

Published by Nowilltolife almost 2 years ago

What's changed

  • Visitor types have been renamed to not conflict with OW2 ASM's visitors
  • Visitor model has been restructured for a more consistent design
  • Direct field access had been removed in favor of getters generated via lombok