JavaMethod.st
changeset 3419 aa30aeb2ee07
parent 3324 a58245c0e83a
child 3466 5c317b796c61
equal deleted inserted replaced
3418:3df0a2df585e 3419:aa30aeb2ee07
    17      of one of the above copright owners. For exact set of such code,
    17      of one of the above copright owners. For exact set of such code,
    18      see the differences between this version and version stx:libjava
    18      see the differences between this version and version stx:libjava
    19      as of 1.9.2010
    19      as of 1.9.2010
    20 "
    20 "
    21 "{ Package: 'stx:libjava' }"
    21 "{ Package: 'stx:libjava' }"
       
    22 
       
    23 "{ NameSpace: Smalltalk }"
    22 
    24 
    23 CompiledCode variableSubclass:#JavaMethod
    25 CompiledCode variableSubclass:#JavaMethod
    24 	instanceVariableNames:'accessFlags selector javaClass descriptor signature lookupObject
    26 	instanceVariableNames:'accessFlags selector javaClass descriptor signature lookupObject
    25 		lineNumberTable localVariableTable source annotations'
    27 		lineNumberTable localVariableTable source annotations'
    26 	classVariableNames:'AbstractMethodInvokationSignal SignatureTypeCodes
    28 	classVariableNames:'AbstractMethodInvokationSignal SignatureTypeCodes
  2330     "Created: / 13-06-2013 / 08:52:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2332     "Created: / 13-06-2013 / 08:52:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2331 ! !
  2333 ! !
  2332 
  2334 
  2333 !JavaMethod methodsFor:'queries'!
  2335 !JavaMethod methodsFor:'queries'!
  2334 
  2336 
  2335 canBeUpdatedFrom: anotherMethod
       
  2336     "Return if receiver can be updated from given method, i.e., if it is safe
       
  2337      to just to take anotherMethod's bytecode. Used to implement fix & restart
       
  2338      workflow"
       
  2339 
       
  2340     "/ Allready jitted method cannot be updated - no way to restart existing context into
       
  2341     "/ new code
       
  2342     self code notNil ifTrue:[ ^ false ].
       
  2343 
       
  2344     "/ Args and their types must match
       
  2345     selector ~~ anotherMethod selector ifTrue: [ ^ false ].
       
  2346 
       
  2347     "/ max stack depth must be smaller or equal of the current
       
  2348     (self numVars + self stackSize) < (anotherMethod numVars + anotherMethod stackSize) ifTrue:[ ^ false ].
       
  2349 
       
  2350     ^true
       
  2351 
       
  2352     "Created: / 18-04-2013 / 23:43:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2353 !
       
  2354 
       
  2355 handlerFor:anException at:pc
  2337 handlerFor:anException at:pc
  2356     "return an exceptionHandlers pc, for an exception of the given type,
  2338     "return an exceptionHandlers pc, for an exception of the given type,
  2357      occurring at pc. Returns nil, if there is none."
  2339      occurring at pc. Returns nil, if there is none."
  2358 
  2340 
  2359     |handlerTable|
  2341     |handlerTable|