<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <link href="chrome://translator/skin/floatingPanel.css"
      type="text/css" rel="stylesheet">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Phil<br>
              Thank you for your clarification, Actually I compiled
    VMKit 3.2 with llvm 3.2 and  trying do  <i><b>recompileAndRelinkFunction</b></i>()
    .  Could you please verity the following things to me.  For instance
    , code need to be executed as follows <br>
                      <b><i> main()</i></b><b><i>{</i></b><b><i><br>
      </i></b><b><i>                                 test()</i></b><b><i>;</i></b><b><i><br>
      </i></b><b><i>                                differentTest();</i></b><b><i><br>
      </i></b><b><i>                                 test();</i></b><b><i><br>
      </i></b><b><i>                        }</i></b><br>
       as soon as I executed the first <b>test</b>() function , I
    modified the llvm IR ( modified some instruction) of test , then
    when I execute differentTest(),  I used <i>recompileAndRelinkFunction</i>()
    to link the modified test() before I execute the last test()
    function. Actually , I was expecting the different result when I was
    executing the last <b>test</b>() function but unfortunately it
    execute the previous test() function not modified one.  How can I
    use this <i><b>recompileAndRelinkFunction() to modify the native
        code during the execution. <br>
        <br>
        Thanks .<br>
        <br>
        With regards <br>
        Sri.<br>
      </b></i>                                 <br>
    <div class="moz-cite-prefix">On 04/26/2014 06:19 PM, Filip Pizlo
      wrote:<br>
    </div>
    <blockquote cite="mid:etPan.535beab3.4f4ef005.2885@dethklok.local"
      type="cite">
      <style>body{font-family:Helvetica,Arial;font-size:13px}</style>
      <div id="bloop_customfont"
        style="font-family:Helvetica,Arial;font-size:13px; color:
        rgba(0,0,0,1.0); margin: 0px; line-height: auto;">That's a good
        point.  But it's worth noting that recompileAndRelinkFunction()
        and freeMachineCodeForFunction() are both vestiges of the old
        JIT (i.e. the "JIT" as opposed to the "MCJIT").  The old JIT is
        no longer actively supported.</div>
      <div id="bloop_customfont"
        style="font-family:Helvetica,Arial;font-size:13px; color:
        rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br>
      </div>
      <div id="bloop_sign_1398532542363504896" class="bloop_sign">
        <div style="font-family:helvetica,arial;font-size:13px">-Phil</div>
        <div style="font-family:helvetica,arial;font-size:13px"><br>
        </div>
      </div>
      <br>
      <p style="color:#000;">On April 26, 2014 at 9:47:05 AM, Sri (<a
          moz-do-not-send="true" href="mailto:emdcdeveloper@gmail.com">emdcdeveloper@gmail.com</a>)
        wrote:</p>
      <blockquote type="cite" class="clean_bq"><span>
          <div bgcolor="#FFFFFF" text="#000000">
            <div>
              <link href="chrome://translator/skin/floatingPanel.css"
                type="text/css" rel="stylesheet">
              <link href="chrome://translator/skin/floatingPanel.css"
                type="text/css" rel="stylesheet">
              <title></title>
              Hi Fillip<br>
                              
              Addition to my previous mail, llvm has
              recompileAndRelinkFunction
              function , so, once we modified the llvm function, and 
              pass
              IR to recompileAndRelinkFunction , I hope it should be
              compiled and
              linked with previous one.<br>
              <br>
              Thanks<br>
              <br>
              Regards<br>
              Sri.<br>
              <div class="moz-cite-prefix">On 04/26/2014 12:15 PM, Sri
                wrote:<br>
              </div>
              <blockquote cite="mid:535B9546.1010001@gmail.com"
                type="cite">Hi
                Filip<br>
                           Thank
                you for your detailed explanation, I was actually
                looking to
                implement an adaptive approach which is basically when
                some
                function executed more frequently, I was trying to drop
                that
                function and compiled and linked with new optimized
                function. 
                I just did the following  -<br>
                          
                whenever some function executed more times , I
                called-back to
                program, so I that I could be able to call
                freeMachineCodeForFunction (F) then I compiled that more
                frequent
                function with some kind of optimization. But , still I
                am getting
                previous function signature and not newest one. Could
                you please
                explain , why we can not use this
                freeMachineCodeForFunction for
                this purpose. If not, how we can hook some instruction
                in emitted
                machine code that will call back to our code in llvm.<br>
                <br>
                Thanks<br>
                <br>
                With regards<br>
                Sri.<br>
                <div class="moz-cite-prefix">On 04/26/2014 05:39 AM,
                  Filip Pizlo
                  wrote:<br>
                </div>
                <blockquote
                  cite="mid:8BB89150-85B9-4A8E-A291-76F886C590FD@apple.com"
                  type="cite">
                  <div>This isn't currently supported directly. It
                    depends on what
                    you're doing, which JIT you're using, how you use
                    modules, and to
                    what extent you're relying on LLVM to do linking for
                    you. </div>
                  <div><br>
                  </div>
                  <div>You can't safely drop a function's code if you
                    have other
                    functions in that module. </div>
                  <div><br>
                  </div>
                  <div>You can't safely drop a module if there are other
                    modules that
                    have calls that you've already resolved to functions
                    in the module
                    you're dropping unless you have your own mechanism
                    for unlinking
                    those calls. </div>
                  <div><br>
                  </div>
                  <div>The MCJIT currently does support dropping the
                    memory for a
                    module, but it involves destroying the MCJIT
                    execution engine
                    object. This works best if you use your own JIT
                    memory manager and
                    you steal the executable memory from the MCJIT, and
                    delete the
                    MCJIT after code is generated. Then your own memory
                    manager can
                    manage the memory however you like. This depends on
                    not having LLVM
                    call instructions resolve to any of the functions
                    you would be
                    dropping. WebKit is an example of a system that does
                    this. Each
                    function gets it's own module and all LLVM data
                    structures are
                    dropped once the code is compiled. Call instructions
                    are only used
                    for intrinsics and for runtime calls; source level
                    calls are
                    implemented as patchpoints and WebKit does all of
                    the linking (and
                    unlinking). </div>
                  <div><br>
                  </div>
                  <div>Long story short, there is no shrink-wrapped
                    solution but it's
                    doable if you're willing to get dirty. <br>
                    <br>
                    -Fil</div>
                  <div><br>
                    On Apr 25, 2014, at 3:44 PM, Sri <<a
                      moz-do-not-send="true"
                      href="mailto:emdcdeveloper@gmail.com">emdcdeveloper@gmail.com</a>>
                    wrote:<br>
                    <br>
                  </div>
                  <blockquote type="cite">
                    <div>Hi<br>
                              Currently , I have doing
                      some experimental work by using llvm, Is it
                      possible to drop the
                      machine code once it has been generated for
                      particular function
                      while program executing. For example some <b>void
                        test(int)</b>
                      function has been executed on native machine , I
                      want to drop the
                      code before I start  execute some other function
                      in my long
                      running program.<br>
                      <br>
                      Thanks.<br>
                      <br>
                      With regards<br>
                      Sri.<br>
                      <div style="bottom: auto; left: 824px; right:
                        auto; top: 57px; display: none;"
                        class="translator-theme-default"
                        id="translator-floating-panel">
                      </div>
                    </div>
                  </blockquote>
                  <blockquote type="cite">
                    <div>
                      <span>_______________________________________________</span><br>
                      <span>LLVM Developers mailing list</span><br>
                      <span><a moz-do-not-send="true"
                          href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
                                <a moz-do-not-send="true"
                          href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a></span><br>
                      <span><a moz-do-not-send="true"
                          href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></span><br>
                    </div>
                  </blockquote>
                </blockquote>
                <br>
                <div style="bottom: auto; left: 687px; right: auto; top:
                  68px; display: none;" class="translator-theme-default"
                  id="translator-floating-panel">
                </div>
              </blockquote>
              <br>
            </div>
          </div>
        </span></blockquote>
    </blockquote>
    <br>
    <div style="bottom: auto; left: 725px; right: auto; top: 46px;
      display: none;" class="translator-theme-default"
      id="translator-floating-panel">
      <div title="Click to translate"
        id="translator-floating-panel-button"></div>
    </div>
  </body>
</html>