From: <fra...@us...> - 2009-04-28 04:22:20
|
Revision: 1456 http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=1456&view=rev Author: frankrimlinger Date: 2009-04-28 04:22:10 +0000 (Tue, 28 Apr 2009) Log Message: ----------- Figured out MJI. The MJI documentation is possibly a little stale, insofar as it is not necessary to mangle method names at all. Works just fine without it. This might lead to trouble down the road, but for now, oh well. In any case, MJI has has nothing like the raw nastiness of real JNI programming, thank goodness. Successfully tested the MJI scan() method, which invokes a method using reflection, and set the SCANNER.scannerPhase to BEGIN. A modified version of INVOKESTATIC was able to detect the phase change, so I am now able to flip between "jpf mode" and "scanner mode". The ScannerMJI class hosts the native declarations for MJI. This is intentionally not a scalable solution, because I really don't want to go nuts writing MJI. I did replace the file-io /tmp hack to pass parameters to MangoTargetLauncher, instead picking up the target class name with MJI. This is good example of a proper use for MJI, where other solutions are fragile. Unfortunately, because both jpf and scanner execution must be supported, the entire set of scanner bytecodes must be retooled. The nominal jpf versions MUST be present, together with a the scanner versions. The chosen version will then be selected according to scannerPhase. Phase change: JPF->BEGIN->SCAN->END->JPF The MJI scan() method transits from JPF to BEGIN Invocations may transit from BEGIN to SCAN Returns may transit from SCAN to END. Finally, MangoTargetLauncher explicitly transits from END to JPF when a target method returns. This should be enough phase change to keep everyone out of trouble. Modified Paths: -------------- branches/mango/MangoJPF/javapathfinder-mango-bridge/gov/nasa/jpf/SCANNER.java branches/mango/MangoJPF/javapathfinder-mango-bridge/mango/scanner/MangoTargetLauncher.java Added Paths: ----------- branches/mango/MangoJPF/javapathfinder-mango-bridge/gov/nasa/jpf/jvm/JPF_mango_scanner_ScannerMJI.java branches/mango/MangoJPF/javapathfinder-mango-bridge/mango/scanner/ScannerMJI.java Removed Paths: ------------- branches/mango/MangoJPF/javapathfinder-mango-bridge/mango/scanner/ScannerModeTrigger.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |