|
@@ -9,6 +9,7 @@
|
|
*/
|
|
*/
|
|
ResultType runStatement(FUNC) {
|
|
ResultType runStatement(FUNC) {
|
|
ResultType type = R_not;
|
|
ResultType type = R_not;
|
|
|
|
+ bool run_gc = st->next == NULL; // 若st已经没有下一部了则执行gc
|
|
setResultCore(result);
|
|
setResultCore(result);
|
|
gc_addTmpLink(&belong->gc_status);
|
|
gc_addTmpLink(&belong->gc_status);
|
|
|
|
|
|
@@ -33,33 +34,43 @@ ResultType runStatement(FUNC) {
|
|
break;
|
|
break;
|
|
case operation:
|
|
case operation:
|
|
type = operationStatement(CNEXT);
|
|
type = operationStatement(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case set_class:
|
|
case set_class:
|
|
type = setClass(CNEXT);
|
|
type = setClass(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case set_function:
|
|
case set_function:
|
|
type = setFunction(CNEXT);
|
|
type = setFunction(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case slice_:
|
|
case slice_:
|
|
type = elementSlice(CNEXT);
|
|
type = elementSlice(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case call_function:
|
|
case call_function:
|
|
type = callBack(CNEXT);
|
|
type = callBack(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case if_branch:
|
|
case if_branch:
|
|
type = ifBranch(CNEXT);
|
|
type = ifBranch(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case while_branch:
|
|
case while_branch:
|
|
type = whileBranch(CNEXT);
|
|
type = whileBranch(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case for_branch:
|
|
case for_branch:
|
|
type = forBranch(CNEXT);
|
|
type = forBranch(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case with_branch:
|
|
case with_branch:
|
|
type = withBranch(CNEXT);
|
|
type = withBranch(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case try_branch:
|
|
case try_branch:
|
|
type = tryBranch(CNEXT);
|
|
type = tryBranch(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case break_cycle:
|
|
case break_cycle:
|
|
type = breakCycle(CNEXT);
|
|
type = breakCycle(CNEXT);
|
|
@@ -84,12 +95,15 @@ ResultType runStatement(FUNC) {
|
|
break;
|
|
break;
|
|
case include_file:
|
|
case include_file:
|
|
type = includeFile(CNEXT);
|
|
type = includeFile(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case import_file:
|
|
case import_file:
|
|
type = importFile(CNEXT);
|
|
type = importFile(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case from_import_file:
|
|
case from_import_file:
|
|
type = fromImportFile(CNEXT);
|
|
type = fromImportFile(CNEXT);
|
|
|
|
+ run_gc = true;
|
|
break;
|
|
break;
|
|
case default_var:
|
|
case default_var:
|
|
type = setDefault(CNEXT);
|
|
type = setDefault(CNEXT);
|
|
@@ -113,7 +127,8 @@ ResultType runStatement(FUNC) {
|
|
result->node = st;
|
|
result->node = st;
|
|
gc_freeTmpLink(&belong->gc_status);
|
|
gc_freeTmpLink(&belong->gc_status);
|
|
#if START_GC
|
|
#if START_GC
|
|
- gc_run(inter, var_list, 1, 2, 0, var_list, belong, result->value);
|
|
|
|
|
|
+ if (run_gc)
|
|
|
|
+ gc_run(inter, var_list, 1, 2, 0, var_list, belong, result->value);
|
|
#endif
|
|
#endif
|
|
return type;
|
|
return type;
|
|
}
|
|
}
|