]> git.bts.cx Git - sun.git/commitdiff
do not evaluate variables until they are used
authorBen Sherratt <redacted>
Tue, 30 Jan 2024 18:10:47 +0000 (18:10 +0000)
committerBen Sherratt <redacted>
Tue, 30 Jan 2024 18:10:47 +0000 (18:10 +0000)
runtime/src/sun/compiler/vm_generator.c

index 1e9cff3b154e540cb93e9626a02c697113ab7baa..0309257792d04d4c0fb92d06991186ef1b1525b1 100644 (file)
@@ -1001,26 +1001,26 @@ static size_t generateModuleInstructions(VMGeneratorOutputScope *generator, SLTN
                generatorPatchOperand(generator, start, 0, address);
 
                // then do variables
-               for (SLTNode *n = node->moduleStatementsAndDefinitions; n != NULL; n = n->sequenceNext) {
-                       switch (n->sequenceNode->type) {
-                               case SLTNodeTypeFunctionDefinition:
+               //for (SLTNode *n = node->moduleStatementsAndDefinitions; n != NULL; n = n->sequenceNext) {
+               //      switch (n->sequenceNode->type) {
+               //              case SLTNodeTypeFunctionDefinition:
                                        // Do nothing...
-                                       break;
+               //                      break;
 
-                               case SLTNodeTypeVariableDefinition:
-                                       generateStatementInstructions(generator, n->sequenceNode, 0);
-                                       break;
+                               //case SLTNodeTypeVariableDefinition:
+                                       //generateStatementInstructions(generator, n->sequenceNode, 0);
+                               //      break;
 
-                               default:
+               //              default:
                                        //generator_assert_msg(false, "could not define %s", sltNodeTypeToString(n->sequenceNode->type));
-                                       break;
-                       }
-               }
+               //                      break;
+               //      }
+               //}
 
                // statements
                for (SLTNode *n = node->moduleStatementsAndDefinitions; n != NULL; n = n->sequenceNext) {
                        switch (n->sequenceNode->type) {
-                               case SLTNodeTypeVariableDefinition:
+                               //case SLTNodeTypeVariableDefinition:
                                case SLTNodeTypeTypeDefinition:
                                case SLTNodeTypeFunctionDefinition:
                                        // Do nothing...