Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure we don't compile code on CF.

codeplexcomment

(Shelveset: WP7CompilationThreshold;REDMOND\tomat | SNAP CheckinId: 11120)

TFS Changeset 1913918
  • Loading branch information...
commit 94e8b209e4e5012b607d27aaa4c6446f77066ada 1 parent 7ad7509
@tmat tmat authored jredville committed
View
6 Runtime/Microsoft.Dynamic/Interpreter/LightLambda.cs
@@ -193,6 +193,12 @@ public partial class LightLambda {
//
// We can't miss 0. The first thread that writes -1 must have read 0 and hence start compilation.
if (unchecked(_compilationThreshold--) == 0) {
+#if SILVERLIGHT
+ if (PlatformAdaptationLayer.IsCompactFramework) {
+ _compilationThreshold = Int32.MaxValue;
+ return false;
+ }
+#endif
if (_interpreter.CompileSynchronously) {
_delegateCreator.Compile(null);
return TryGetCompiled();
View
11 Runtime/Microsoft.Dynamic/Runtime/ScriptingRuntimeHelpers.cs
@@ -240,12 +240,17 @@ public static partial class ScriptingRuntimeHelpers {
public static bool InterpretedCallSiteTest(bool restrictionResult, object bindingInfo) {
if (restrictionResult) {
CachedBindingInfo bindInfo = (CachedBindingInfo)bindingInfo;
- if (bindInfo.CountDown >= 0) {
+ if (bindInfo.CompilationThreshold >= 0) {
// still interpreting...
- bindInfo.CountDown--;
+ bindInfo.CompilationThreshold--;
return true;
}
-
+#if SILVERLIGHT
+ if (PlatformAdaptationLayer.IsCompactFramework) {
+ bindInfo.CompilationThreshold = Int32.MaxValue;
+ return true;
+ }
+#endif
return bindInfo.CheckCompiled();
}
return false;
View
14 Runtime/Microsoft.Dynamic/Utils/DynamicUtils.cs
@@ -122,7 +122,7 @@ private class GenericInterpretedBinder<T> where T : class {
);
}
- public T/*!*/ Bind(DynamicMetaObjectBinder/*!*/ binder, int countDown, object[] args) {
+ public T/*!*/ Bind(DynamicMetaObjectBinder/*!*/ binder, int compilationThreshold, object[] args) {
if (CachedBindingInfo<T>.LastInterpretedFailure != null && CachedBindingInfo<T>.LastInterpretedFailure.Binder == binder) {
// we failed the rule because we have a compiled target available, return the compiled target
Debug.Assert(CachedBindingInfo<T>.LastInterpretedFailure.CompiledTarget != null);
@@ -132,7 +132,7 @@ private class GenericInterpretedBinder<T> where T : class {
}
// we haven't produced a rule yet....
- var bindingInfo = new CachedBindingInfo<T>(binder, countDown);
+ var bindingInfo = new CachedBindingInfo<T>(binder, compilationThreshold);
var targetMO = DynamicMetaObject.Create(args[0], _parameters[1]); // 1 is skipping CallSite
DynamicMetaObject[] argsMO = new DynamicMetaObject[args.Length - 1];
@@ -237,11 +237,11 @@ class InterpretedRuleHitCheckExpression : Expression, IInstructionProvider {
/// </summary>
abstract class CachedBindingInfo {
public readonly DynamicMetaObjectBinder/*!*/ Binder;
- public int CountDown;
+ public int CompilationThreshold;
- public CachedBindingInfo(DynamicMetaObjectBinder binder, int countDown) {
+ public CachedBindingInfo(DynamicMetaObjectBinder binder, int compilationThreshold) {
Binder = binder;
- CountDown = countDown;
+ CompilationThreshold = compilationThreshold;
}
public abstract bool CheckCompiled();
@@ -254,8 +254,8 @@ class CachedBindingInfo<T> : CachedBindingInfo where T : class {
[ThreadStatic]
public static CachedBindingInfo<T> LastInterpretedFailure;
- public CachedBindingInfo(DynamicMetaObjectBinder binder, int countDown)
- : base(binder, countDown) {
+ public CachedBindingInfo(DynamicMetaObjectBinder binder, int compilationThreshold)
+ : base(binder, compilationThreshold) {
}
public override bool CheckCompiled() {
View
2  Runtime/Microsoft.Scripting/LanguageOptions.cs
@@ -91,7 +91,7 @@ public LanguageOptions()
_showClrExceptions = GetOption(options, "ShowClrExceptions", false);
_perfStats = GetOption(options, "PerfStats", false);
_noAdaptiveCompilation = GetOption(options, "NoAdaptiveCompilation", false);
- _compilationThreshold = GetOption(options, "CompilationThreshold", -1);
+ _compilationThreshold = GetOption(options, "CompilationThreshold", PlatformAdaptationLayer.IsCompactFramework ? Int32.MaxValue : -1);
_searchPaths = GetSearchPathsOption(options) ?? new ReadOnlyCollection<string>(new string[0]);
}
Please sign in to comment.
Something went wrong with that request. Please try again.