{
_module = module;
+ ScanFunctionBody globalCodeInfo;
+ globalCodeInfo(node);
+
IR::Function *globalCode = _module->newFunction(QLatin1String("%entry"));
- globalCode->hasDirectEval = true; // ### remove
- globalCode->hasNestedFunctions = true; // ### remove
- globalCode->redArea = 10; // ### remove
+ globalCode->hasDirectEval = globalCodeInfo.hasDirectEval;
+ globalCode->hasNestedFunctions = true; // ### FIXME: initialize it with globalCodeInfo.hasNestedFunctions;
+ globalCode->maxNumberOfArguments = globalCodeInfo.maxNumberOfArguments;
_function = globalCode;
_block = _function->newBasicBlock();
_exitBlock = _function->newBasicBlock();
IR::BasicBlock *entryBlock = function->newBasicBlock();
IR::BasicBlock *exitBlock = function->newBasicBlock();
function->hasDirectEval = functionInfo.hasDirectEval;
- function->redArea = functionInfo.maxNumberOfArguments;
+ function->maxNumberOfArguments = functionInfo.maxNumberOfArguments;
if (! functionInfo.hasDirectEval) {
for (int i = 0; i < functionInfo.locals.size(); ++i) {
const QString *name;
QVector<BasicBlock *> basicBlocks;
int tempCount;
- int redArea;
+ int maxNumberOfArguments;
QSet<QString> strings;
QList<const QString *> formals;
QList<const QString *> locals;
: module(module)
, pool(&module->pool)
, tempCount(0)
- , redArea(0)
+ , maxNumberOfArguments(0)
, code(0)
, hasDirectEval(false)
, hasNestedFunctions(false)
function->code = (void (*)(VM::Context *)) _code;
_codePtr = _code;
- int locals = (function->tempCount + function->redArea) * sizeof(Value);
+ int locals = (function->tempCount + function->maxNumberOfArguments) * sizeof(Value);
locals = (locals + 15) & ~15;
amd64_push_reg(_codePtr, AMD64_RBP);