예제 #1
0
파일: Places.cs 프로젝트: Ashod/Phalanger
		/// <summary>
		/// Emits code that loads current <see cref="PHP.Core.ScriptContext"/> by calling
		/// <see cref="PHP.Core.ScriptContext.CurrentContext"/> and remembers it in a local.
		/// </summary>
		/// <param name="il"></param>
		public void EmitLoad(ILEmitter il)
		{
			if (localBuilder == null)
			{
				localBuilder = il.DeclareLocal(typeof(ScriptContext));
				il.EmitCall(OpCodes.Call, Methods.ScriptContext.GetCurrentContext, null);
				il.Stloc(localBuilder);
			}
			il.Ldloc(localBuilder);
		}
예제 #2
0
 /// <summary>
 /// Emit (stack_top dup).IsAliased = true;
 /// </summary>
 /// <param name="il"></param>
 private void EmitIsAliased(ILEmitter/*!*/il)
 {
     // set IsAliased to true
     il.Emit(OpCodes.Dup);
     il.Emit(OpCodes.Ldc_I4_1);
     il.EmitCall(OpCodes.Callvirt, Properties.PhpReference_IsAliased.GetSetMethod(), null);
 }