public static void InitializeModuleFieldBoxed(CodeContext context, object name, ref ModuleGlobalWrapper wrapper) { var s = (SymbolId)name; ModuleGlobalCache mgc = context.LanguageContext.GetModuleCache(s); wrapper = new ModuleGlobalWrapper(context, mgc, s); }
protected internal override bool TryGetExtraValue(SymbolId key, out object value) { if (base.TryGetExtraValue(key, out value)) { ModuleGlobalWrapper wrapper = value as ModuleGlobalWrapper; Debug.Assert(wrapper != null); if (wrapper.RawValue != Uninitialized.Instance) { value = wrapper.RawValue; return(true); } } return(false); }
protected internal override bool TrySetExtraValue(SymbolId key, object value) { object prevVal; if (base.TryGetExtraValue(key, out prevVal)) { ModuleGlobalWrapper wrapper = prevVal as ModuleGlobalWrapper; Debug.Assert(wrapper != null); wrapper.CurrentValue = value; return(true); } return(false); }
public static void InitializeModuleField(CodeContext context, SymbolId name, ref ModuleGlobalWrapper wrapper) { ModuleGlobalCache mgc = context.LanguageContext.GetModuleCache(name); wrapper = new ModuleGlobalWrapper(context, mgc, name); }
public static void SetValue(object value, ModuleGlobalWrapper wrapper) { wrapper.CurrentValue = value; }