Java Doc for JVM.java in  » Code-Analyzer » javapathfinder » gov » nasa » jpf » jvm » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » javapathfinder » gov.nasa.jpf.jvm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gov.nasa.jpf.jvm.JVM

JVM
public class JVM implements VM(Code)
This class represents the virtual machine. The virtual machine is able to move backward and forward one transition at a time.

Inner Class :class JVMState implements VMState

Field Summary
protected  String[]args
    
 booleanatomicLines
    
protected  StackbacktrackStack
    
final protected  Class[]cgArgTypes
    
protected  Object[]cgArgs
    
 booleancheckFP
    
 booleancheckFPcompare
    
 Configconfig
    
protected static  interror_id
     The number of errors saved so far.
 booleanindentOutput
    
protected static  JVMjvm
    
 ClassInfolastClassInfo
    
 ElementInfolastElementInfo
    
 InstructionlastInstruction
    
 ThreadInfolastThreadInfo
    
 TrailInfolastTrailInfo
     various caches for VMListener state acqusition.
 VMListenerlistener
    
protected  StringmainClassName
    
 InstructionnextInstruction
    
public static  HashSetobservableInvokes
     Contains the list of invoke instructions which are observable.
public static  HashSetobservableLabels
     Contains the list of the labels which are observable.
public static  HashSetobservablePositions
     Contains the list of the positions which are observable.
public static  HashSetobservableReturns
     Contains the list of methods whose return instruction are observable.
protected  StringBufferout
    
protected  Pathpath
    
 booleanpathOutput
    
 booleanrunGc
    
protected  SystemStatess
    
protected  StackstateBacktrackStack
    
 StateSetstateSet
    
protected  StackstateStoringStack
    
 booleantreeOutput
    

Constructor Summary
public  JVM(Config conf)
    

Method Summary
public  voidaddListener(VMListener newListener)
    
 voidaddListeners(Config config)
    
public  voidaddObservable(String observable)
    
 voidappendOutput(String s)
    
 voidappendOutput(char c)
    
public  booleanbacktrack()
     Moves one step backward.
 voidbacktrackKernelState()
    
 voidbacktrackSystemState()
    
public  booleancheckFP()
    
