jjfiv / dalvik-js

Project for CS 691ST - Dalvik VM implementation in Javascript
23 stars 11 forks source link

something wrong with return #86

Closed etosch closed 12 years ago

etosch commented 12 years ago

the CheckCast test case has methods that return strings to be printed. These strings are being lost somewhere after the return call. Figure out where.

etosch commented 12 years ago

In the spec, the instruction is listed as holding the return value in a "value" register. In the code the return value is being accessed via a "src" register.

jjfiv commented 12 years ago

Is this done now?

etosch commented 12 years ago

it works for the CheckCast test, which was returning strings. Since types don't matter, I think it's fine.

How is the java ternary op implemented? Is that worth testing?

jjfiv commented 12 years ago

Should compile down to cmp and gotos or ifs. Just syntactical sugar at the bytecode level. It will be calculated separately, and that register handed to the return.

I'll call it done.