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

Experiment with replacing textual representation in classfile with method that builds the model #274

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8aa9c03
Support bytecode generation for invocation of varArg method
mabbay Nov 6, 2024
3e3a108
Move code related to InvokeOp from processOperands(Op).
mabbay Nov 7, 2024
b2a2680
Add test cases for empty var arg, long and double
mabbay Nov 7, 2024
d9e5e19
Test replacing textual representation with method that builds the cod…
mabbay Nov 8, 2024
3da0442
Change bytecode generation for NewOp to use constructor type as owner
mabbay Nov 8, 2024
176108a
Assert on the value of executing builder method
mabbay Nov 8, 2024
5191810
Map FieldEntry to textual representation
mabbay Nov 11, 2024
d476a93
Write transformation as ClassTransform
mabbay Nov 11, 2024
d871a21
Refactor
mabbay Nov 11, 2024
f864705
Fix a typo
mabbay Nov 12, 2024
f0d7f8c
Add main method
mabbay Nov 13, 2024
342a02f
Remove some comments
mabbay Nov 13, 2024
8e9e796
Move record declaration before use
mabbay Nov 13, 2024
f661a2d
Box value before invoking Map.put
mabbay Nov 15, 2024
80ee7f8
Modify the script to run on all compiler tests classes one by one
mabbay Nov 19, 2024
b714c13
Write data to csv file
mabbay Nov 20, 2024
c42b2b0
Write the columns names after all processing is done
mabbay Nov 20, 2024
0819eaa
Remove unused method.
mabbay Nov 21, 2024
f54adb7
Add script for running text to code builder on hat examples
mabbay Nov 25, 2024
75743ad
Separate transformation from testing
mabbay Dec 7, 2024
8436cf8
ignore transformed classfiles
mabbay Dec 7, 2024
4d4c3ba
Remove unused class
mabbay Dec 7, 2024
2bfd67b
Merge branch 'code-reflection' into ir-builder-expriment
mabbay Dec 10, 2024
2e11695
Merge branch 'code-reflection' into ir-builder-expriment
mabbay Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions script2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/zsh

babylon_dir=$PWD
target_file="$babylon_dir/b.csv"
echo "" > $target_file
echo "writing data to $target_file ..."
for fp in `find hat/build/hat-example*classes -name "*.class"`; do \
fdir=$(dirname $fp)
cp test/jdk/java/lang/reflect/code/writer/OpFieldToMethodBuilder.java $fdir
cd $fdir
pkgName=$(dirname $(sed 's#^.*classes/\(.*\)#\1#g'<<< $fp) | sed 's#/#.#g')
echo "package $pkgName;" > tmp && cat OpFieldToMethodBuilder.java >> tmp && mv tmp OpFieldToMethodBuilder.java
# we want example_name/../class_file
example_name=$(sed 's#^.*classes/\(.*\)#\1#g'<<< $fp | sed 's#/#.#g')
java --enable-preview -ea OpFieldToMethodBuilder.java $(basename $fp) | awk "{\$1=\"$example_name\"; print}" OFS=, >> $target_file
rm OpFieldToMethodBuilder.java
cd $babylon_dir
; done
awk '!seen[$0]++' $target_file > tmp && mv tmp $target_file
awk -F ',' '$2 < $3' $target_file > tmp && mv tmp $target_file
echo "classfile, original_size, new_size" > tmp && cat $target_file >> tmp && mv tmp $target_file