static  booleancheckModelClassAccess()
     do we see our model classes? Some of them cannot be used from the standard CLASSPATH, because they are tightly coupled with the JPF core (e.g.
public  booleancheckNaN(double r)
    
public  booleancheckNaN(float r)
    
public  booleancheckNaNcompare(float r1, float r2)
    
public  booleancheckNaNcompare(double r1, double r2)
    
public  BooleanChoiceGeneratorcreateBooleanChoiceGenerator()
    
public  ChoiceGeneratorcreateChoiceGenerator(String id)
    
public  IntChoiceGeneratorcreateIntChoiceGenerator(int min, int max)
    
protected  ThreadInfocreateMainThread()
    
public  ThreadInfocreateThread(int objRef)
    
 booleanfinalizeObject(ElementInfo ei)
    
public  booleanforward()
    
public  intgetAbstractionNonDeterministicThreadCount()
    
public  intgetAliveThreadCount()
    
public  String[]getArgs()
    
public  ChoiceGeneratorgetChoiceGenerator()
    
public  ClassInfogetClassInfo()
    
public  ReferencegetClassReference(String name)
    
public  DynamicAreagetDynamicArea()
    
public  ExceptiongetException()
    
 InstructiongetInstruction()
    
public  KernelStategetKernelState()
    
public  ClassInfogetLastClassInfo()
    
public  ElementInfogetLastElementInfo()
    
public  InstructiongetLastInstruction()
    
public  StepgetLastStep()
    
public  ThreadInfogetLastThreadInfo()
    
public  TransitiongetLastTransition()
    
public  StringgetMainClassName()
    
public  InstructiongetNextInstruction()
    
public  PathgetPath()
    
public  intgetPathLength()
    
public  ExceptionInfogetPendingException()
    
public  ReferencegetReference(String name)
    
public  VMStategetRestorableForwardState()
    
public  intgetRunnableThreadCount()
    
public  VMStategetState()
    
public  intgetStateId()
    
 StaticAreagetStaticArea()
    
public  SystemStategetSystemState()
     Gets the system state.
public  StringgetThreadName()
    
public  intgetThreadNumber()
    
static  JVMgetVM()
    
public  booleanhasPendingException()
    
public  voidinitFields(Config config)
    
static  voidinitStaticFields()
     initialize all our static fields.
 voidinitSubsystems(Config config)
    
public  booleaninitialize()
     load and initialize startup classes, return 'true' if successful. This loads a bunch of core library classes, initializes the main thread, and then all the required startup classes, but excludes the static init of the main class.
protected  voidinitializeStartupClasses()
    
public  booleanisBoringState()
    
public  booleanisDeadlocked()
    
public  booleanisEndState()
    
public  booleanisInterestingState()
    
public  booleanisNewState()
     answers if the current state already has been visited.
public  booleanisTerminated()
    
protected  voidloadClass(ClassInfo ci)
    
public  PathloadPath(String fname)
    
protected  voidloadStartupClasses()
    
 voidnotifyClassLoaded(ClassInfo ci)
    
 voidnotifyExceptionThrown(ThreadInfo ti, ElementInfo ei)
    
 voidnotifyGCBegin()
    
 voidnotifyGCEnd()
    
 voidnotifyInstructionExecuted(ThreadInfo ti, Instruction insn, Instruction nextInsn)
    
 voidnotifyObjectCreated(ThreadInfo ti, ElementInfo ei)
    
 voidnotifyObjectReleased(ElementInfo ei)
    
 voidnotifyThreadStarted(ThreadInfo ti)
    
 voidnotifyThreadTerminated(ThreadInfo ti)
    
public  voidpopKernelState()
    
 voidprepareMain(Config config)
    
 voidprepareMainClinit(Config config)
    
public  voidprint(String s)
    
public  voidprint(boolean b)
    
public  voidprint(char c)
    
public  voidprint(int i)
    
public  voidprint(long l)
    
public  voidprint(double d)
    
public  voidprint(float f)
    
public  voidprintCurrentStackTrace()
     Prints the current stack trace.
public  voidprintResults(PrintWriter pw)
    
public  voidprintStackTraces(PrintWriter pw)
    
public  voidprintStatus()
    
public  voidprintln(String s)
    
public  voidprintln()
    
public  voidpushKernelState()
     Saves the state of the system.
public  voidpushSystemState()
     Saves the backtracking information.
public  voidremoveListener(VMListener removeListener)
    
public  voidrestoreState(VMState st)
    
public  voidrewind()
    
public  voidsavePath(Path path, Writer w)
    
public  voidsetIgnoreState(boolean b)
     override the state matching - ignore this state, no matter if we changed the heap or stacks.
public  voidsetPath(Path p)
    
 voidupdatePath()
     store the current SystemState's TrainInfo in our path, after updating it with whatever annotations the JVM wants to add.

Field Detail
args
protected String[] args(Code)



atomicLines
boolean atomicLines(Code)



backtrackStack
protected Stack backtrackStack(Code)
and that adds the SystemState specifics (Scheduler)



cgArgTypes
final protected Class[] cgArgTypes(Code)



cgArgs
protected Object[] cgArgs(Code)



checkFP
boolean checkFP(Code)



checkFPcompare
boolean checkFPcompare(Code)



config
Config config(Code)



error_id
protected static int error_id(Code)
The number of errors saved so far. Used to generate the name of the error trail file.



indentOutput
boolean indentOutput(Code)



jvm
protected static JVM jvm(Code)
<2do> - this is a hack to be removed once there are no static references anymore



lastClassInfo
ClassInfo lastClassInfo(Code)



lastElementInfo
ElementInfo lastElementInfo(Code)



lastInstruction
Instruction lastInstruction(Code)



lastThreadInfo
ThreadInfo lastThreadInfo(Code)



lastTrailInfo
TrailInfo lastTrailInfo(Code)
various caches for VMListener state acqusition. NOTE - these are only valid during notification



listener
VMListener listener(Code)
potential execution listeners



mainClassName
protected String mainClassName(Code)



nextInstruction
Instruction nextInstruction(Code)



observableInvokes
public static HashSet observableInvokes(Code)
Contains the list of invoke instructions which are observable.



observableLabels
public static HashSet observableLabels(Code)
Contains the list of the labels which are observable.



observablePositions
public static HashSet observablePositions(Code)
Contains the list of the positions which are observable.



observableReturns
public static HashSet observableReturns(Code)
Contains the list of methods whose return instruction are observable.



out
protected StringBuffer out(Code)
execution path to current state



path
protected Path path(Code)
main() arguments



pathOutput
boolean pathOutput(Code)



runGc
boolean runGc(Code)



ss
protected SystemState ss(Code)



stateBacktrackStack
protected Stack stateBacktrackStack(Code)
that's mostly JPFs execution context (atomicity etc.)



stateSet
StateSet stateSet(Code)
the repository we use to find out if we already have seen a state



stateStoringStack
protected Stack stateStoringStack(Code)
where we keep the saved KernelState data



treeOutput
boolean treeOutput(Code)




Constructor Detail
JVM
public JVM(Config conf) throws Config.Exception(Code)
VM instances are another example of evil throw-up ctors, but this is justified by the fact that they are only created via (configured) reflection from within the safe confines of the JPF ctor - which shields clients against blowups




Method Detail
addListener
public void addListener(VMListener newListener)(Code)



addListeners
void addListeners(Config config) throws Config.Exception(Code)



addObservable
public void addObservable(String observable)(Code)



appendOutput
void appendOutput(String s)(Code)



appendOutput
void appendOutput(char c)(Code)



backtrack
public boolean backtrack()(Code)
Moves one step backward. This method and forward() are the main methods used by the search object. Note this is called with the state that caused the backtrack still being on the stack, so we have to remove that one first (i.e. popping two states and restoring the second one)



backtrackKernelState
void backtrackKernelState()(Code)



backtrackSystemState
void backtrackSystemState()(Code)



checkFP
public boolean checkFP()(Code)



checkModelClassAccess
static boolean checkModelClassAccess()(Code)
do we see our model classes? Some of them cannot be used from the standard CLASSPATH, because they are tightly coupled with the JPF core (e.g. java.lang.Class, java.lang.Thread, java.lang.StackTraceElement etc.) Our strategy here is kind of lame - we just look into java.lang.Class, if we find the 'int cref' field (that's a true '42')



checkNaN
public boolean checkNaN(double r)(Code)



checkNaN
public boolean checkNaN(float r)(Code)



checkNaNcompare
public boolean checkNaNcompare(float r1, float r2)(Code)



checkNaNcompare
public boolean checkNaNcompare(double r1, double r2)(Code)



createBooleanChoiceGenerator
public BooleanChoiceGenerator createBooleanChoiceGenerator()(Code)



createChoiceGenerator
public ChoiceGenerator createChoiceGenerator(String id)(Code)



createIntChoiceGenerator
public IntChoiceGenerator createIntChoiceGenerator(int min, int max)(Code)



createMainThread
protected ThreadInfo createMainThread()(Code)
be careful - everything that's executed from within here is not allowed to depend on static class init having been done yet



createThread
public ThreadInfo createThread(int objRef)(Code)



finalizeObject
boolean finalizeObject(ElementInfo ei)(Code)



forward
public boolean forward()(Code)
try to advance the state forward() and backtrack() are the two primary interfaces towards the Search driver return 'true' if there was an un-executed sequence out of the current state, 'false' if it was completely explored note that the caller still has to check if there is a next state, and if the executed instruction sequence led into a new or already visited state



getAbstractionNonDeterministicThreadCount
public int getAbstractionNonDeterministicThreadCount()(Code)



getAliveThreadCount
public int getAliveThreadCount()(Code)



getArgs
public String[] getArgs()(Code)



getChoiceGenerator
public ChoiceGenerator getChoiceGenerator()(Code)
return the current SystemState's ChoiceGenerator object



getClassInfo
public ClassInfo getClassInfo()(Code)
answer the ClassInfo that was loaded most recently part of the VMListener state acqusition



getClassReference
public Reference getClassReference(String name)(Code)



getDynamicArea
public DynamicArea getDynamicArea()(Code)
return the 'heap' object, which is a global service



getException
public Exception getException()(Code)



getInstruction
Instruction getInstruction()(Code)



getKernelState
public KernelState getKernelState()(Code)



getLastClassInfo
public ClassInfo getLastClassInfo()(Code)
answer the ClassInfo that was loaded most recently part of the VMListener state acqusition (only valid from inside of notification)



getLastElementInfo
public ElementInfo getLastElementInfo()(Code)
answer the Object that was most recently created or collected part of the VMListener state acqusition (only valid from inside of notification)



getLastInstruction
public Instruction getLastInstruction()(Code)
answer the last executed Instruction part of the VMListener state acqusition (only valid from inside of notification)



getLastStep
public Step getLastStep()(Code)



getLastThreadInfo
public ThreadInfo getLastThreadInfo()(Code)
answer the ThreadInfo that was most recently started or finished part of the VMListener state acqusition (only valid from inside of notification)



getLastTransition
public Transition getLastTransition()(Code)



getMainClassName
public String getMainClassName()(Code)



getNextInstruction
public Instruction getNextInstruction()(Code)
answer the next Instruction to execute in the current thread part of the VMListener state acqusition (only valid from inside of notification)



getPath
public Path getPath()(Code)



getPathLength
public int getPathLength()(Code)



getPendingException
public ExceptionInfo getPendingException()(Code)



getReference
public Reference getReference(String name)(Code)



getRestorableForwardState
public VMState getRestorableForwardState()(Code)



getRunnableThreadCount
public int getRunnableThreadCount()(Code)



getState
public VMState getState()(Code)
Bundles up the state of the system for export



getStateId
public int getStateId()(Code)
get the numeric id for the current state Note: this can be called several times (by the search and observers) for every forward()/backtrack(), so we want to cache things a bit



getStaticArea
StaticArea getStaticArea()(Code)
same for "loaded classes", but be advised it will probably go away at some point



getSystemState
public SystemState getSystemState()(Code)
Gets the system state.



getThreadName
public String getThreadName()(Code)



getThreadNumber
public int getThreadNumber()(Code)



getVM
static JVM getVM()(Code)



hasPendingException
public boolean hasPendingException()(Code)



initFields
public void initFields(Config config) throws Config.Exception(Code)



initStaticFields
static void initStaticFields()(Code)
initialize all our static fields. Called from and reset



initSubsystems
void initSubsystems(Config config) throws Config.Exception(Code)



initialize
public boolean initialize()(Code)
load and initialize startup classes, return 'true' if successful. This loads a bunch of core library classes, initializes the main thread, and then all the required startup classes, but excludes the static init of the main class. Note that whatever gets executed in here should NOT contain any non-determinism, since we are not backtrackable yet, i.e. non-determinism in clinits should be constrained to the app class (and classes used by it)



initializeStartupClasses
protected void initializeStartupClasses()(Code)



isBoringState
public boolean isBoringState()(Code)



isDeadlocked
public boolean isDeadlocked()(Code)



isEndState
public boolean isEndState()(Code)



isInterestingState
public boolean isInterestingState()(Code)



isNewState
public boolean isNewState()(Code)
answers if the current state already has been visited. This is mainly used by the searches (to control backtracking), but could also be useful for observers to build up search graphs (based on the state ids)



isTerminated
public boolean isTerminated()(Code)



loadClass
protected void loadClass(ClassInfo ci)(Code)



loadPath
public Path loadPath(String fname)(Code)
load a previously stored path from a file <2do> should be simplified to use the JVMXMLTraceHandler (no use to have different trace formats for the same VM)



loadStartupClasses
protected void loadStartupClasses()(Code)



notifyClassLoaded
void notifyClassLoaded(ClassInfo ci)(Code)



notifyExceptionThrown
void notifyExceptionThrown(ThreadInfo ti, ElementInfo ei)(Code)



notifyGCBegin
void notifyGCBegin()(Code)



notifyGCEnd
void notifyGCEnd()(Code)



notifyInstructionExecuted
void notifyInstructionExecuted(ThreadInfo ti, Instruction insn, Instruction nextInsn)(Code)



notifyObjectCreated
void notifyObjectCreated(ThreadInfo ti, ElementInfo ei)(Code)



notifyObjectReleased
void notifyObjectReleased(ElementInfo ei)(Code)



notifyThreadStarted
void notifyThreadStarted(ThreadInfo ti)(Code)



notifyThreadTerminated
void notifyThreadTerminated(ThreadInfo ti)(Code)



popKernelState
public void popKernelState()(Code)



prepareMain
void prepareMain(Config config)(Code)



prepareMainClinit
void prepareMainClinit(Config config)(Code)



print
public void print(String s)(Code)



print
public void print(boolean b)(Code)



print
public void print(char c)(Code)



print
public void print(int i)(Code)



print
public void print(long l)(Code)



print
public void print(double d)(Code)



print
public void print(float f)(Code)



printCurrentStackTrace
public void printCurrentStackTrace()(Code)
Prints the current stack trace.



printResults
public void printResults(PrintWriter pw)(Code)
JVM specific results



printStackTraces
public void printStackTraces(PrintWriter pw)(Code)



printStatus
public void printStatus()(Code)



println
public void println(String s)(Code)



println
public void println()(Code)



pushKernelState
public void pushKernelState()(Code)
Saves the state of the system.



pushSystemState
public void pushSystemState()(Code)
Saves the backtracking information.



removeListener
public void removeListener(VMListener removeListener)(Code)



restoreState
public void restoreState(VMState st)(Code)



rewind
public void rewind()(Code)



savePath
public void savePath(Path path, Writer w)(Code)



setIgnoreState
public void setIgnoreState(boolean b)(Code)
override the state matching - ignore this state, no matter if we changed the heap or stacks. use this with care, since it prunes whole search subtrees



setPath
public void setPath(Path p)(Code)



updatePath
void updatePath()(Code)
store the current SystemState's TrainInfo in our path, after updating it with whatever annotations the JVM wants to add. This is supposed to be called after each transition we want to keep



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.