home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / filesbbs / os2 / fp1os2.arj / OS2 / DATA / 49 / C / 0 / F_26836 / JScriptRuntimeInstance.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-05-15  |  14.9 KB  |  748 lines

  1. import java.io.PrintStream;
  2. import stardiv.tools.HoldJavaEnvironment;
  3.  
  4. class JScriptRuntimeInstance extends JSbxObject implements Runnable {
  5.    private JScriptScheduler aMyTask;
  6.    public JScriptRunParam aRP;
  7.    private int nError;
  8.    private boolean bDbgFlag;
  9.    private boolean bPushExtThisObjs;
  10.    private boolean bDoUpdateBrowser;
  11.    private int nStatementCount;
  12.    private String aActDebugSource;
  13.    private int nLastPC;
  14.    private String aLastMethodName;
  15.    private JSbxObject aThisObj;
  16.    private boolean bWatchdogBreak;
  17.    private boolean bSuspendExecution;
  18.    private boolean bSpecialFlag;
  19.    private boolean bDebuggingActive;
  20.    private boolean bBreak;
  21.    private boolean bStepOver;
  22.    private int nStepOverCallLevel;
  23.    private boolean bStepOut;
  24.    private int nStepOutCallLevel;
  25.    private boolean bSingleSourceStep;
  26.    private boolean bSinglePCodeStep;
  27.    public boolean bThreadRunning;
  28.    private Thread aRTIThread;
  29.    private boolean bDbgContinue;
  30.    private JScriptTokenPosition aSourceCodePosition;
  31.    private JScriptModule aRunModule;
  32.    private JScriptCodeBlock aActCodeBlock;
  33.    private SJMessage aMessageToAck;
  34.    private boolean bRunAsThread;
  35.    private JScriptManager aJScriptManager;
  36.    private JScriptExpressionStack aExpressionStack;
  37.    private JSbxValue aReturnValue;
  38.    private JSbxValue aLastExpression;
  39.    private JScriptCallStack aCallStack;
  40.    private int nCallLevel;
  41.    private JScriptCallLevelInstance aActualCallLevelInst;
  42.    private JScriptRuntimeParam aActualRuntimeParam;
  43.    private JScriptDebugInterface aDebugInterface;
  44.    private SJMessageHandlerInterface aMessageInterface;
  45.    PrintStream aDebugOutStream;
  46.    private JScriptBreakHandler aBreakHandler;
  47.  
  48.    public final int GetErrorCode() {
  49.       return this.nError;
  50.    }
  51.  
  52.    public final int GetStatementCount() {
  53.       return this.nStatementCount;
  54.    }
  55.  
  56.    public final void IncStatementCount() {
  57.       ++this.nStatementCount;
  58.    }
  59.  
  60.    public final void SetActDebugSource(String var1) {
  61.       this.aActDebugSource = var1;
  62.    }
  63.  
  64.    public final String GetActDebugSource() {
  65.       return this.aActDebugSource;
  66.    }
  67.  
  68.    public final int GetLastPC() {
  69.       return this.nLastPC;
  70.    }
  71.  
  72.    public final void SetLastPC(int var1) {
  73.       this.nLastPC = var1;
  74.    }
  75.  
  76.    public final String GetLastMethodName() {
  77.       return this.aLastMethodName;
  78.    }
  79.  
  80.    public final void SetLastMethodName(String var1) {
  81.       this.aLastMethodName = var1;
  82.    }
  83.  
  84.    public void SetThisObj(JSbxObject var1) {
  85.       this.aThisObj = var1;
  86.    }
  87.  
  88.    public JSbxObject GetThisObj() {
  89.       return this.aThisObj;
  90.    }
  91.  
  92.    public final void SetDebugFlag() {
  93.       this.bDebuggingActive = true;
  94.       this.bSpecialFlag = true;
  95.    }
  96.  
  97.    public final void ClearDebugFlag() {
  98.       this.bDebuggingActive = false;
  99.       this.bSpecialFlag = false;
  100.    }
  101.  
  102.    public final boolean IsDebuggingActive() {
  103.       return this.bDebuggingActive;
  104.    }
  105.  
  106.    public final void SetBreakFlag() {
  107.       this.bBreak = true;
  108.    }
  109.  
  110.    public final void ClearBreakFlag() {
  111.       this.bBreak = false;
  112.    }
  113.  
  114.    public final boolean IsBreak() {
  115.       return this.bBreak;
  116.    }
  117.  
  118.    public final void SetStepOverFlag() {
  119.       this.bStepOver = true;
  120.       this.nStepOverCallLevel = this.nCallLevel;
  121.       if (this.nStepOverCallLevel == 0) {
  122.          this.nStepOverCallLevel = 1;
  123.       }
  124.  
  125.    }
  126.  
  127.    public final void ClearStepOverFlag() {
  128.       this.bStepOver = false;
  129.       this.nStepOverCallLevel = 0;
  130.    }
  131.  
  132.    public final boolean IsStepOver() {
  133.       return this.bStepOver;
  134.    }
  135.  
  136.    public final int GetStepOverCallLevel() {
  137.       return this.nStepOverCallLevel;
  138.    }
  139.  
  140.    public final void SetStepOutFlag() {
  141.       this.bStepOut = true;
  142.       this.nStepOutCallLevel = this.nCallLevel - 1;
  143.       if (this.nStepOutCallLevel < 1) {
  144.          this.nStepOutCallLevel = 1;
  145.       }
  146.  
  147.    }
  148.  
  149.    public final void ClearStepOutFlag() {
  150.       this.bStepOut = false;
  151.       this.nStepOutCallLevel = 0;
  152.    }
  153.  
  154.    public final boolean IsStepOut() {
  155.       return this.bStepOut;
  156.    }
  157.  
  158.    public final int GetStepOutCallLevel() {
  159.       return this.nStepOutCallLevel;
  160.    }
  161.  
  162.    public final void SetSingleSourceStepFlag() {
  163.       this.bSingleSourceStep = true;
  164.    }
  165.  
  166.    public final void ClearSingleSourceStepFlag() {
  167.       this.bSingleSourceStep = false;
  168.    }
  169.  
  170.    public final boolean IsSingleSourceStep() {
  171.       return this.bSingleSourceStep;
  172.    }
  173.  
  174.    public final void SetSinglePCodeStepFlag() {
  175.       this.bSinglePCodeStep = true;
  176.    }
  177.  
  178.    public final void ClearSinglePCodeStepFlag() {
  179.       this.bSinglePCodeStep = false;
  180.    }
  181.  
  182.    public final boolean IsSinglePCodeStep() {
  183.       return this.bSinglePCodeStep;
  184.    }
  185.  
  186.    private final boolean IsCallInPCodeStepOver(JScriptPCode var1) {
  187.       return this.IsSinglePCodeStep() && this.IsStepOver() && var1 instanceof JSP_Call;
  188.    }
  189.  
  190.    public final synchronized boolean IsThreadRunning() {
  191.       return this.bThreadRunning;
  192.    }
  193.  
  194.    public final synchronized void WaitForThreadReady() {
  195.       try {
  196.          while(!this.bThreadRunning) {
  197.             this.wait();
  198.          }
  199.  
  200.       } catch (InterruptedException var1) {
  201.       }
  202.    }
  203.  
  204.    public final synchronized void WaitForThreadEnd() {
  205.       if (!this.bThreadRunning) {
  206.          this.WaitForThreadReady();
  207.       }
  208.  
  209.       try {
  210.          while(this.bThreadRunning) {
  211.             this.wait();
  212.          }
  213.  
  214.       } catch (InterruptedException var1) {
  215.       }
  216.    }
  217.  
  218.    private final synchronized void ClearThreadRunningFlag() {
  219.       this.bThreadRunning = false;
  220.       this.notifyAll();
  221.    }
  222.  
  223.    private final synchronized void SetThreadRunningFlag() {
  224.       this.bThreadRunning = true;
  225.       this.notifyAll();
  226.    }
  227.  
  228.    public final Thread GetThread() {
  229.       return this.aRTIThread;
  230.    }
  231.  
  232.    public final synchronized void SetDebugContinueFlag() {
  233.       this.bDbgContinue = true;
  234.       this.notifyAll();
  235.    }
  236.  
  237.    public final synchronized void ClearDebugContinueFlag() {
  238.       this.bDbgContinue = false;
  239.       this.notifyAll();
  240.    }
  241.  
  242.    public final boolean IsSleeping() {
  243.       return !this.bDbgContinue;
  244.    }
  245.  
  246.    public final JScriptTokenPosition GetSourceCodePosition() {
  247.       return this.aSourceCodePosition;
  248.    }
  249.  
  250.    public final void SetSourceCodePosition(JScriptTokenPosition var1) {
  251.       this.aSourceCodePosition = var1;
  252.    }
  253.  
  254.    public final void SetModule(JScriptModule var1) {
  255.       this.aRunModule = var1;
  256.    }
  257.  
  258.    public final JScriptModule GetModule() {
  259.       return this.aRunModule;
  260.    }
  261.  
  262.    public final void SetCodeBlock(JScriptCodeBlock var1) {
  263.       this.aActCodeBlock = var1;
  264.    }
  265.  
  266.    public final void SetCodeBlock(JScriptCodeBlock var1, String var2) {
  267.       this.aActCodeBlock = var1;
  268.       this.aActCodeBlock.SetIDString(var2);
  269.    }
  270.  
  271.    public final JScriptCodeBlock GetCodeBlock() {
  272.       return this.aActCodeBlock;
  273.    }
  274.  
  275.    public final void SetMessageToAcknowledge(SJMessage var1) {
  276.       this.aMessageToAck = var1;
  277.    }
  278.  
  279.    public final void SetRTIAsThread() {
  280.       this.bRunAsThread = true;
  281.    }
  282.  
  283.    public final void SetRTIAsProcess() {
  284.       this.bRunAsThread = false;
  285.    }
  286.  
  287.    public final boolean IsRTIaThread() {
  288.       return this.bRunAsThread;
  289.    }
  290.  
  291.    public final JScriptManager GetJSManager() {
  292.       return this.aJScriptManager;
  293.    }
  294.  
  295.    public JScriptExpressionStack GetExpressionStack() {
  296.       return this.aExpressionStack;
  297.    }
  298.  
  299.    public JSbxValue GetReturnValue() {
  300.       return this.aReturnValue;
  301.    }
  302.  
  303.    public void SetReturnValue(JSbxValue var1) {
  304.       this.aReturnValue = var1;
  305.    }
  306.  
  307.    public JSbxValue GetLastExpression() {
  308.       return this.aLastExpression;
  309.    }
  310.  
  311.    public void SetLastExpression(JSbxValue var1) {
  312.       this.aLastExpression = var1;
  313.    }
  314.  
  315.    public final int DEBUG_GetCallLevel() {
  316.       return this.nCallLevel;
  317.    }
  318.  
  319.    public JScriptCallLevelInstance GetActualCallLevelInst() {
  320.       return this.aActualCallLevelInst;
  321.    }
  322.  
  323.    public final JScriptRuntimeParam GetActualRuntimeParam() {
  324.       return this.aActualRuntimeParam;
  325.    }
  326.  
  327.    public JScriptDebugInterface GetDebugInterface() {
  328.       return this.aDebugInterface;
  329.    }
  330.  
  331.    public void SetDebugInterface(JScriptDebugInterface var1) {
  332.       this.aDebugInterface = var1;
  333.    }
  334.  
  335.    public SJMessageHandlerInterface GetMessageHandlerInterface() {
  336.       return this.aMessageInterface;
  337.    }
  338.  
  339.    public void SetMessageHandlerInterface(SJMessageHandlerInterface var1) {
  340.       this.aMessageInterface = var1;
  341.    }
  342.  
  343.    public void SetDebugStream(PrintStream var1) {
  344.       this.aDebugOutStream = var1;
  345.    }
  346.  
  347.    public void SetBreakHandler(JScriptBreakHandler var1) {
  348.       this.aBreakHandler = this.aBreakHandler;
  349.    }
  350.  
  351.    public JScriptRuntimeInstance(JScriptManager var1, boolean var2, boolean var3, JScriptScheduler var4, JScriptRunParam var5) {
  352.       this.Init();
  353.       this.aMyTask = var4;
  354.       this.aRP = var5;
  355.       this.bWatchdogBreak = this.aRP != null ? this.aRP.bStoped : false;
  356.       this.bSuspendExecution = this.aRP != null ? this.aRP.bStoped : false;
  357.       this.bSpecialFlag = false;
  358.       this.bDbgFlag = var2;
  359.       this.bPushExtThisObjs = var3;
  360.       this.aThisObj = null;
  361.       this.aJScriptManager = var1;
  362.    }
  363.  
  364.    private void Init() {
  365.       this.aExpressionStack = new JScriptExpressionStack();
  366.       this.aCallStack = new JScriptCallStack();
  367.       this.nCallLevel = 0;
  368.       this.nStepOverCallLevel = 0;
  369.       this.nStepOutCallLevel = 0;
  370.       this.aActualRuntimeParam = new JScriptRuntimeParam(this);
  371.       this.aMyTask = null;
  372.       this.aDebugInterface = null;
  373.       this.aMessageInterface = null;
  374.       this.aBreakHandler = null;
  375.       this.aRunModule = null;
  376.       this.aActCodeBlock = null;
  377.       this.aSourceCodePosition = null;
  378.       this.aRTIThread = null;
  379.       this.aMessageToAck = null;
  380.       this.aReturnValue = null;
  381.       this.nError = 0;
  382.       this.nStatementCount = 0;
  383.       this.SetLastPC(-1);
  384.       this.SetRTIAsProcess();
  385.    }
  386.  
  387.    private int RunModule(JScriptModule var1) {
  388.       this.InitRunData();
  389.  
  390.       try {
  391.          JSbxObject var2 = this.aJScriptManager.GetRootObject();
  392.          String[] var10 = var1.GetGlobalVarList();
  393.          if (var10 != null) {
  394.             int var4 = var10.length;
  395.  
  396.             for(int var5 = 0; var5 < var4; ++var5) {
  397.                JSbxValueProperty var6 = new JSbxValueProperty(var10[var5], var2);
  398.                ((JSbxBase)var6).SetFlag(4);
  399.  
  400.                try {
  401.                   var2.Put(var6);
  402.                } catch (JSbxException var8) {
  403.                   if (((JSbxExceptionBase)var8).GetError() != 4714) {
  404.                      throw var8;
  405.                   }
  406.                }
  407.             }
  408.          }
  409.  
  410.          JScriptMethod var11 = new JScriptMethod(var1, var1.GetCodeBlock());
  411.          this.ExecuteFunction(var11, new JScriptCallParam((JScriptRuntimeParam)null, (JSbxVector)null, this.GetThisObj()));
  412.          return 0;
  413.       } catch (Throwable var9) {
  414.          String var3 = "Runtime-Error: " + var9.getMessage();
  415.          if (this.aDebugOutStream != null) {
  416.             this.aDebugOutStream.println(var3);
  417.          } else {
  418.             System.out.println(var3);
  419.          }
  420.  
  421.          HoldJavaEnvironment.AddToProtocol(var3 + " #dbg-stmt=" + this.GetStatementCount());
  422.          HoldJavaEnvironment.AddToProtocol("source: " + this.GetActDebugSource());
  423.          HoldJavaEnvironment.AddToProtocol("--> #PC=" + this.GetLastPC() + " method=" + this.GetLastMethodName());
  424.          HoldJavaEnvironment.ShowExceptionStack(var9);
  425.          if (this.aJScriptManager != null) {
  426.             this.aJScriptManager.SetLastError("" + var9 + "\n" + "Error in source: " + this.GetActDebugSource());
  427.          }
  428.  
  429.          return -1;
  430.       }
  431.    }
  432.  
  433.    public void ExecuteFunction(JScriptMethod var1, JScriptCallParam var2) throws JSbxExceptionBase {
  434.       String var3 = this.GetLastMethodName();
  435.       this.SetLastMethodName(var1.GetName());
  436.       if (this.nCallLevel < this.aCallStack.GetSize()) {
  437.          this.aActualCallLevelInst = (JScriptCallLevelInstance)this.aCallStack.Get(this.nCallLevel);
  438.       } else {
  439.          this.aActualCallLevelInst = new JScriptCallLevelInstance(this, this.nCallLevel + 1);
  440.          this.aCallStack.Push(this.aActualCallLevelInst);
  441.       }
  442.  
  443.       this.aActualCallLevelInst.InitCall(var1, var2, this.bPushExtThisObjs);
  444.       this.bPushExtThisObjs = false;
  445.       ++this.nCallLevel;
  446.       JScriptModule var4 = this.GetModule();
  447.       JScriptModule var5 = var1.GetModule();
  448.       this.SetModule(var5);
  449.       JScriptCodeBlock var6 = this.GetCodeBlock();
  450.       this.SetCodeBlock(var1.GetCodeBlock(), var1.GetName());
  451.       this.ExecuteCodeBlock(this.aActCodeBlock);
  452.       this.aActualCallLevelInst.DeInitCall();
  453.       this.SetModule(var4);
  454.       this.SetCodeBlock(var6);
  455.       --this.nCallLevel;
  456.       if (this.nCallLevel > 0) {
  457.          this.aActualCallLevelInst = (JScriptCallLevelInstance)this.aCallStack.Get(this.nCallLevel - 1);
  458.       }
  459.  
  460.       this.SetLastMethodName(var3);
  461.    }
  462.  
  463.    public void ExecuteRuntimeCreatedModule(JScriptModule var1, boolean var2) throws JSbxExceptionBase {
  464.       if (var2) {
  465.          this.ExecuteRuntimeCreatedModule(var1);
  466.       } else {
  467.          this.ExecuteCodeBlock(var1.GetCodeBlock(), false);
  468.       }
  469.    }
  470.  
  471.    public void ExecuteRuntimeCreatedModule(JScriptModule var1) throws JSbxExceptionBase {
  472.       JScriptModule var2 = this.GetModule();
  473.       this.SetModule(var1);
  474.       JScriptCodeBlock var3 = this.GetCodeBlock();
  475.       if (this.IsDebuggingActive()) {
  476.          this.PCodeChangedCallback(var1.GetCodeBlock());
  477.       }
  478.  
  479.       this.SetCodeBlock(var1.GetCodeBlock(), var1.GetName());
  480.       this.ExecuteCodeBlock(this.aActCodeBlock);
  481.       this.SetModule(var2);
  482.       this.SetCodeBlock(var3);
  483.       if (this.IsDebuggingActive()) {
  484.          this.PCodeChangedCallback(var3);
  485.       }
  486.  
  487.    }
  488.  
  489.    public void ExecuteCodeBlock(JScriptCodeBlock var1) throws JSbxExceptionBase {
  490.       this.ExecuteCodeBlock(var1, true);
  491.    }
  492.  
  493.    public final void StopExecution() {
  494.       HoldJavaEnvironment.SetNoCallThreadId(JScriptScheduler.getJScriptThreadId());
  495.       this.bSpecialFlag = true;
  496.       this.bWatchdogBreak = true;
  497.    }
  498.  
  499.    public final synchronized void SuspendExecution() {
  500.       this.bSpecialFlag = true;
  501.       this.bSuspendExecution = true;
  502.    }
  503.  
  504.    private final void ProcessPendingTasks() {
  505.       JScriptScheduler.DoExecute((JScriptScheduler)null);
  506.       this.bSpecialFlag = false;
  507.       this.bSuspendExecution = false;
  508.    }
  509.  
  510.    public void ExecuteCodeBlock(JScriptCodeBlock var1, boolean var2) throws JSbxExceptionBase {
  511.       boolean var3 = true;
  512.       int var4 = 0;
  513.       int var5 = -1;
  514.       Object[] var6 = var1.getPCodeArray();
  515.  
  516.       try {
  517.          do {
  518.             JScriptPCode var7 = (JScriptPCode)var6[var4];
  519.             if (this.bSpecialFlag) {
  520.                if (this.bWatchdogBreak) {
  521.                   throw new JSbxException(-99, "user break");
  522.                }
  523.  
  524.                if (this.bSuspendExecution) {
  525.                   this.ProcessPendingTasks();
  526.                   if (this.bWatchdogBreak) {
  527.                      throw new JSbxException(-99, "user break");
  528.                   }
  529.  
  530.                   var5 = var7.Execute(this.aActualRuntimeParam);
  531.                } else if (this.bDebuggingActive) {
  532.                   boolean var8 = this.IsCallInPCodeStepOver(var7);
  533.                   if (var2 && this.IsSinglePCodeStep() && !var8 && this.aDebugInterface != null) {
  534.                      this.CreateCallback(var4, var7);
  535.                   }
  536.  
  537.                   if (var8) {
  538.                      this.ClearSinglePCodeStepFlag();
  539.                   }
  540.  
  541.                   if (this.IsBreak()) {
  542.                      break;
  543.                   }
  544.  
  545.                   var5 = var7.Execute(this.aActualRuntimeParam);
  546.                   if (var5 == -3) {
  547.                      ++var4;
  548.                      if (var2 && this.IsDebuggingActive() && this.aDebugInterface != null) {
  549.                         this.CreateCallback(var4, var7);
  550.                      }
  551.                   }
  552.  
  553.                   if (var8) {
  554.                      this.SetSinglePCodeStepFlag();
  555.                   }
  556.                }
  557.             } else {
  558.                var5 = var7.Execute(this.aActualRuntimeParam);
  559.             }
  560.  
  561.             if (var5 == -1) {
  562.                ++var4;
  563.             } else if (var5 > 0) {
  564.                var4 = var5;
  565.             } else if (var5 == -2) {
  566.                var3 = false;
  567.             }
  568.          } while(var3);
  569.  
  570.       } catch (ArrayIndexOutOfBoundsException var9) {
  571.          this.SetLastPC(var4);
  572.          throw new JSbxException(-42, "invalid P-Code (null)");
  573.       } catch (NullPointerException var10) {
  574.          this.SetLastPC(var4);
  575.          throw new JSbxException(-42, "invalid P-Code (null)");
  576.       } catch (JSbxExceptionBase var11) {
  577.          this.SetLastPC(var4);
  578.          throw var11;
  579.       }
  580.    }
  581.  
  582.    private final void CreateCallback(int var1, JScriptPCode var2) {
  583.       JScriptAction var3 = new JScriptAction(5000, 6);
  584.       var3.SetSourceObject(this);
  585.       var3.SetInteger(var1);
  586.       ((SJMessage)var3).SetObject(0, var2);
  587.       ((SJMessage)var3).SetObject(1, this.aActualRuntimeParam.GetStack().DEBUG_GetInfoString());
  588.       ((SJMessage)var3).SetObject(2, this.aActualRuntimeParam.GetRuntimeInst().aCallStack.DEBUG_GetInfoString(this.nCallLevel));
  589.       ((SJMessage)var3).SetObject(3, this.GetSourceCodePosition());
  590.       ((SJMessage)var3).SetObject(4, this.GetModule());
  591.       ((SJMessage)var3).SetObject(5, this.GetCodeBlock());
  592.       this.aJScriptManager.Browser_DirectShowInfos();
  593.       this.aDebugInterface.HandleMessage(var3);
  594.       this.WaitForDebugger();
  595.    }
  596.  
  597.    private final void PCodeChangedCallback(JScriptCodeBlock var1) {
  598.       JScriptAction var2 = new JScriptAction(213, 1);
  599.       var2.SetSourceObject(this);
  600.       ((SJMessage)var2).SetObject(0, var1);
  601.       this.aDebugInterface.HandleMessage(var2);
  602.    }
  603.  
  604.    public void run() {
  605.       Object var1 = null;
  606.       Object var2 = JScriptScheduler.aInUse;
  607.       synchronized(var2){}
  608.  
  609.       try {
  610.          if (JScriptScheduler.pWaitForRTI != this.aMyTask) {
  611.             return;
  612.          }
  613.  
  614.          var15 = JScriptScheduler.SetActRTI(this);
  615.       } catch (Throwable var14) {
  616.          throw var14;
  617.       }
  618.  
  619.       if (this.bDbgFlag) {
  620.          try {
  621.             HoldJavaEnvironment.StartChangeThread_Monitor();
  622.          } catch (UnsatisfiedLinkError var13) {
  623.          }
  624.       }
  625.  
  626.       this.nError = 0;
  627.       this.aRTIThread = Thread.currentThread();
  628.       this.SetThreadRunningFlag();
  629.       boolean var3 = this.aRP != null ? this.aRP.aMethodProp != null : false;
  630.       if (this.aRunModule != null && !var3) {
  631.          if (this.aDebugInterface != null) {
  632.             short var16;
  633.             if (this.IsRTIaThread()) {
  634.                var16 = 1014;
  635.             } else {
  636.                var16 = 1008;
  637.             }
  638.  
  639.             JScriptAction var20 = new JScriptAction(var16, this, (Object)null);
  640.             this.aDebugInterface.HandleMessage(var20);
  641.          } else if (this.aMessageInterface != null) {
  642.             short var17;
  643.             if (this.IsRTIaThread()) {
  644.                var17 = 217;
  645.             } else {
  646.                var17 = 202;
  647.             }
  648.  
  649.             JScriptAction var21 = new JScriptAction(var17, this, (Object)null);
  650.             this.aMessageInterface.HandleMessage(var21);
  651.          }
  652.  
  653.          this.nError = this.RunModule(this.aRunModule);
  654.       } else if (this.aRP != null) {
  655.          JSbxValue var4 = null;
  656.          JScriptCallParam var5 = new JScriptCallParam(this.GetActualRuntimeParam(), this.aRP.aParamVector, this.aRP.aThisObj);
  657.  
  658.          try {
  659.             if (this.aRP.aMethodProp != null) {
  660.                var4 = this.aRP.aMethodProp.CallFunction(var5);
  661.             }
  662.          } catch (Throwable var12) {
  663.             HoldJavaEnvironment.AddToProtocol("RTI call() LiveConnect Exception=" + var12);
  664.          }
  665.  
  666.          this.SetLastExpression(var4);
  667.          this.nError = 0;
  668.       } else {
  669.          this.nError = -11;
  670.       }
  671.  
  672.       if (this.aDebugInterface != null) {
  673.          short var18;
  674.          if (this.IsRTIaThread()) {
  675.             var18 = 1013;
  676.          } else {
  677.             var18 = 1007;
  678.          }
  679.  
  680.          JScriptAction var22 = new JScriptAction(var18, this, this);
  681.          this.aDebugInterface.HandleMessage(var22);
  682.       } else if (this.aMessageInterface != null) {
  683.          short var19;
  684.          if (this.IsRTIaThread()) {
  685.             var19 = 218;
  686.          } else {
  687.             var19 = 203;
  688.          }
  689.  
  690.          JScriptAction var23 = new JScriptAction(var19, this, this);
  691.          this.aMessageInterface.HandleMessage(var23);
  692.       }
  693.  
  694.       if (this.aMessageToAck != null) {
  695.          this.aMessageToAck.Acknowledge();
  696.       }
  697.  
  698.       this.ClearThreadRunningFlag();
  699.       if (this.bDbgFlag) {
  700.          try {
  701.             HoldJavaEnvironment.EndChangeThread_Monitor();
  702.             if (this.aMessageInterface != null) {
  703.                this.aMessageInterface.HandleMessage(new JScriptAction(220, this, this));
  704.             }
  705.          } catch (UnsatisfiedLinkError var11) {
  706.          }
  707.       }
  708.  
  709.       JScriptRuntimeInstance var24 = JScriptScheduler.SetActRTI(var15);
  710.       if (var24 != this) {
  711.          HoldJavaEnvironment.AddToProtocol("@@@@ ERROR in RTI - Verwaltung " + this + " != " + var24);
  712.       }
  713.  
  714.    }
  715.  
  716.    public synchronized void YieldBrowser() {
  717.       this.bDoUpdateBrowser = true;
  718.       this.notifyAll();
  719.    }
  720.  
  721.    private synchronized void WaitForDebugger() {
  722.       this.ClearDebugContinueFlag();
  723.       this.bDoUpdateBrowser = false;
  724.  
  725.       try {
  726.          while(!this.bDbgContinue) {
  727.             this.wait();
  728.             if (this.bDoUpdateBrowser) {
  729.                this.bDoUpdateBrowser = false;
  730.                this.aJScriptManager.Browser_DirectShowInfos();
  731.                JScriptAction var1 = new JScriptAction(221, this, this);
  732.                if (this.aDebugInterface != null) {
  733.                   this.aDebugInterface.HandleMessage(var1);
  734.                } else if (this.aMessageInterface != null) {
  735.                   this.aMessageInterface.HandleMessage(var1);
  736.                }
  737.             }
  738.          }
  739.  
  740.       } catch (InterruptedException var2) {
  741.       }
  742.    }
  743.  
  744.    private void InitRunData() {
  745.       this.aSourceCodePosition = null;
  746.    }
  747. }
  748.