public override MSAst.Expression /*!*/ GetConstant(object value) { // if we can emit the value and we won't be continiously boxing/unboxing // then don't bother caching the value in a static field. // TODO: Sometimes we don't want to pre-box the values, such as if it's an int // going to a call site which can be strongly typed. We need to coordinate // more with whoever consumes the values. if (CompilerHelpers.CanEmitConstant(value, CompilerHelpers.GetType(value)) && !CompilerHelpers.GetType(value).IsValueType()) { return(Utils.Constant(value)); } ConstantInfo ci; lock (_allConstants) { if (!_allConstants.TryGetValue(value, out ci)) { _allConstants[value] = ci = NextConstant(_allConstants.Count, value); PublishConstant(value, ci); } } return(ci.Expression); }