creating inline native calls

36 views
Skip to first unread message

Trevor Norris

unread,
Jan 25, 2013, 7:41:54 PM1/25/13
to v8-u...@googlegroups.com
I was just perusing the v8 source and I ran across its ability to inline native calls. For example, Math.random() basically follows the following execution chain:

Math.random() - math.js
  RandomHeapNumber - runtime.h
    HGraphBuilder::GenerateRandomHeapNumber - hydrogen.cc

Interested, I kept looking around and realized that Math.random is basically a set of assembly instructions located in places like src/x64/full-codegen.cc.

What I'm wondering is if it's possible to emulate the same behavior from an embedded application?

Yang Guo

unread,
Feb 7, 2013, 9:41:49 AM2/7/13
to v8-u...@googlegroups.com
Unfortunately, there is no way to do that currently. And it seems that exposing platform dependency to the embedder is a bad idea.

Yang
Reply all
Reply to author
Forward
0 new messages