Re: [pypy-dev] cannot use "id" in Rpython

2017-01-04 Thread Shubha Ramani via pypy-dev
Thank you Manuel. Your answer here helped me in other ways - the thing about beingable to do things at the module top-level. That concept helped me a lot. You were right. I don't need id(var). Never did. I mis-understood. The JITTED load addressis all I needed and Armin already provided that in h

Re: [pypy-dev] cannot use "id" in Rpython

2017-01-02 Thread Shubha Ramani via pypy-dev
Thank you Manuel. Sent from Shubha Ramani's iPhone 7 > On Jan 1, 2017, at 8:06 PM, Manuel Jacob wrote: > > Hi Shubha, > > I forgot to mention that the code line starting with "fptr_type = " is valid > Python code, but not valid RPython code. More details on this in the > documentation [1].

Re: [pypy-dev] cannot use "id" in Rpython

2017-01-01 Thread Manuel Jacob
Hi Shubha, I forgot to mention that the code line starting with "fptr_type = " is valid Python code, but not valid RPython code. More details on this in the documentation [1]. You should be able to fix the error by moving the line to the module toplevel. -Manuel [1] http://rpython.readthe

Re: [pypy-dev] cannot use "id" in Rpython

2016-12-30 Thread Shubha Ramani via pypy-dev
I don't know the signature of the function coming into execute_frame ahead of time. Therefore as you suggested Manuel,I am leaving the argument is an empty list []. This doesn't seem to work though. See the assertion error I'm getting below.All other examples of this technique I see being used a

Re: [pypy-dev] cannot use "id" in Rpython

2016-12-30 Thread Shubha Ramani via pypy-dev
This is very helpful. Thank you Manuel ! I will try your suggestion. Shubha > On Dec 30, 2016, at 8:04 AM, Manuel Jacob wrote: > > The id of an object is not necessarily related in any way to the address of > an object in Python. > > In RPython, you can convert a function to a low-level funct

Re: [pypy-dev] cannot use "id" in Rpython

2016-12-30 Thread Manuel Jacob
The id of an object is not necessarily related in any way to the address of an object in Python. In RPython, you can convert a function to a low-level function pointer with llhelper() from rpython.rtyper.annlowlevel. You can call it like this: fptr_type = lltype.Ptr(lltype.FuncType([], llty

Re: [pypy-dev] cannot use "id" in Rpython

2016-12-30 Thread Shubha Ramani via pypy-dev
It's not a bad idea for me. I'm hooking up to a tool made by intel called "vtune" which requires the function name, function size and function address from the original python script code. I got the first two from Python reflection (the way VmProf does it) but I need the third (original script

Re: [pypy-dev] cannot use "id" in Rpython

2016-12-29 Thread Ryan Gonzalez
What exactly are you trying to do. Using id to get the address of a function is usually a bad idea... -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://kirbyfan64.github.io/ On Dec 29, 2016 1:19 PM, "Shubha Ramani via pypy-dev" wrote: > > What can

[pypy-dev] cannot use "id" in Rpython

2016-12-29 Thread Shubha Ramani via pypy-dev
What can I use then ? I need the address of the function ? [translation:ERROR] Exception: cannot use id() in RPython; see objectmodel.compute_xxx()Processing block: block@19 is a   in (pypy.module._vtune.interp_vtune:28)_get_full_name  containing the following operations:        buf_0 = simple_