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
- XsltOutput.cs
- PropertyMetadata.cs
- DrawToolTipEventArgs.cs
- MaterialGroup.cs
- TransformerInfoCollection.cs
- BamlBinaryReader.cs
- ActivityTypeDesigner.xaml.cs
- CodeDelegateCreateExpression.cs
- SolidColorBrush.cs
- TextBox.cs
- _SSPIWrapper.cs
- ExtentCqlBlock.cs
- TerminatorSinks.cs
- SqlWebEventProvider.cs
- Material.cs
- PageThemeParser.cs
- DataServiceContext.cs
- DependencyPropertyConverter.cs
- UnicodeEncoding.cs
- LocalValueEnumerator.cs
- PropertyGrid.cs
- ToolStripDropTargetManager.cs
- XmlTextWriter.cs
- StreamInfo.cs
- RemoveFromCollection.cs
- TreeViewAutomationPeer.cs
- SrgsItemList.cs
- CompiledIdentityConstraint.cs
- HttpHandlerActionCollection.cs
- Number.cs
- WinFormsComponentEditor.cs
- TreeNodeEventArgs.cs
- ListInitExpression.cs
- wmiprovider.cs
- StructuralType.cs
- DocumentViewerAutomationPeer.cs
- Substitution.cs
- ServiceDescriptionData.cs
- AuthenticationModulesSection.cs
- COM2TypeInfoProcessor.cs
- BeginStoryboard.cs
- SequenceDesignerAccessibleObject.cs
- LogRecordSequence.cs
- SafeNativeMemoryHandle.cs
- ToolStripSplitStackLayout.cs
- HttpBrowserCapabilitiesWrapper.cs
- SchemaReference.cs
- DbConnectionFactory.cs
- GrammarBuilderBase.cs
- DesignTimeType.cs
- WebSysDefaultValueAttribute.cs
- XmlSchemaException.cs
- DockingAttribute.cs
- AuthorizationRule.cs
- CollectionsUtil.cs
- ProcessModule.cs
- AlternationConverter.cs
- Stackframe.cs
- RowToParametersTransformer.cs
- SqlStatistics.cs
- DataGridAddNewRow.cs
- GroupBox.cs
- SerializationBinder.cs
- Activity.cs
- SHA1Managed.cs
- OdbcTransaction.cs
- SettingsPropertyValue.cs
- BuildProviderAppliesToAttribute.cs
- SerialReceived.cs
- DayRenderEvent.cs
- ComponentCollection.cs
- RadioButton.cs
- _ContextAwareResult.cs
- NetStream.cs
- HyperLinkDesigner.cs
- PropertyInformation.cs
- TypeResolver.cs
- MessageParameterAttribute.cs
- XsltLibrary.cs
- TimeSpan.cs
- BooleanToVisibilityConverter.cs
- SerialReceived.cs
- ConditionValidator.cs
- ListBindingConverter.cs
- ListBoxItemWrapperAutomationPeer.cs
- StateManagedCollection.cs
- KeyNotFoundException.cs
- arabicshape.cs
- DataSetSchema.cs
- StreamDocument.cs
- GeometryGroup.cs
- CultureNotFoundException.cs
- ArraySegment.cs
- DigestTraceRecordHelper.cs
- SystemInfo.cs
- CompositionAdorner.cs
- Attributes.cs
- ReflectionServiceProvider.cs
- ExternalFile.cs
- ComponentChangedEvent.cs