Rework for git.tesses.org, GC* is std::shared_ptr maybe will fix crash during exit
Some checks failed
Build and Deploy on Tag / update-tap (push) Has been cancelled
Build and Deploy on Tag / build-arch (push) Has been cancelled

This commit is contained in:
2026-04-30 16:00:00 -05:00
parent fca18e63a6
commit 991f2a217d
78 changed files with 1243 additions and 849 deletions

View File

@@ -10,7 +10,7 @@
#include <sstream>
#include <variant>
namespace Tesses::CrossLang {
bool InterperterThread::Add(GC* gc)
bool InterperterThread::Add(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);

View File

@@ -13,7 +13,7 @@
namespace Tesses::CrossLang {
bool Equals(GC* gc, TObject left, TObject right)
bool Equals(std::shared_ptr<GC> gc, TObject left, TObject right)
{
GCList ls(gc);
if(std::holds_alternative<std::nullptr_t>(left) && std::holds_alternative<std::nullptr_t>(right))

View File

@@ -14,7 +14,7 @@
namespace Tesses::CrossLang {
extern bool IHttpServer_Handle(std::shared_ptr<Tesses::Framework::Http::IHttpServer> svr,std::vector<TObject>& args);
bool InterperterThread::ExecuteMethod2(GC* gc, TObject instance, std::string key, std::vector<TObject> args)
bool InterperterThread::ExecuteMethod2(std::shared_ptr<GC> gc, TObject instance, std::string key, std::vector<TObject> args)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -395,7 +395,7 @@ namespace Tesses::CrossLang {
cse.back()->Push(gc, path.GetExtension());
return false;
}
if(cse.back()->env->GetRootEnvironment()->permissions.canRegisterLocalFS && key == "MakeAbsolute")
if(cse.back()->env->GetRootEnvironment()->permissions.localfs && key == "MakeAbsolute")
{
Tesses::Framework::Filesystem::VFSPath p;
if(GetArgumentAsPath(args,0,p))
@@ -405,11 +405,11 @@ namespace Tesses::CrossLang {
}
else
{
cse.back()->Push(gc,path.MakeAbsolute());
cse.back()->Push(gc,path.MakeAbsolute(cse.back()->env->GetRootEnvironment()->permissions.localfs->GetWorking()));
return false;
}
}
if(cse.back()->env->GetRootEnvironment()->permissions.canRegisterLocalFS && key == "MakeRelative")
if(cse.back()->env->GetRootEnvironment()->permissions.localfs && key == "MakeRelative")
{
Tesses::Framework::Filesystem::VFSPath p;
if(GetArgumentAsPath(args,0,p))
@@ -419,7 +419,7 @@ namespace Tesses::CrossLang {
}
else
{
cse.back()->Push(gc,path.MakeRelative());
cse.back()->Push(gc,path.MakeRelative(cse.back()->env->GetRootEnvironment()->permissions.localfs->GetWorking()));
return false;
}
}
@@ -1199,6 +1199,48 @@ namespace Tesses::CrossLang {
cse.back()->Push(gc,Undefined());
return false;
}
else if(std::holds_alternative<std::shared_ptr<Tesses::Framework::Http::ServerSentEvents>>(instance))
{
auto& sse = std::get<std::shared_ptr<Tesses::Framework::Http::ServerSentEvents>>(instance);
if(sse != nullptr)
{
std::string text;
std::string text2;
if(key == "SendComment" && GetArgument(args, 0, text))
{
sse->SendComment(text);
}
else if(key == "SendCustomEvent" && GetArgument(args, 0, text) && GetArgument(args,1,text2)) {
sse->SendCustomEvent(text,text2);
}
else if(key == "SendCustomEvent" && GetArgument(args, 0, text)) {
if(GetArgument(args,1,text2))
sse->SendData(text,text2);
else
sse->SendData(text);
}
else if(key == "SendId" && GetArgument(args, 0, text))
{
sse->SendId(text);
}
else if(key == "SendRetry")
{
std::shared_ptr<Tesses::Framework::Date::TimeSpan> ts;
int64_t num;
if(GetArgument(args,0,ts) && ts)
{
sse->SendRetry(*ts);
}
else if(GetArgument(args,0,num))
{
sse->SendRetry((uint32_t)num);
}
}
}
cse.back()->Push(gc, Undefined());
return false;
}
else if(std::holds_alternative<std::shared_ptr<Tesses::Framework::Streams::Stream>>(instance))
{
auto& strm = std::get<std::shared_ptr<Tesses::Framework::Streams::Stream>>(instance);
@@ -1234,6 +1276,18 @@ namespace Tesses::CrossLang {
}
if(netStrm != nullptr)
{
if(key == "SetMulticastMembership")
{
std::string ma;
std::string ifaceIP = "0.0.0.0";
if(GetArgument(args,0,ma))
{
GetArgument(args,1,ifaceIP);
netStrm->SetMulticastMembership(ma,ifaceIP);
}
cse.back()->Push(gc, Undefined());
return false;
}
if(key == "GetPort")
{
cse.back()->Push(gc, (int64_t)netStrm->GetPort());
@@ -2230,9 +2284,10 @@ namespace Tesses::CrossLang {
}
if(key == "RegisterEverything")
{
if(myEnv->permissions.canRegisterEverything)
if(myEnv->permissions.canRegisterEverything && myEnv->permissions.localfs)
{
TStd::RegisterStd(gc, rootEnv);
TStd::RegisterStd(gc, rootEnv, std::make_shared<RelativeFilesystem>(myEnv->permissions.localfs->GetVFS(),myEnv->permissions.localfs->GetWorking()));
}
else
{
@@ -2250,7 +2305,15 @@ namespace Tesses::CrossLang {
if(myEnv->permissions.canRegisterIO && !rootEnv->permissions.locked)
TStd::RegisterIO(gc, rootEnv, myEnv->permissions.canRegisterLocalFS);
{
if(myEnv->permissions.localfs)
{
TStd::RegisterIO(gc, rootEnv, std::make_shared<RelativeFilesystem>(myEnv->permissions.localfs->GetVFS(),myEnv->permissions.localfs->GetWorking()));
}
else {
TStd::RegisterIO(gc, rootEnv, nullptr);
}
}
if(myEnv->permissions.canRegisterJSON && !rootEnv->permissions.locked)
TStd::RegisterJson(gc, rootEnv);
@@ -2329,7 +2392,15 @@ namespace Tesses::CrossLang {
if(GetArgument(args,0,r))
{
if((myEnv->permissions.canRegisterEverything || myEnv->permissions.canRegisterIO) && !rootEnv->permissions.locked)
TStd::RegisterIO(gc, rootEnv, myEnv->permissions.canRegisterLocalFS ? r : false);
{
if(myEnv->permissions.localfs)
{
TStd::RegisterIO(gc, rootEnv, std::make_shared<RelativeFilesystem>(myEnv->permissions.localfs->GetVFS(),myEnv->permissions.localfs->GetWorking()));
}
else {
TStd::RegisterIO(gc, rootEnv, nullptr);
}
}
}
cse.back()->Push(gc,nullptr);
return false;

View File

@@ -10,7 +10,7 @@
#include <sstream>
#include <variant>
namespace Tesses::CrossLang {
bool InterperterThread::GetField(GC* gc)
bool InterperterThread::GetField(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -47,6 +47,25 @@ namespace Tesses::CrossLang {
cse.back()->Push(gc, Undefined());
return false;
}
if(std::holds_alternative<std::shared_ptr<Tesses::Framework::TF_Timer_Handle>>(instance))
{
auto timer = std::get<std::shared_ptr<Tesses::Framework::TF_Timer_Handle>>(instance);
if(timer)
{
if(key == "Interval")
{
cse.back()->Push(gc, timer->GetIntervalMilliseconds());
return false;
}
if(key == "Enabled")
{
cse.back()->Push(gc, timer->GetEnabled());
return false;
}
}
cse.back()->Push(gc, Undefined());
return false;
}
if(std::holds_alternative<std::shared_ptr<Tesses::Framework::Filesystem::VFS>>(instance))
{
auto vfs = std::get<std::shared_ptr<Tesses::Framework::Filesystem::VFS>>(instance);

View File

@@ -11,7 +11,11 @@
#include <variant>
namespace Tesses::CrossLang {
bool InterperterThread::SetField(GC* gc)
static void empty()
{
}
bool InterperterThread::SetField(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -30,7 +34,61 @@ namespace Tesses::CrossLang {
}
std::string key = std::get<std::string>(_key);
if(std::holds_alternative<std::shared_ptr<Tesses::Framework::TextStreams::TextWriter>>(instance))
if(std::holds_alternative<std::shared_ptr<Tesses::Framework::TF_Timer_Handle>>(instance))
{
auto handle = std::get<std::shared_ptr<Tesses::Framework::TF_Timer_Handle>>(instance);
if(handle)
{
int64_t ms;
bool b;
if(key == "Enabled" && GetObject(value,b))
{
handle->SetEnabled(b);
cse.back()->Push(gc,b);
return false;
}
if(key == "Interval" && GetObject(value, ms))
{
handle->SetIntervalFromMilliseconds(ms);
cse.back()->Push(gc,ms);
return false;
}
if(key == "Callback")
{
TCallable* callable;
if(GetObjectHeap(value,callable))
{
auto obj = CreateMarkedTObject(ls.GetGC(), callable);
handle->SetCallback([obj]()->void {
TCallable* callable;
if(GetObjectHeap(obj->GetObject(), callable))
{
GCList ls(obj->GetGC());
callable->Call(ls,{});
}
});
cse.back()->Push(gc, callable);
return false;
}
else
{
handle->SetCallback(empty);
cse.back()->Push(gc, nullptr);
return false;
}
}
}
cse.back()->Push(gc, Undefined());
return false;
}
if(std::holds_alternative<std::shared_ptr<Tesses::Framework::TextStreams::TextWriter>>(instance))
{
auto writer = std::get<std::shared_ptr<Tesses::Framework::TextStreams::TextWriter>>(instance);
auto stringWriter = std::dynamic_pointer_cast<Tesses::Framework::TextStreams::StringWriter>(writer);
@@ -177,11 +235,19 @@ namespace Tesses::CrossLang {
auto netStrm = std::dynamic_pointer_cast<Tesses::Framework::Streams::NetworkStream>(strm);
if(netStrm != nullptr)
{
int64_t n0;
bool bc;
if(key == "Broadcast" && GetObject(value,bc))
netStrm->SetBroadcast(bc);
if(key == "NoDelay" && GetObject(value,bc))
netStrm->SetNoDelay(bc);
if(key == "ReuseAddress" && GetObject(value,bc))
netStrm->SetReuseAddress(bc);
if(key == "ReusePort" && GetObject(value,bc))
netStrm->SetReusePort(bc);
if(key == "MulticastTTL" && GetObject(value,n0))
netStrm->SetMulticastTTL((uint8_t)n0);
}
stk->Push(gc, Undefined());
return false;

View File

@@ -10,7 +10,7 @@
#include <sstream>
#include <variant>
namespace Tesses::CrossLang {
bool InterperterThread::Sub(GC* gc)
bool InterperterThread::Sub(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);

View File

@@ -10,7 +10,7 @@
#include <sstream>
#include <variant>
namespace Tesses::CrossLang {
std::string ToString(GC* gc, TObject o)
std::string ToString(std::shared_ptr<GC> gc, TObject o)
{
if(std::holds_alternative<Tesses::Framework::Filesystem::VFSPath>(o))
{

View File

@@ -11,7 +11,7 @@ namespace Tesses::CrossLang
{
TFile* f = new TFile();
f->icon = -1;
GC* _gc = ls.GetGC();
std::shared_ptr<GC> _gc = ls.GetGC();
ls.Add(f);
_gc->Watch(f);
return f;
@@ -20,7 +20,7 @@ namespace Tesses::CrossLang
{
TFile* f = new TFile();
f->icon=-1;
GC* _gc = ls->GetGC();
std::shared_ptr<GC> _gc = ls->GetGC();
ls->Add(f);
_gc->Watch(f);
return f;
@@ -35,7 +35,7 @@ namespace Tesses::CrossLang
TFileChunk* TFileChunk::Create(GCList& ls)
{
TFileChunk* chk = new TFileChunk();
GC* _gc = ls.GetGC();
std::shared_ptr<GC> _gc = ls.GetGC();
ls.Add(chk);
_gc->Watch(chk);
return chk;
@@ -43,7 +43,7 @@ namespace Tesses::CrossLang
TFileChunk* TFileChunk::Create(GCList* ls)
{
TFileChunk* chk = new TFileChunk();
GC* _gc = ls->GetGC();
std::shared_ptr<GC> _gc = ls->GetGC();
ls->Add(chk);
_gc->Watch(chk);
return chk;
@@ -280,7 +280,7 @@ namespace Tesses::CrossLang
return nullptr;
}
void TFile::Load(GC* gc, std::shared_ptr<Tesses::Framework::Streams::Stream> stream)
void TFile::Load(std::shared_ptr<GC> gc, std::shared_ptr<Tesses::Framework::Streams::Stream> stream)
{
uint8_t main_header[18];

View File

@@ -71,7 +71,7 @@ namespace Tesses::CrossLang
ls.GetGC()->BarrierEnd();
th->thrd =new Thread([th]()->void {
GC* gc=th->gc;
std::shared_ptr<GC> gc=th->gc;
GCList ls(gc);
ls.Add(th);
th->hasInit=true;
@@ -241,14 +241,14 @@ namespace Tesses::CrossLang
delete this->mtx;
}
void GC::RegisterEverythingCallback(std::function<void(GC* gc, TRootEnvironment* env)> cb)
void GC::RegisterEverythingCallback(std::function<void(std::shared_ptr<GC> gc, TRootEnvironment* env)> cb)
{
this->register_everything.push_back(cb);
}
void GC::RegisterEverything(TRootEnvironment* env)
{
for(auto item : this->register_everything)
item(this,env);
item(this->shared_from_this(),env);
}
void GC::Collect()
{

View File

@@ -2,21 +2,15 @@
namespace Tesses::CrossLang
{
GCList::GCList(GC* gc)
GCList::GCList(std::shared_ptr<GC> gc)
{
gc->BarrierBegin();
this->gc = gc;
gc->SetRoot(this);
gc->BarrierEnd();
}
GCList::GCList(GC& gc)
{
gc.BarrierBegin();
this->gc = &gc;
gc.SetRoot(this);
gc.BarrierEnd();
}
GC* GCList::GetGC()
std::shared_ptr<GC> GCList::GetGC()
{
return this->gc;
}

View File

@@ -36,9 +36,9 @@ namespace Tesses::CrossLang {
#define TVM_HANDLER(hndl) if(hndl(gc)) goto execute
typedef bool (InterperterThread::*opcode)(GC* gc);
typedef bool (InterperterThread::*opcode)(std::shared_ptr<GC> gc);
bool InterperterThread::InterperterThread::Breakpoint(GC* gc)
bool InterperterThread::InterperterThread::Breakpoint(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -53,7 +53,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Times(GC* gc)
bool InterperterThread::Times(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -138,7 +138,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Divide(GC* gc)
bool InterperterThread::Divide(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -253,7 +253,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::Mod(GC* gc)
bool InterperterThread::Mod(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -340,7 +340,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Neg(GC* gc)
bool InterperterThread::Neg(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -414,7 +414,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::LNot(GC* gc)
bool InterperterThread::LNot(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -499,7 +499,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::BNot(GC* gc)
bool InterperterThread::BNot(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -571,7 +571,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Lt(GC* gc)
bool InterperterThread::Lt(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -691,7 +691,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Gt(GC* gc)
bool InterperterThread::Gt(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -812,7 +812,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Lte(GC* gc)
bool InterperterThread::Lte(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -933,7 +933,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Gte(GC* gc)
bool InterperterThread::Gte(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1056,7 +1056,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Eq(GC* gc)
bool InterperterThread::Eq(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1242,7 +1242,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::NEq(GC* gc)
bool InterperterThread::NEq(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1420,7 +1420,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::LShift(GC* gc)
bool InterperterThread::LShift(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1491,7 +1491,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::RShift(GC* gc)
bool InterperterThread::RShift(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1563,7 +1563,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::BOr(GC* gc)
bool InterperterThread::BOr(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1635,7 +1635,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::XOr(GC* gc)
bool InterperterThread::XOr(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1707,7 +1707,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::BAnd(GC* gc)
bool InterperterThread::BAnd(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -1812,7 +1812,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::ExecuteFunction(GC* gc)
bool InterperterThread::ExecuteFunction(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -1889,7 +1889,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Yield(GC* gc)
bool InterperterThread::Yield(std::shared_ptr<GC> gc)
{
GCList ls(gc);
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -1902,7 +1902,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::ExecuteMethod(GC* gc)
bool InterperterThread::ExecuteMethod(std::shared_ptr<GC> gc)
{
GCList ls(gc);
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -1939,7 +1939,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::GetVariable(GC* gc)
bool InterperterThread::GetVariable(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -1961,7 +1961,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::SetVariable(GC* gc)
bool InterperterThread::SetVariable(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2120,7 +2120,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::DeclareVariable(GC* gc)
bool InterperterThread::DeclareVariable(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2279,7 +2279,7 @@ namespace Tesses::CrossLang {
}
bool InterperterThread::DeclareConstVariable(GC* gc)
bool InterperterThread::DeclareConstVariable(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2436,7 +2436,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::PushResourceStream(GC* gc)
bool InterperterThread::PushResourceStream(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2466,7 +2466,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::PushResource(GC* gc)
bool InterperterThread::PushResource(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2495,7 +2495,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::Throw(GC* gc)
bool InterperterThread::Throw(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -2509,7 +2509,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::PushResourceDirectory(GC* gc)
bool InterperterThread::PushResourceDirectory(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
GCList ls(gc);
@@ -2524,7 +2524,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::JumpIfDefined(GC* gc)
bool InterperterThread::JumpIfDefined(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2550,7 +2550,7 @@ namespace Tesses::CrossLang {
throw VMException("Can't read jmpifdefined pc.");
return false;
}
bool InterperterThread::JumpIfBreak(GC* gc)
bool InterperterThread::JumpIfBreak(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2576,7 +2576,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::JumpIfContinue(GC* gc)
bool InterperterThread::JumpIfContinue(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2601,7 +2601,7 @@ namespace Tesses::CrossLang {
throw VMException("Can't read jmpifcontinue pc.");
return false;
}
bool InterperterThread::JumpUndefined(GC* gc)
bool InterperterThread::JumpUndefined(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2626,7 +2626,7 @@ namespace Tesses::CrossLang {
throw VMException("Can't read jmpundefined pc.");
return false;
}
bool InterperterThread::Jump(GC* gc)
bool InterperterThread::Jump(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2641,7 +2641,7 @@ namespace Tesses::CrossLang {
throw VMException("Can't read jmp pc.");
return false;
}
bool InterperterThread::PushNull(GC* gc)
bool InterperterThread::PushNull(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2650,7 +2650,7 @@ namespace Tesses::CrossLang {
stk->Push(gc,nullptr);
return false;
}
bool InterperterThread::PushBreak(GC* gc)
bool InterperterThread::PushBreak(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2659,7 +2659,7 @@ namespace Tesses::CrossLang {
stk->Push(gc,TBreak());
return false;
}
bool InterperterThread::PushContinue(GC* gc)
bool InterperterThread::PushContinue(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2668,7 +2668,7 @@ namespace Tesses::CrossLang {
stk->Push(gc,TContinue());
return false;
}
bool InterperterThread::PushUndefined(GC* gc)
bool InterperterThread::PushUndefined(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2677,7 +2677,7 @@ namespace Tesses::CrossLang {
stk->Push(gc,Undefined());
return false;
}
bool InterperterThread::LineInfo(GC* gc)
bool InterperterThread::LineInfo(std::shared_ptr<GC> gc)
{
GCList ls(gc);
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2695,7 +2695,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::PushFalse(GC* gc)
bool InterperterThread::PushFalse(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2704,7 +2704,7 @@ namespace Tesses::CrossLang {
stk->Push(gc,false);
return false;
}
bool InterperterThread::PushTrue(GC* gc)
bool InterperterThread::PushTrue(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2713,7 +2713,7 @@ namespace Tesses::CrossLang {
stk->Push(gc,true);
return false;
}
bool InterperterThread::CreateDictionary(GC* gc)
bool InterperterThread::CreateDictionary(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2723,11 +2723,11 @@ namespace Tesses::CrossLang {
stk->Push(gc,dict);
return false;
}
bool InterperterThread::Nop(GC* gc)
bool InterperterThread::Nop(std::shared_ptr<GC> gc)
{
return false;
}
bool InterperterThread::AppendList(GC* gc)
bool InterperterThread::AppendList(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2760,7 +2760,7 @@ namespace Tesses::CrossLang {
gc->BarrierEnd();
return false;
}
bool InterperterThread::AppendDictionary(GC* gc)
bool InterperterThread::AppendDictionary(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2800,7 +2800,7 @@ namespace Tesses::CrossLang {
gc->BarrierEnd();
return false;
}
bool InterperterThread::CreateArray(GC* gc)
bool InterperterThread::CreateArray(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2810,7 +2810,7 @@ namespace Tesses::CrossLang {
stk->Push(gc,dict);
return false;
}
bool InterperterThread::Pop(GC* gc)
bool InterperterThread::Pop(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2819,7 +2819,7 @@ namespace Tesses::CrossLang {
stk->Pop(ls);
return false;
}
bool InterperterThread::TryCatch(GC* gc)
bool InterperterThread::TryCatch(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2861,7 +2861,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::JumpConditional(GC* gc)
bool InterperterThread::JumpConditional(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2884,7 +2884,7 @@ namespace Tesses::CrossLang {
throw VMException("Can't read jmpc pc.");
return false;
}
bool InterperterThread::PushClosure(GC* gc)
bool InterperterThread::PushClosure(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2912,7 +2912,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::PushScopelessClosure(GC* gc)
bool InterperterThread::PushScopelessClosure(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2941,7 +2941,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::PushString(GC* gc)
bool InterperterThread::PushString(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -2962,7 +2962,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::PushLong(GC* gc)
bool InterperterThread::PushLong(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2978,7 +2978,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::PushChar(GC* gc)
bool InterperterThread::PushChar(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -2994,7 +2994,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::PushDouble(GC* gc)
bool InterperterThread::PushDouble(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
if(!cse.empty())
@@ -3010,7 +3010,7 @@ namespace Tesses::CrossLang {
}
return false;
}
bool InterperterThread::Return(GC* gc)
bool InterperterThread::Return(std::shared_ptr<GC> gc)
{
@@ -3020,7 +3020,7 @@ namespace Tesses::CrossLang {
stk->ip = (uint32_t)stk->callable->closure->code.size();
return false;
}
bool InterperterThread::ScopeBegin(GC* gc)
bool InterperterThread::ScopeBegin(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3034,7 +3034,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Defer(GC* gc)
bool InterperterThread::Defer(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3050,7 +3050,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::Dup(GC* gc)
bool InterperterThread::Dup(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3062,7 +3062,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::ScopeEndTimes(GC* gc)
bool InterperterThread::ScopeEndTimes(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3097,7 +3097,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::ScopeEnd(GC* gc)
bool InterperterThread::ScopeEnd(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3127,7 +3127,7 @@ namespace Tesses::CrossLang {
return false;
}
bool InterperterThread::PushRelativePath(GC* gc)
bool InterperterThread::PushRelativePath(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3138,7 +3138,7 @@ namespace Tesses::CrossLang {
stk->Push(gc, p);
return false;
}
bool InterperterThread::PushRootPath(GC* gc)
bool InterperterThread::PushRootPath(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3149,7 +3149,7 @@ namespace Tesses::CrossLang {
stk->Push(gc, p);
return false;
}
bool InterperterThread::Illegal(GC* gc)
bool InterperterThread::Illegal(std::shared_ptr<GC> gc)
{
@@ -3162,7 +3162,7 @@ namespace Tesses::CrossLang {
}
void InterperterThread::Execute(GC* gc)
void InterperterThread::Execute(std::shared_ptr<GC> gc)
{
std::vector<CallStackEntry*>& cse=this->call_stack_entries;
@@ -3342,7 +3342,7 @@ namespace Tesses::CrossLang {
this->callable->Mark();
for(auto item : this->stack) GC::Mark(item);
}
void CallStackEntry::Push(GC* gc,TObject o)
void CallStackEntry::Push(std::shared_ptr<GC> gc,TObject o)
{
gc->BarrierBegin();
this->stack.push_back(o);
@@ -3376,7 +3376,7 @@ namespace Tesses::CrossLang {
InterperterThread* InterperterThread::Create(GCList& ls)
{
InterperterThread* it = new InterperterThread();
GC* _gc = ls.GetGC();
std::shared_ptr<GC> _gc = ls.GetGC();
ls.Add(it);
_gc->Watch(it);
return it;
@@ -3384,7 +3384,7 @@ namespace Tesses::CrossLang {
InterperterThread* InterperterThread::Create(GCList* ls)
{
InterperterThread* it = new InterperterThread();
GC* _gc = ls->GetGC();
std::shared_ptr<GC> _gc = ls->GetGC();
ls->Add(it);
_gc->Watch(it);
return it;
@@ -3396,7 +3396,7 @@ namespace Tesses::CrossLang {
cse->srcline = -1;
cse->srcfile = "";
cse->thread=nullptr;
GC* _gc = ls.GetGC();
std::shared_ptr<GC> _gc = ls.GetGC();
ls.Add(cse);
_gc->Watch(cse);
return cse;
@@ -3409,7 +3409,7 @@ namespace Tesses::CrossLang {
cse->srcline = -1;
cse->srcfile = "";
cse->thread=nullptr;
GC* _gc = ls->GetGC();
std::shared_ptr<GC> _gc = ls->GetGC();
ls->Add(cse);
_gc->Watch(cse);
return cse;