|
@@ -685,17 +685,17 @@ int32_t *findEnvVarNumber(char *name, af_Environment *env) {
|
|
|
|
|
|
static void mp_NORMAL(af_Message *msg, bool is_gc, af_Environment *env) {
|
|
static void mp_NORMAL(af_Message *msg, bool is_gc, af_Environment *env) {
|
|
if (msg->msg == NULL || *(af_Object **)msg->msg == NULL) {
|
|
if (msg->msg == NULL || *(af_Object **)msg->msg == NULL) {
|
|
- writeErrorLog(aFunCoreLogger, log_default, "NORMAL msg: %p error", msg->msg);
|
|
|
|
|
|
+ writeErrorLog(aFunCoreLogger, log_d, "NORMAL msg: %p error", msg->msg);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
gc_delReference(*(af_Object **)msg->msg);
|
|
gc_delReference(*(af_Object **)msg->msg);
|
|
if (!is_gc)
|
|
if (!is_gc)
|
|
- writeInfoLog(aFunCoreLogger, log_default, "NORMAL Point: %p", *(af_Object **)msg->msg);
|
|
|
|
|
|
+ writeDebugLog(aFunCoreLogger, log_d, "NORMAL Point: %p", *(af_Object **)msg->msg);
|
|
}
|
|
}
|
|
|
|
|
|
static void mp_ERROR(af_Message *msg, bool is_gc, af_Environment *env) {
|
|
static void mp_ERROR(af_Message *msg, bool is_gc, af_Environment *env) {
|
|
if (msg->msg == NULL || *(af_ErrorInfo **)msg->msg == NULL) {
|
|
if (msg->msg == NULL || *(af_ErrorInfo **)msg->msg == NULL) {
|
|
- writeErrorLog(aFunCoreLogger, log_default, "ERROR msg: %p error", msg->msg);
|
|
|
|
|
|
+ writeErrorLog(aFunCoreLogger, log_d, "ERROR msg: %p error", msg->msg);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (!is_gc)
|
|
if (!is_gc)
|
|
@@ -705,20 +705,20 @@ static void mp_ERROR(af_Message *msg, bool is_gc, af_Environment *env) {
|
|
|
|
|
|
static void mp_IMPORT(af_Message *msg, bool is_gc, af_Environment *env) {
|
|
static void mp_IMPORT(af_Message *msg, bool is_gc, af_Environment *env) {
|
|
if (msg->msg == NULL || *(af_ImportInfo **)msg->msg == NULL) {
|
|
if (msg->msg == NULL || *(af_ImportInfo **)msg->msg == NULL) {
|
|
- writeErrorLog(aFunCoreLogger, log_default, "IMPORT msg: %p error", msg->msg);
|
|
|
|
|
|
+ writeErrorLog(aFunCoreLogger, log_d, "IMPORT msg: %p error", msg->msg);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
af_ImportInfo *ii = *(af_ImportInfo **)msg->msg;
|
|
af_ImportInfo *ii = *(af_ImportInfo **)msg->msg;
|
|
if (ii->obj == NULL) {
|
|
if (ii->obj == NULL) {
|
|
- writeInfoLog(aFunCoreLogger, log_default, "IMPORT msg: %p do not get obj", msg->msg);
|
|
|
|
|
|
+ writeDebugLog(aFunCoreLogger, log_d, "IMPORT msg: %p do not get obj", msg->msg);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
if (ii->mark != NULL) {
|
|
if (ii->mark != NULL) {
|
|
makeVarToProtectVarSpace(ii->mark, 3, 3, 3, ii->obj, env);
|
|
makeVarToProtectVarSpace(ii->mark, 3, 3, 3, ii->obj, env);
|
|
- writeInfoLog(aFunCoreLogger, log_default, "IMPORT point: [%s] %p", ii->mark, ii->obj);
|
|
|
|
|
|
+ writeDebugLog(aFunCoreLogger, log_d, "IMPORT point: [%s] %p", ii->mark, ii->obj);
|
|
} else
|
|
} else
|
|
- writeInfoLog(aFunCoreLogger, log_default, "IMPORT point: <no-name> %p", ii->obj);
|
|
|
|
|
|
+ writeDebugLog(aFunCoreLogger, log_d, "IMPORT point: <no-name> %p", ii->obj);
|
|
freeImportInfo(ii);
|
|
freeImportInfo(ii);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -764,7 +764,7 @@ void freeEnvironment(af_Environment *env) {
|
|
freeAllTopMsgProcess(env->process);
|
|
freeAllTopMsgProcess(env->process);
|
|
|
|
|
|
if (!res)
|
|
if (!res)
|
|
- writeErrorLog(aFunCoreLogger, log_default, "Run iterDestruct error.");
|
|
|
|
|
|
+ writeErrorLog(aFunCoreLogger, log_d, "Run iterDestruct error.");
|
|
free(env);
|
|
free(env);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -811,7 +811,7 @@ bool addTopMsgProcess(char *type, DLC_SYMBOL(TopMsgProcessFunc) func,
|
|
|
|
|
|
static void newActivity(af_Code *bt, const af_Code *next, bool return_first, af_Environment *env){
|
|
static void newActivity(af_Code *bt, const af_Code *next, bool return_first, af_Environment *env){
|
|
if (next == NULL && env->activity->body_next == NULL && env->activity->type == act_func) {
|
|
if (next == NULL && env->activity->body_next == NULL && env->activity->type == act_func) {
|
|
- writeInfoLog(aFunCoreLogger, log_default, "Tail call optimization");
|
|
|
|
|
|
+ writeTrackLog(aFunCoreLogger, "Tail call optimization");
|
|
tailCallActivity(env->activity);
|
|
tailCallActivity(env->activity);
|
|
setActivityBtTop(bt, env->activity);
|
|
setActivityBtTop(bt, env->activity);
|
|
env->activity->optimization = true;
|
|
env->activity->optimization = true;
|
|
@@ -850,7 +850,7 @@ static bool isInfixFunc(af_Code *code, af_Environment *env) {
|
|
bool pushExecutionActivity(af_Code *bt, bool return_first, af_Environment *env) {
|
|
bool pushExecutionActivity(af_Code *bt, bool return_first, af_Environment *env) {
|
|
af_Code *next;
|
|
af_Code *next;
|
|
next = getCodeNext(bt);
|
|
next = getCodeNext(bt);
|
|
- writeInfoLog(aFunCoreLogger, log_default, "Run execution");
|
|
|
|
|
|
+ writeTrackLog(aFunCoreLogger, "Run execution");
|
|
|
|
|
|
if (bt->type != code_block || bt->block.is_empty) {
|
|
if (bt->type != code_block || bt->block.is_empty) {
|
|
pushMessageDown(makeERRORMessage(SYNTAX_ERROR, NOT_CODE_INFO, env), env);
|
|
pushMessageDown(makeERRORMessage(SYNTAX_ERROR, NOT_CODE_INFO, env), env);
|
|
@@ -873,7 +873,7 @@ bool pushFuncActivity(af_Code *bt, af_Environment *env) {
|
|
af_Object *parentheses_call = env->activity->parentheses_call;
|
|
af_Object *parentheses_call = env->activity->parentheses_call;
|
|
env->activity->parentheses_call = NULL;
|
|
env->activity->parentheses_call = NULL;
|
|
|
|
|
|
- writeInfoLog(aFunCoreLogger, log_default, "Run func");
|
|
|
|
|
|
+ writeTrackLog(aFunCoreLogger, "Run func");
|
|
next = getCodeNext(bt);
|
|
next = getCodeNext(bt);
|
|
switch (bt->block.type) {
|
|
switch (bt->block.type) {
|
|
case curly:
|
|
case curly:
|
|
@@ -923,7 +923,7 @@ bool pushFuncActivity(af_Code *bt, af_Environment *env) {
|
|
bool pushLiteralActivity(af_Code *bt, char *data, af_Object *func, af_Environment *env) {
|
|
bool pushLiteralActivity(af_Code *bt, char *data, af_Object *func, af_Environment *env) {
|
|
setActivityBtNext(bt->next, env->activity);
|
|
setActivityBtNext(bt->next, env->activity);
|
|
|
|
|
|
- writeInfoLog(aFunCoreLogger, log_default, "Run literal");
|
|
|
|
|
|
+ writeTrackLog(aFunCoreLogger, "Run literal");
|
|
newActivity(bt, bt->next, false, env);
|
|
newActivity(bt, bt->next, false, env);
|
|
env->activity->is_literal = true;
|
|
env->activity->is_literal = true;
|
|
pushLiteralData(strCopy(data), env); // FuncBody的释放导致code和literal_data释放, 所以要复制
|
|
pushLiteralData(strCopy(data), env); // FuncBody的释放导致code和literal_data释放, 所以要复制
|
|
@@ -933,7 +933,7 @@ bool pushLiteralActivity(af_Code *bt, char *data, af_Object *func, af_Environmen
|
|
bool pushVariableActivity(af_Code *bt, af_Object *func, af_Environment *env) {
|
|
bool pushVariableActivity(af_Code *bt, af_Object *func, af_Environment *env) {
|
|
setActivityBtNext(bt->next, env->activity);
|
|
setActivityBtNext(bt->next, env->activity);
|
|
|
|
|
|
- writeInfoLog(aFunCoreLogger, log_default, "Run variable");
|
|
|
|
|
|
+ writeTrackLog(aFunCoreLogger, "Run variable");
|
|
newActivity(bt, bt->next, false, env);
|
|
newActivity(bt, bt->next, false, env);
|
|
env->activity->is_obj_func = true;
|
|
env->activity->is_obj_func = true;
|
|
return setFuncActivityToArg(func, env);
|
|
return setFuncActivityToArg(func, env);
|
|
@@ -943,7 +943,7 @@ bool pushMacroFuncActivity(af_Object *func, af_Environment *env) {
|
|
/* Macro是隐式调用, bt不移动 */
|
|
/* Macro是隐式调用, bt不移动 */
|
|
/* 沿用activity */
|
|
/* 沿用activity */
|
|
|
|
|
|
- writeInfoLog(aFunCoreLogger, log_default, "Run macro");
|
|
|
|
|
|
+ writeTrackLog(aFunCoreLogger, "Run macro");
|
|
if (!freeVarSpaceListCount(env->activity->new_vs_count, env->activity->var_list)) { // 释放外部变量空间
|
|
if (!freeVarSpaceListCount(env->activity->new_vs_count, env->activity->var_list)) { // 释放外部变量空间
|
|
env->activity->new_vs_count = 0;
|
|
env->activity->new_vs_count = 0;
|
|
pushMessageDown(makeERRORMessage(RUN_ERROR, FREE_VARSPACE_INFO, env), env);
|
|
pushMessageDown(makeERRORMessage(RUN_ERROR, FREE_VARSPACE_INFO, env), env);
|