codefrau / SqueakJS

A Squeak Smalltalk VM in Javascript
https://squeak.js.org
MIT License
371 stars 76 forks source link

Ensure that metaclasses are in the class table when instantiated. #76

Closed ccrraaiigg closed 7 years ago

ccrraaiigg commented 7 years ago

Ensure that metaclasses are in the class table when instantiated. Bad things happen to their instances otherwise.

This solution mirrors what original Spur does (the invocation of ensureBehaviorHash: in Spur*MemoryManager>>instantiateClass:indexableSize:). We can remove the class hash check in removeUnmarkedOldObjects().

codefrau commented 7 years ago

I hope 3ac9a12d5100407d944ea3fec1b4f508b2601db9 fixes this without touching instantiateClass, so no perf impact at runtime.