private ScopeAllocator CreateStorageAllocator(ScriptCode scriptCode) { ScopeAllocator allocator; if (!_allocators.TryGetValue(scriptCode.LanguageContext, out allocator)) { var sf = CreateSlotFactory(scriptCode) as StaticFieldSlotFactory; var mgf = new ModuleGlobalFactory(sf); var sf2 = new StaticFieldSlotFactory(sf.TypeGen); GlobalFieldAllocator gfa = new GlobalFieldAllocator(mgf); var gfa2 = new GlobalFieldAllocator(sf2); // Locals and globals are allocated from the same namespace for optimized modules ScopeAllocator global = new ScopeAllocator(null, gfa); allocator = new ScopeAllocator(global, gfa2); _allocators[scriptCode.LanguageContext] = allocator; } return(allocator); }
private ScopeAllocator CreateStorageAllocator(ScriptCode scriptCode) { ScopeAllocator allocator; if (!_allocators.TryGetValue(scriptCode.LanguageContext, out allocator)) { var sf = CreateSlotFactory(scriptCode) as StaticFieldSlotFactory; var mgf = new ModuleGlobalFactory(sf); var sf2 = new StaticFieldSlotFactory(sf.TypeGen); GlobalFieldAllocator gfa = new GlobalFieldAllocator(mgf); var gfa2 = new GlobalFieldAllocator(sf2); // Locals and globals are allocated from the same namespace for optimized modules ScopeAllocator global = new ScopeAllocator(null, gfa); allocator = new ScopeAllocator(global, gfa2); _allocators[scriptCode.LanguageContext] = allocator; } return allocator; }