QuickJS uses a hybrid garbage collector: it uses reference counts and a clever cycle detection mechanism to retrieve memory for unreachable self referencing objects.
While changing the garbage collecting mechanism is feasible and probably simple if your goal is to just remove it, switching to a mark and sweep method is more difficult to achieve because it requires deep changes in the implementation, such as linking all allocated objects such as strings and bignums, which is currently not needed.
It also requires subtle changes in many functions that construct objects to prevent them from being collected by the GC that could be invoked on any object allocation.
Making the garbage collector optional is a feature we should add. Using a mark and sweep approach is not on our wish list, but if you succeed at implementing it, we shall certainly be interested.