Call inside a function

35 views
Skip to first unread message

itre...@gmail.com

unread,
Nov 11, 2013, 9:49:03 PM11/11/13
to asmji...@googlegroups.com
Hi all,

I was wondering if anyone could brainstorm with me on a problem I'm in. I want to compile an entire function, but jump to a certain label? within the created function from certain contexts. This will be used to jump from an interpreter to compiled code during execution at, say, a loop boundary. Perhaps the cleanest way is to create smaller functions from the selected region, but that seems like wasted effort to me.

Thanks!

Ryan Gonzalez

unread,
Nov 12, 2013, 2:03:33 PM11/12/13
to asmji...@googlegroups.com
Why not just put a jump right after the start of the function?


--
 
---
You received this message because you are subscribed to the Google Groups "asmjit-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asmjit-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Ryan

itre...@gmail.com

unread,
Nov 12, 2013, 9:59:04 PM11/12/13
to asmji...@googlegroups.com
Does that imply storing all possible jump addresses somewhere? At that point I could index by position and jump to there. I did consider that, but I wasn't sure how best to find the address to jump to.

Ryan

unread,
Nov 13, 2013, 9:24:40 AM11/13/13
to asmji...@googlegroups.com, itre...@gmail.com
Ok...I'm new to this...but when you create a label, you don't have to bind it to the current position. So, couldn't you store the labels in a map/vector...or better yet, create the label ahead of time and bind to it later. i.e.:

Label keyblade;
myassembler.jump(keyblade);
// Later on...
myassembler.bind(keyblade);

I'm not really sure what you're trying to do here. From what I got, you've got a bunch of labels, and you want to jump to one of them at the beginning of the function.
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Ryan

unread,
Nov 13, 2013, 9:24:39 AM11/13/13
to asmji...@googlegroups.com, itre...@gmail.com
Ok...I'm new to this...but when you create a label, you don't have to bind it to the current position. So, couldn't you store the labels in a map/vector...or better yet, create the label ahead of time and bind to it later. i.e.:

Label keyblade;
myassembler.jump(keyblade);
// Later on...
myassembler.bind(keyblade);

I'm not really sure what you're trying to do here. From what I got, you've got a bunch of labels, and you want to jump to one of them at the beginning of the function.

Reply all
Reply to author
Forward
0 new messages