1.1 --- a/core/vm/sp_vm_basecontext.cpp Sat Mar 01 07:59:53 2008 +0000
1.2 +++ b/core/vm/sp_vm_basecontext.cpp Sun Mar 02 06:40:59 2008 +0000
1.3 @@ -61,6 +61,12 @@
1.4 ctx = _ctx;
1.5 ctx->context = this;
1.6 ctx->dbreak = GlobalDebugBreak;
1.7 +
1.8 + if (ctx->prof_flags != 0)
1.9 + {
1.10 + ctx->profiler = sm_profiler;
1.11 + }
1.12 +
1.13 m_InExec = false;
1.14 m_CustomMsg = false;
1.15 m_funcsnum = ctx->vmbase->FunctionCount(ctx);
1.16 @@ -150,7 +156,7 @@
1.17 {
1.18 continue;
1.19 }
1.20 - m_pub_funcs[i]->Set(pub->code_offs, this, pub->funcid);
1.21 + m_pub_funcs[i]->Set(pub->code_offs, this, pub->funcid, i);
1.22 }
1.23 }
1.24
1.25 @@ -186,9 +192,16 @@
1.26 {
1.27 return;
1.28 }
1.29 +
1.30 ctx = _ctx;
1.31 ctx->context = this;
1.32 ctx->dbreak = GlobalDebugBreak;
1.33 +
1.34 + if (ctx->prof_flags != 0)
1.35 + {
1.36 + ctx->profiler = sm_profiler;
1.37 + }
1.38 +
1.39 RefreshFunctionCache();
1.40 }
1.41
1.42 @@ -992,10 +1005,18 @@
1.43 pFunc = m_pub_funcs[func_id];
1.44 if (!pFunc)
1.45 {
1.46 - m_pub_funcs[func_id] = new CFunction(ctx->publics[func_id].code_offs, this, ctx->publics[func_id].funcid);
1.47 + m_pub_funcs[func_id] = new CFunction(ctx->publics[func_id].code_offs,
1.48 + this,
1.49 + ctx->publics[func_id].funcid,
1.50 + func_id);
1.51 pFunc = m_pub_funcs[func_id];
1.52 - } else if (pFunc->IsInvalidated()) {
1.53 - pFunc->Set(ctx->publics[func_id].code_offs, this, ctx->publics[func_id].funcid);
1.54 + }
1.55 + else if (pFunc->IsInvalidated())
1.56 + {
1.57 + pFunc->Set(ctx->publics[func_id].code_offs,
1.58 + this,
1.59 + ctx->publics[func_id].funcid,
1.60 + func_id);
1.61 }
1.62 } else {
1.63 /* :TODO: currently not used */
1.64 @@ -1034,16 +1055,20 @@
1.65 GetPublicByIndex(index, &pub);
1.66 if (pub)
1.67 {
1.68 - m_pub_funcs[index] = new CFunction(pub->code_offs, this, pub->funcid);
1.69 + m_pub_funcs[index] = new CFunction(pub->code_offs, this, pub->funcid, index);
1.70 }
1.71 pFunc = m_pub_funcs[index];
1.72 - } else if (pFunc->IsInvalidated()) {
1.73 + }
1.74 + else if (pFunc->IsInvalidated())
1.75 + {
1.76 sp_public_t *pub = NULL;
1.77 GetPublicByIndex(index, &pub);
1.78 if (pub)
1.79 {
1.80 - pFunc->Set(pub->code_offs, this, pub->funcid);
1.81 - } else {
1.82 + pFunc->Set(pub->code_offs, this, pub->funcid, index);
1.83 + }
1.84 + else
1.85 + {
1.86 pFunc = NULL;
1.87 }
1.88 }