this.is_lifted = is_lifted;
}
+#if !FULL_AOT_RUNTIME
void EmitArrayAccess (EmitContext ec)
{
left.Emit (ec);
MethodInfo GetFalseOperator ()
{
- return GetNotNullableOf (left.Type).GetMethod ("op_False", AllStatic);
+ return GetFalseOperator (left.Type.GetNotNullableType ());
}
MethodInfo GetTrueOperator ()
{
- return GetNotNullableOf (left.Type).GetMethod ("op_True", AllStatic);
+ return GetTrueOperator (left.Type.GetNotNullableType ());
}
void EmitUserDefinedLogicalShortCircuit (EmitContext ec)
ig.Emit (OpCodes.Brfalse, load_right);
- // is it the right way to do it?
- ec.EmitReadGlobal (conversion.Compile ());
+ ec.Emit (conversion);
ec.EmitLoad (left);
ig.Emit (OpCodes.Callvirt, conversion.Type.GetInvokeMethod ());
ig.Emit (is_unsigned ? OpCodes.Rem_Un : OpCodes.Rem);
break;
case ExpressionType.RightShift:
- ig.Emit (is_unsigned ? OpCodes.Shr_Un : OpCodes.Shr);
- break;
case ExpressionType.LeftShift:
- ig.Emit (OpCodes.Shl);
+ ig.Emit (OpCodes.Ldc_I4, left.Type == typeof (int) ? 0x1f : 0x3f);
+ ig.Emit (OpCodes.And);
+ if (NodeType == ExpressionType.RightShift)
+ ig.Emit (is_unsigned ? OpCodes.Shr_Un : OpCodes.Shr);
+ else
+ ig.Emit (OpCodes.Shl);
break;
case ExpressionType.And:
ig.Emit (OpCodes.And);
throw new NotSupportedException (this.NodeType.ToString ());
}
}
+#endif
}
}