- Optimization: common parameters to built in functions are no longer looked up as a string at each call, instead their integer ids are global constants

- Optimization: some other minor tweaks.
 - Nicer --help message

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@783 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-12-24 02:04:45 +00:00
parent b79f52db84
commit 547a48b98d
23 changed files with 232 additions and 134 deletions
+3 -3
View File
@@ -242,7 +242,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
size_t scope = openScope();
// prepare arguments
for (unsigned int j = 0 ; j < i.data ; ++j) {
setVariable(instr[i.data - j - 1].data, stack.back());
setVariable((Variable)instr[i.data - j - 1].data, stack.back());
stack.pop_back();
}
instr += i.data; // skip arguments, there had better not be any jumps into the argument list
@@ -267,14 +267,14 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
case I_GET_VAR: {
ScriptValueP value = variables[i.data].value;
if (!value) {
value = new_intrusive1<ScriptMissingVariable>(variable_to_string(i.data)); // no errors here
value = new_intrusive1<ScriptMissingVariable>(variable_to_string((Variable)i.data)); // no errors here
}
stack.push_back(value);
break;
}
// Set a variable (as normal)
case I_SET_VAR: {
setVariable(i.data, stack.back());
setVariable((Variable)i.data, stack.back());
break;
}