@@ -7470,12 +7470,17 @@ public static Object eval(Object form, boolean freshLoader) {
7470
7470
Object column = (meta != null ? meta .valAt (RT .COLUMN_KEY , COLUMN .deref ()) : COLUMN .deref ());
7471
7471
7472
7472
IPersistentMap bindings = RT .mapUniqueKeys (LINE , line , COLUMN , column );
7473
+
7474
+ // [STORM] For each evaluation, before macroexpanding :
7475
+ // We add this same code on the compile path
7476
+ // Supporting the compile path is useful only for debugging, like using
7477
+ // clj-java-decompiler
7478
+ // ------------------------------------------------------------------------
7473
7479
7474
7480
Integer formId = null ;
7475
7481
HashSet <String > formCoords = null ;
7476
7482
Object origForm = form ;
7477
-
7478
- // [STORM] For each evaluation, before macroexpanding :
7483
+
7479
7484
if (form != null &&
7480
7485
!Emitter .skipInstrumentation (munge (currentNS ().toString ()))) {
7481
7486
if (!Utils .isAnnoyingLeinNreplForm (origForm )) {
@@ -7494,6 +7499,7 @@ public static Object eval(Object form, boolean freshLoader) {
7494
7499
System .out .println ("ClojureStorm: skipping lein initialization form instrumentation being evaluated in " + currentNS ().toString ());
7495
7500
}
7496
7501
}
7502
+ // ------------------------------------------------------------------------
7497
7503
if (meta != null ) {
7498
7504
Object eval_file = meta .valAt (RT .EVAL_FILE_KEY );
7499
7505
if (eval_file != null ) {
@@ -8175,15 +8181,50 @@ CONSTANT_IDS, new IdentityHashMap(),
8175
8181
for (Object r = LispReader .read (pushbackReader , false , EOF , false , readerOpts ); r != EOF ;
8176
8182
r = LispReader .read (pushbackReader , false , EOF , false , readerOpts ))
8177
8183
{
8178
-
8184
+
8185
+ // [STORM] For each evaluation, before macroexpanding :
8186
+ // We add this same code on the compile path
8187
+ // Supporting the compile path is useful only for debugging, like using
8188
+ // clj-java-decompiler
8189
+ // ------------------------------------------------------------------------
8190
+
8191
+ Object origForm = r ;
8192
+ Integer formId = null ;
8193
+ HashSet <String > formCoords = null ;
8194
+ boolean stormPushedBindings = false ;
8195
+ if (r != null &&
8196
+ !Emitter .skipInstrumentation (munge (currentNS ().toString ()))) {
8197
+ if (!Utils .isAnnoyingLeinNreplForm (origForm )) {
8198
+ // Calculate the form id
8199
+ formId = r .hashCode ();
8200
+ formCoords = new HashSet ();
8201
+
8202
+ // Tag the coords
8203
+ r = Utils .tagStormCoord (r );
8204
+
8205
+ // Bind FORM_ID so everything down the road knows what form
8206
+ // they belong to
8207
+ Var .pushThreadBindings (
8208
+ RT .mapUniqueKeys (FORM_ID , formId ,
8209
+ FORM_COORDS , formCoords ));
8210
+ stormPushedBindings = true ;
8211
+ } else {
8212
+ System .out .println ("ClojureStorm: skipping lein initialization form instrumentation being evaluated in " + currentNS ().toString ());
8213
+ }
8214
+ }
8215
+ // ------------------------------------------------------------------------
8179
8216
LINE_AFTER .set (pushbackReader .getLineNumber ());
8180
8217
COLUMN_AFTER .set (pushbackReader .getColumnNumber ());
8181
8218
compile1 (gen , objx , r );
8182
8219
LINE_BEFORE .set (pushbackReader .getLineNumber ());
8183
8220
COLUMN_BEFORE .set (pushbackReader .getColumnNumber ());
8184
8221
8222
+ if (stormPushedBindings ) Var .popThreadBindings ();
8185
8223
}
8186
8224
8225
+ // generate forms registration
8226
+ Emitter .emitFormsRegistration (gen , forms , sourcePath );
8227
+
8187
8228
//end of load
8188
8229
gen .returnValue ();
8189
8230
gen .endMethod ();
0 commit comments