jjfiv / dalvik-js

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

something funny happened on the GOTO FORUM #84

Closed etosch closed 12 years ago

etosch commented 12 years ago

goto/switch returning results, not setting result register - seems to be inconsistent with the model. explanation?

jjfiv commented 12 years ago

This is something you and I coded together, a very long time ago. :)

The result register is part of the actual VM spec; this is a part of our architecture - namely that if an icodeHandler returns nothing, it means the thread should increment the pc + 1; otherwise, it should increment the pc by the value returned. This is why goto and switch are returning values --- if should also return a value.

Where we use the return value in Thread.js

etosch commented 12 years ago

Got it!