Doing some more investigating, I am able to narrow down the scope of my question: In lithium.cc / fullcode-gen.c I see calls to MakeCodePrologue() and MakeCodeEpilogue(). Since I am interested in adding to the prologue of optimized code, I can focus on the lithium.cc part.
Both those call void CodeGenerator::MakeCodePrologue() in codegen.cc, but I don't see any actual code being "generated" or emitted there. The call I want to emit is basically just 2 assembly instructions (I use this as a hint driver for my simulator). Can I just call emit() from within those makePrologue/Epilogue calls? Malek On Fri, Mar 13, 2015 at 4:02 PM, Malek Musleh <[email protected]> wrote: > Hi, > > I have a 2 part (but semi-related question) here. > > 1) > > I am looking at being able to generate specific runtime calls during the > execution of certain JS functions. This can be thought of as having V8 > insert calls (annotating function entry/exit points) with calls to an > external system library/call (e.g. Calling "ls"). > > I see there are ways of doing the opposite: invoking v8 from within C++ > code: > > https://bungeeconnect.wordpress.com/2008/10/09/connecting-c-to-javascript-via-googles-v8/ > > But I am sort of looking for the opposite. Is something like the following > possible: > > Runtime.getRuntime().exec("ls"); // example invoking runtime from android / > Java > > > > 2) > > My end goal here is to have the code-generator generate additional calls (at > the prologue/epilogue) to this external function / library) for functions > deemed to be "hot" by crankshaft. For this I presume, Would I need to edit > the code-generator part (full-codegen.cc) to generate these extra calls > inside these functions, or should it be done elsewhere, perhaps in the > lithium generator part? > > I should note that I have been able to compile this external library within > v8 as a third party tool, and I verified invoking it within v8 works. > > > Malek > > -- > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to a topic in the > Google Groups "v8-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/v8-users/SXJMJw7il3g/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. -- -- 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.
