Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Scripting / Compiler / BoundConstants.cs / 1305376 / BoundConstants.cs
/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Collections.Generic; using System.Diagnostics; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Dynamic.Utils; #if SILVERLIGHT using System.Core; #endif namespace System.Linq.Expressions.Compiler { ////// This type tracks "runtime" constants--live objects that appear in /// ConstantExpression nodes and must be bound to the delegate. /// internal sealed class BoundConstants { ////// Constants can emit themselves as different types /// For caching purposes, we need to treat each distinct Type as a /// seperate thing to cache. (If we have to cast it on the way out, it /// ends up using a JIT temp and defeats the purpose of caching the /// value in a local) /// private struct TypedConstant : IEquatable{ internal readonly object Value; internal readonly Type Type; internal TypedConstant(object value, Type type) { Value = value; Type = type; } public override int GetHashCode() { return RuntimeHelpers.GetHashCode(Value) ^ Type.GetHashCode(); } public bool Equals(TypedConstant other) { return object.ReferenceEquals(Value, other.Value) && Type.Equals(other.Type); } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2231:OverloadOperatorEqualsOnOverridingValueTypeEquals")] public override bool Equals(object obj) { return (obj is TypedConstant) && Equals((TypedConstant)obj); } } /// /// The list of constants in the order they appear in the constant array /// private readonly List
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Transaction.cs
- WebPartCancelEventArgs.cs
- ConfigurationPropertyAttribute.cs
- HtmlObjectListAdapter.cs
- SemaphoreSecurity.cs
- Utils.cs
- Form.cs
- ChtmlFormAdapter.cs
- TemplateComponentConnector.cs
- ComponentCodeDomSerializer.cs
- DesignerGenericWebPart.cs
- COM2FontConverter.cs
- TextSearch.cs
- QilList.cs
- ScrollEventArgs.cs
- AutomationPatternInfo.cs
- XPathNavigatorKeyComparer.cs
- UrlEncodedParameterWriter.cs
- XmlDictionaryReaderQuotas.cs
- RightNameExpirationInfoPair.cs
- CodeLinePragma.cs
- RemotingConfigParser.cs
- ParameterToken.cs
- KeyGestureConverter.cs
- FileIOPermission.cs
- HttpApplication.cs
- UserValidatedEventArgs.cs
- AsyncOperation.cs
- OracleInternalConnection.cs
- MultiTargetingUtil.cs
- PartialArray.cs
- ProviderUtil.cs
- XmlHierarchyData.cs
- NativeRecognizer.cs
- KeyMatchBuilder.cs
- RowBinding.cs
- RangeValuePattern.cs
- ColumnCollection.cs
- ZipIOCentralDirectoryFileHeader.cs
- WebPartDisplayModeEventArgs.cs
- CompModSwitches.cs
- ReflectionUtil.cs
- DefaultValueAttribute.cs
- validationstate.cs
- LocalizationParserHooks.cs
- Polygon.cs
- SettingsProperty.cs
- FixedLineResult.cs
- DataSourceXmlClassAttribute.cs
- StrongNamePublicKeyBlob.cs
- HttpDictionary.cs
- ScrollBar.cs
- NetStream.cs
- TextSpanModifier.cs
- HttpPostServerProtocol.cs
- WindowsFormsSynchronizationContext.cs
- WorkflowTransactionService.cs
- PathGeometry.cs
- xmlformatgeneratorstatics.cs
- XmlEntityReference.cs
- SqlUDTStorage.cs
- WorkItem.cs
- CodeSubDirectory.cs
- Int32Collection.cs
- SecurityManager.cs
- AxParameterData.cs
- FormsAuthenticationUser.cs
- FactoryMaker.cs
- DataGridViewTopRowAccessibleObject.cs
- DetailsViewPageEventArgs.cs
- ConfigXmlCDataSection.cs
- FolderLevelBuildProviderCollection.cs
- ApplicationGesture.cs
- DiscreteKeyFrames.cs
- CompiledQuery.cs
- TextBoxRenderer.cs
- StaticSiteMapProvider.cs
- BitmapPalettes.cs
- XmlAttributeHolder.cs
- MethodBuilder.cs
- UmAlQuraCalendar.cs
- DataRow.cs
- DocumentPage.cs
- ExtendedProperty.cs
- ChangesetResponse.cs
- HelpProvider.cs
- DropShadowEffect.cs
- Image.cs
- designeractionlistschangedeventargs.cs
- assemblycache.cs
- MouseEventArgs.cs
- UnsafeNetInfoNativeMethods.cs
- MultiAsyncResult.cs
- PageAsyncTaskManager.cs
- ParameterCollection.cs
- shaper.cs
- StrongTypingException.cs
- DataControlButton.cs
- BufferBuilder.cs
- MultiTrigger.cs