public ILBlockTranslator(AssemblyTranslator translator, DecompilerContext context, MethodReference methodReference, MethodDefinition methodDefinition, ILBlock ilb, IEnumerable<ILVariable> parameters, IEnumerable<ILVariable> allVariables) { Translator = translator; Context = context; ThisMethodReference = methodReference; ThisMethod = methodDefinition; Block = ilb; SpecialIdentifiers = new JSIL.SpecialIdentifiers(TypeSystem); if (methodReference.HasThis) Variables.Add("this", JSThisParameter.New(methodReference.DeclaringType, methodReference)); foreach (var parameter in parameters) { if ((parameter.Name == "this") && (parameter.OriginalParameter.Index == -1)) continue; ParameterNames.Add(parameter.Name); Variables.Add(parameter.Name, new JSParameter(parameter.Name, parameter.Type, methodReference)); } foreach (var variable in allVariables) { var v = JSVariable.New(variable, methodReference); if (Variables.ContainsKey(v.Identifier)) { v = new JSVariable(variable.OriginalVariable.Name, variable.Type, methodReference); RenamedVariables[variable] = v; Variables.Add(v.Identifier, v); } else { Variables.Add(v.Identifier, v); } } }
public JavascriptAssemblyEmitter ( AssemblyTranslator assemblyTranslator, JavascriptFormatter formatter ) { Translator = assemblyTranslator; Formatter = formatter; }
public IAssemblyEmitter MakeAssemblyEmitter(AssemblyTranslator translator, AssemblyDefinition assembly, JavascriptFormatter formatter) { if (translator.IsStubbed(assembly) || translator.IsIgnored(assembly)) return new NullAssemblyEmitter(); else return new WasmSExprAssemblyEmitter(translator, assembly, formatter); }
public JavascriptAssemblyEmitter ( AssemblyTranslator assemblyTranslator, JavascriptFormatter formatter, IDictionary<AssemblyManifest.Token, string> referenceOverrides ) { Translator = assemblyTranslator; Formatter = formatter; _referenceOverrides = referenceOverrides; }
bool IAnalyzer.ShouldSkipMember(AssemblyTranslator translator, MemberReference member) { var result = ShouldSkipMember(member); if (result.Item1) Warn(translator, member, result.Item2); return result.Item1; }
public IAssemblyEmitter MakeAssemblyEmitter( AssemblyTranslator translator, AssemblyDefinition assembly, JavascriptFormatter formatter, IDictionary<AssemblyManifest.Token, string> referenceOverrides ) { if (translator.IsStubbed(assembly) || translator.IsIgnored(assembly)) return new NullAssemblyEmitter(); else return new WasmSExprAssemblyEmitter(translator, assembly, formatter); }
private bool ShouldSilence(AssemblyTranslator translator, MemberReference member) { var typeInfo = translator.TypeInfoProvider.GetTypeInformation(member.DeclaringType); if (typeInfo.IsIgnored || typeInfo.IsExternal) return true; var asm = member.DeclaringType.Module.Assembly; if (translator.IsStubbed(asm) || translator.IsIgnored(asm)) return true; return false; }
private void Warn(AssemblyTranslator translator, MemberReference member, string reason) { if (ShouldSilence(translator, member)) return; if (PreviousWarnings.Contains(member.FullName)) return; PreviousWarnings.Add(member.FullName); Console.WriteLine("// Skipping {0}: {1}", member.Name, reason); }
public void Analyze(AssemblyTranslator translator, AssemblyDefinition[] assemblies, TypeInfoProvider typeInfoProvider) { }
public WasmSExprAssemblyEmitter(AssemblyTranslator translator, AssemblyDefinition assembly, JavascriptFormatter formatter) { Translator = translator; Assembly = assembly; Formatter = formatter; }