Skip to content

Update bytecode and add test utilities - #1111

Merged
popematt merged 1 commit into
amazon-ion:ion11from
popematt:inputstream10
Oct 13, 2025
Merged

popematt merged 1 commit into
amazon-ion:ion11from
popematt:inputstream10

Conversation

@popematt

Copy link
Copy Markdown
Contributor

Issue #, if available:

None

Description of changes:

  • Fixes the Bytecode debug rendering so that there isn't a trailing (space) after instructions with no packed data.
  • Adds test utility methods for converting strings of hexadecimal octets into ByteArray
  • Adds assertion and helper method for checking the equality of bytecode.
  • Adds an IMPORT instruction to the bytecode
  • Adds more documentation about the content of the directive instructions
  • Adds more doc comments to BytecodeGenerator

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@popematt
popematt requested review from austnwil and tgregg October 13, 2025 18:08
@codecov

codecov Bot commented Oct 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (ion11@45f34fc). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...c/main/java/com/amazon/ion/bytecode/ir/Debugger.kt 50.00% 2 Missing and 1 partial ⚠️
...in/java/com/amazon/ion/bytecode/ir/Instructions.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             ion11    #1111   +/-   ##
========================================
  Coverage         ?   68.07%           
  Complexity       ?     5711           
========================================
  Files            ?      180           
  Lines            ?    23821           
  Branches         ?     4230           
========================================
  Hits             ?    16217           
  Misses           ?     6303           
  Partials         ?     1301           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@austnwil austnwil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks again for those convenience methods

Comment on lines +146 to +150
SYMBOL_SID $23
FLOAT_F32
3.1415
SYMBOL_SID $24
INT_I16 42

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be contained in s-expressions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The S-Expressions are for human readability more than anything else. If you think that we should keep the S-Expressions in the bytecode, we can, but it's not strictly necessary to make things work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, let's keep the bytecode as lean as possible.

@popematt
popematt merged commit be541e2 into amazon-ion:ion11 Oct 13, 2025
31 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants