Update bytecode and constpool upon context restart. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 19 Apr 2013 13:50:19 +0200
branchdevelopment
changeset 2532 64a784c73d1e
parent 2531 cce7791abdb1
child 2533 5e9a3673a297
Update bytecode and constpool upon context restart. This way the restarted method can execute new code. This allows for fix & continue workflow. Should check for exceptions - will do it later.
JavaContext.st
--- a/JavaContext.st	Fri Apr 19 10:29:55 2013 +0200
+++ b/JavaContext.st	Fri Apr 19 13:50:19 2013 +0200
@@ -412,6 +412,22 @@
 
 !JavaContext methodsFor:'non local control flow'!
 
+restart
+    "Update the bytecode before restarting so
+     bytecode interpreter can execute new code, if any"
+
+     | m |
+
+    m := self method.
+    m notNil ifTrue:[
+         byteCode := m byteCode.
+         constPool := m constantPool.
+    ].
+    ^super restart.
+
+    "Created: / 19-04-2013 / 13:33:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 return
     selector last == $V ifTrue:[ ^ self return:nil  ].
     selector last == $; ifTrue:[ ^ self return:nil  ].