JavaMethod.st
branchdevelopment
changeset 2902 b7070e447ed0
parent 2888 5b492b74975f
child 2992 732f9db2a195
equal deleted inserted replaced
2901:ec6e8825f168 2902:b7070e447ed0
  1103 
  1103 
  1104     "Modified: / 23-11-2010 / 19:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1104     "Modified: / 23-11-2010 / 19:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1105 !
  1105 !
  1106 
  1106 
  1107 methodArgAndVarNamesInContext: context
  1107 methodArgAndVarNamesInContext: context
  1108     | pc |
  1108     | pc stop |
       
  1109 
       
  1110     self isNative ifTrue:[
       
  1111         ^ self methodArgNames
       
  1112     ]. 
       
  1113 
       
  1114     context isJavaContext ifTrue:[
       
  1115         pc := context pc.
       
  1116     ] ifFalse:[
       
  1117         "/ It may happen that the context for Java method is not
       
  1118         "/ a JavaContext. This is true for some code-saver functions
       
  1119         "/ such as __retInst1(), __retSelf1() and so on. In that case,
       
  1120         "/ method sould be simple enough to have no nested scopes
       
  1121         "/ or local variables. Forcing pc := 0 therefore works fine
       
  1122         pc := 0.
       
  1123     ].
  1109 
  1124 
  1110     localVariableTable isNil ifTrue:[^self methodArgNames , self methodVarNames ].
  1125     localVariableTable isNil ifTrue:[^self methodArgNames , self methodVarNames ].
  1111     pc := context pc.
  1126 
  1112 
  1127     stop := context arg1Index - 1 + self numArgs + self numVars.
  1113     ^(1 to: self numArgs + self numVars) collect:[:i|
  1128     stop := stop min: context size.
       
  1129 
       
  1130     ^(1 to: stop) collect:[:i|
  1114         (localVariableTable nameForSlot: i - 1 atPC: pc) ? '<inaccessible>'.
  1131         (localVariableTable nameForSlot: i - 1 atPC: pc) ? '<inaccessible>'.
  1115     ].
  1132     ].
  1116 
  1133 
  1117     "Created: / 18-12-2012 / 18:17:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1134     "Created: / 18-12-2012 / 18:17:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1118     "Modified: / 08-10-2013 / 12:02:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1135     "Modified: / 05-11-2013 / 17:28:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1136 !
       
  1137 
       
  1138 methodArgAndVarValuesInContext: context
       
  1139     | pc stop |
       
  1140 
       
  1141     localVariableTable isNil ifTrue:[
       
  1142         | values |
       
  1143 
       
  1144         values := Array new: context size.
       
  1145         values replaceFrom: 1  count: context size with: context  startingAt: 1.
       
  1146         ^ values.
       
  1147     ].
       
  1148     context isJavaContext ifTrue:[
       
  1149         pc := context pc.
       
  1150     ] ifFalse:[
       
  1151         "/ It may happen that the context for Java method is not
       
  1152         "/ a JavaContext. This is true for some code-saver functions
       
  1153         "/ such as __retInst1(), __retSelf1() and so on. In that case,
       
  1154         "/ method sould be simple enough to have no nested scopes
       
  1155         "/ or local variables. Forcing pc := 0 therefore works fine
       
  1156         pc := 0.
       
  1157     ].
       
  1158 
       
  1159     stop := context arg1Index - 1 + self numArgs + self numVars.
       
  1160     stop := stop min: context size.
       
  1161 
       
  1162 
       
  1163     ^(1 to: stop) collect:[:i|     
       
  1164         (localVariableTable nameForSlot: i - 1 atPC: pc) notNil ifTrue:[
       
  1165             context at: i
       
  1166         ] ifFalse:[
       
  1167             nil
       
  1168         ].
       
  1169     ].
       
  1170 
       
  1171     "Created: / 04-11-2013 / 18:53:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1172     "Modified: / 05-11-2013 / 17:28:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1119 !
  1173 !
  1120 
  1174 
  1121 methodArgNames
  1175 methodArgNames
  1122     |nA|
  1176     |nA|
  1123 
  1177 
  2413 
  2467 
  2414     "Created: / 06-03-2011 / 22:57:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
  2468     "Created: / 06-03-2011 / 22:57:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
  2415 !
  2469 !
  2416 
  2470 
  2417 isWrapped
  2471 isWrapped
  2418     ^ self isBreakpointed
  2472     ^ super isWrapped
  2419 
  2473 "/    ^ self isBreakpointed
  2420     "Modified: / 11.1.1998 / 13:28:43 / cg"
  2474 
  2421     "Created: / 11.1.1998 / 13:38:04 / cg"
  2475     "Created: / 11-01-1998 / 13:38:04 / cg"
       
  2476     "Modified: / 05-11-2013 / 16:19:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2422 !
  2477 !
  2423 
  2478 
  2424 lineNumberForPC0: pc 
  2479 lineNumberForPC0: pc 
  2425     | last |
  2480     | last |
  2426 
  2481