diff options
author | jfrijters <jfrijters> | 2013-02-24 11:56:51 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2013-02-24 11:56:51 +0400 |
commit | 92d12dde39311c745fde6b578aa6338f1b63c957 (patch) | |
tree | 784a88872bc34a2932b8a0ad843fc140919c5443 | |
parent | cb0afcf8fd18bf0bdcd70534c1b12b2e1088ac97 (diff) |
Use MethodWrapper instead of ConstantPoolItemMI to make it easier to move constant pool entry lookup to GetMethodCallEmitter.
-rw-r--r-- | runtime/compiler.cs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/runtime/compiler.cs b/runtime/compiler.cs index ca946aea..7a61aede 100644 --- a/runtime/compiler.cs +++ b/runtime/compiler.cs @@ -1575,12 +1575,10 @@ sealed class Compiler case NormalizedByteCode.__methodhandle_invokeexact: { bool isinvokespecial = instr.NormalizedOpCode == NormalizedByteCode.__invokespecial || instr.NormalizedOpCode == NormalizedByteCode.__dynamic_invokespecial; - ClassFile.ConstantPoolItemMI cpi = classFile.GetMethodref(instr.Arg1); - int argcount = cpi.GetArgTypes().Length; + MethodWrapper method = GetMethodCallEmitter(classFile.GetMethodref(instr.Arg1), instr.NormalizedOpCode); + int argcount = method.GetParameters().Length; TypeWrapper type = ma.GetRawStackTypeWrapper(i, argcount); - TypeWrapper thisType = SigTypeToClassName(type, cpi.GetClassType()); - - MethodWrapper method = GetMethodCallEmitter(cpi, instr.NormalizedOpCode); + TypeWrapper thisType = SigTypeToClassName(type, method.DeclaringType); EmitIntrinsicContext eic = new EmitIntrinsicContext(method, context, ilGenerator, ma, i, mw, classFile, code, flags); if(method.IsIntrinsic && method.EmitIntrinsic(eic)) @@ -1597,15 +1595,15 @@ sealed class Compiler // to a more specific base type. if(thisType.IsAssignableTo(cli_System_Object)) { - method = cli_System_Object.GetMethodWrapper(cpi.Name, cpi.Signature, true); + method = cli_System_Object.GetMethodWrapper(method.Name, method.Signature, true); } else if(thisType.IsAssignableTo(cli_System_Exception)) { - method = cli_System_Exception.GetMethodWrapper(cpi.Name, cpi.Signature, true); + method = cli_System_Exception.GetMethodWrapper(method.Name, method.Signature, true); } else if(thisType.IsAssignableTo(java_lang_Throwable)) { - method = java_lang_Throwable.GetMethodWrapper(cpi.Name, cpi.Signature, true); + method = java_lang_Throwable.GetMethodWrapper(method.Name, method.Signature, true); } } |