Permalink
Browse files

syncing to head of tfs

  • Loading branch information...
jredville committed May 19, 2009
1 parent f7632b2 commit 01bf360a21d66db8d63540f025c8c308bb5480ba
@@ -678,12 +678,10 @@ private CallSite()
Expression.Assign(
rule,
Expression.Call(
- Expression.Property(
- @this,
- "Binder"
- ),
- "BindDelegate",
+ typeof(CallSiteOps),
+ "Bind",
typeArgs,
+ Expression.Property(@this, "Binder"),
@this,
args
)
@@ -73,6 +73,19 @@ public abstract class CallSiteBinder {
/// <param name="args">The arguments for the binder.</param>
/// <returns>A new delegate which replaces the CallSite Target.</returns>
public virtual T BindDelegate<T>(CallSite<T> site, object[] args) where T : class {
+ return null;
+ }
+
+
+ internal T BindCore<T>(CallSite<T> site, object[] args) where T : class {
+ //
+ // Try to find a precompiled delegate, and return it if found.
+ //
+ T result = BindDelegate(site, args);
+ if (result != null) {
+ return result;
+ }
+
//
// Get the Expression for the binding
//
@@ -147,5 +147,18 @@ public static class CallSiteOps {
yield return rule.Target;
}
}
+
+ /// <summary>
+ /// Updates the call site target with a new rule based on the arguments.
+ /// </summary>
+ /// <typeparam name="T">The type of the delegate of the <see cref="CallSite"/>.</typeparam>
+ /// <param name="binder">The call site binder.</param>
+ /// <param name="site">An instance of the dynamic call site.</param>
+ /// <param name="args">Arguments to the call site.</param>
+ /// <returns>The new call site target.</returns>
+ [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)]
+ public static T Bind<T>(CallSiteBinder binder, CallSite<T> site, object[] args) where T : class {
+ return binder.BindCore(site, args);
+ }
}
}
@@ -124,7 +124,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -249,7 +249,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -374,7 +374,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -499,7 +499,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -624,7 +624,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -749,7 +749,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -874,7 +874,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -999,7 +999,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1124,7 +1124,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1249,7 +1249,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1374,7 +1374,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1498,7 +1498,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1622,7 +1622,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1746,7 +1746,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1870,7 +1870,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -1994,7 +1994,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -2118,7 +2118,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -2242,7 +2242,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -2366,7 +2366,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -2490,7 +2490,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site
@@ -2614,7 +2614,7 @@ internal static partial class UpdateDelegates {
for (; ; ) {
@this.Target = originalRule;
- rule = @this.Target = @this.Binder.BindDelegate(@this, args);
+ rule = @this.Target = @this.Binder.BindCore(@this, args);
//
// Execute the rule on the matchmaker site

0 comments on commit 01bf360

Please sign in to comment.