Thanks Jakob, for your answer and sorry for the late response.

Another thing that came to my mind: Considering I do not execute the JS 
code with d8 and the print-opt-code flag but directly within my chrome 
browser:
Is the produced code the same? Meaning, does it matter, if I execute the JS 
code with d8 or directly in chrome? To my understanding it shouldn't, since 
they both use the same interpreters/JIT compilers...

However, a final question to this topic: When v8 produces the optimized 
code, it generates the AST based on the fully generated code, then letting 
the runtime profiler mark hot regions to optimize (I know this is a very 
high level and non-technical view ;)  ).
Does this mean, when I execute JS code within my chrome browser, the fully 
generated code is loaded into memory, before it is optimized and executed?

Please let me know, if I managed to confuse you :D


Am Montag, 21. Dezember 2015 18:07:32 UTC+1 schrieb Jakob Kummerow:
>
> On Mon, Dec 21, 2015 at 5:38 PM, D T <[email protected] <javascript:>> 
> wrote:
>
>> To my understanding, this is the ASM code, V8 produces for my Javascript 
>> input file?
>>
>
> Yes. More specifically, it's the optimized code that was generated for 
> your "rnd" function.
>  
>
>> So if I execute my JS file with Chrome (using V8), I should find the 
>> exact same code in memory, or don't I?
>>
>
> Yes.
>  
>
>> Furthermore: How do I reliably find the code-
>>
>
> Right where it says:
> 0x2020e060     0  55             push ebp
> ^^^^^^^^^ This is the address of the "push ebp" instruction.
>  
>
>> is there a specific region where V8/Chrome normally writes to?
>>
>
> No.
>
> What exactly do you mean when you say you want to "find the code"? 
> From a debugger? Use the address you see in the --print-opt-code output. 
> From JavaScript? Raw object addresses are not exposed to JavaScript, so 
> this should be impossible. (If you do find a way, then you've probably 
> found a security bug, which we'd love to hear about!)
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to