196 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
87
views
What are the methods for optimizing bytecode in Android's DX tool?
I'm learning Dalvik bytecode now, it has many differences from the JVM bytecode.
I want to know what optimizations it makes when converting java bytecode into dalvik bytecode.
The optimization I'm ...
1
vote
0
answers
44
views
Is there a way to generate invokedynamic bytecode using BCEL?
I want to generate invokedynamic bytecode using BCEL library.
Using BCEL I want to generate a class file which calls a bootstrap method using invokedynamic opcode. I can see BCEL has INVOKEDYNAMIC ...
2
votes
0
answers
157
views
Java bytecode if condition in loop
I am working on a java decompiler, and today I found a class file, here is the source code of the class file after decompiled
loop {
if ([ 119 ifeq] var_17_9.hasNext() /* target: 148 */) ...
Neo's user avatar
- 5,513
1
vote
1
answer
120
views
How to use Java agent intercept to instrument java.net.Socket with javaassist
I am working on a project where I need to write some header to the socket output stream right after the socket is connected.
I want to intercept at low level such as java.net.Socket and its connect ...
1
vote
2
answers
158
views
Keeping the bytecode of inline methods in resulting JAR
I'm not a Scala dev by any means (rather Dart and Rust one), but I need to use some library written in Scala in my Java project.
I can build the JAR from that library and use it as Maven dependency, ...
0
votes
0
answers
54
views
How to add an arrayList field in a class file using ASM
I am doing changes to re-develop Jacoco.
Except for the existing boolean[], I want to add a new field (ArrayList) to store function name.
I have already create the init method and add it to 'addMember'...
1
vote
3
answers
110
views
Why does the bytecode generated by Java include operations of pushing onto the stack and immediately popping off the stack?
Here is a example
public Integer add(Integer a) {
a++;
return a;
}
The corresponding bytecode instructions for this method are as follows
0 aload_1
1 astore_2
2 aload_1
3 invokevirtual #...
0
votes
0
answers
58
views
Explicit Branch-prediction in JVM-based langauges?
Is there any way for JVM-based languages to indicate to the interpreter that a branch is cold or unlikely etc.?
Specifically I mean some kind of branch attribute like the Linux Kernel's unlikely() and ...
0
votes
2
answers
154
views
Java bytecode not in .class file
I'm working on a personal project just for fun, a new programming languages (just because there are not enough). I m going to make it run on JVM but I need to store some metadata in the compiled file. ...
2
votes
1
answer
127
views
Merging int[] and String[] should result in Object[]
After carefully reading JVMS §4.10.2.2, I noticed the following paragraph:
If corresponding values are both array reference types, then their dimensions are examined. If the array types have the same ...
2
votes
1
answer
81
views
Does the JVM operand stack have to be deterministic?
For clarification, this is a question regarding the specification of the bytecode verifier, especially when dealing with bytecode that isn't generated by javac.
Can the operand stack be modified in a ...
1
vote
1
answer
87
views
Transform a stack using Java Virtual Machine Instruction Set
I need to transform 654321 into 654321321, using only DUP2_X1, POP, DUP_X2, POP2. I have a really difficult time with the DUP. Can anyone help?
I tried to go like this: 654321 DUP2_X1 654654321, then ...
0
votes
1
answer
79
views
Why are my self-written classes / 3-party library classes invisible to JRE classes?
I'm writing a security-boosted Java program that uses ASM tool to add some hooks into JRE classes. The hooks will then call my method to make some rule checks. But the odd thing is, the hooks in JRE ...
4
votes
0
answers
217
views
What bytecode will Kotlin compiller produce if jvmToolchain is set to 11 and jvmTarget to 1.8?
I have a Kotlin project that I want to compile to Java 1.8 bytecode so that it could also be used on Android as well. I use the com.vanniktech.maven.publish Gradle plugin to publish the library to ...
0
votes
1
answer
661
views
Java ASM: Bad local variable type (dload) Type top (current frame, locals[5]) is not assignable to double
I am trying to generate Java bytecode using the Java Asm library (I am basically trying to create yet another JVM programming language)
Here is the code I am compiling
float f = 2f
float f2 = new ...