summaryrefslogtreecommitdiff
path: root/src/pdacodegen.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2013-12-22 15:20:37 -0500
committerAdrian Thurston <thurston@complang.org>2013-12-22 15:20:37 -0500
commit579e3b956f02915b67b4ad36d2beba764a61ddd7 (patch)
tree32f38f5cd6b9c2aec7a7ffb1f14293a3a2ae52b1 /src/pdacodegen.cc
parentc4d8e657810167b3a76e03ce1306f3948da9228f (diff)
downloadcolm-579e3b956f02915b67b4ad36d2beba764a61ddd7.tar.gz
include the LocalInfo array in FrameInfo
Diffstat (limited to 'src/pdacodegen.cc')
-rw-r--r--src/pdacodegen.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/pdacodegen.cc b/src/pdacodegen.cc
index 8ce95216..bd8fa0a1 100644
--- a/src/pdacodegen.cc
+++ b/src/pdacodegen.cc
@@ -140,6 +140,22 @@ void PdaCodeGen::writeRuntimeData( RuntimeData *runtimeData, PdaTables *pdaTable
}
out << "\n};\n\n";
}
+
+ if ( runtimeData->frameInfo[i].localsLen > 0 ) {
+ out << "static LocalInfo locals_" << i << "[] = {\n\t";
+
+ LocalInfo *li = runtimeData->frameInfo[i].locals;
+ for ( int j = 0; j < runtimeData->frameInfo[i].localsLen; j++ ) {
+ out << "{ " << (int)li[j].type << ", " << li[j].offset << " }";
+
+ if ( j < runtimeData->frameInfo[i].localsLen-1 ) {
+ out << ", ";
+ if ( (j+1) % 8 == 0 )
+ out << "\n\t";
+ }
+ }
+ out << "\n};\n\n";
+ }
}
/*
@@ -265,6 +281,14 @@ void PdaCodeGen::writeRuntimeData( RuntimeData *runtimeData, PdaTables *pdaTable
out << runtimeData->frameInfo[i].itersLen << ", ";
+ /* locals. */
+ if ( runtimeData->frameInfo[i].localsLen > 0 )
+ out << "locals_" << i << ", ";
+ else
+ out << "0, ";
+
+ out << runtimeData->frameInfo[i].localsLen << ", ";
+
out <<
runtimeData->frameInfo[i].argSize << ", " <<
runtimeData->frameInfo[i].frameSize;