Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java @ 10659:63083745d390
Clean up OptimizedCallTarget and HotSpotNmethod.execute.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 08 Jul 2013 22:14:01 +0200 |
parents | d71c56c67921 |
children | 1b800f44ac0c |
comparison
equal
deleted
inserted
replaced
10658:c79cf526508e | 10659:63083745d390 |
---|---|
95 return String.format("InstalledNmethod[method=%s, codeBlob=0x%x, isDefault=%b]", method, codeBlob, isDefault); | 95 return String.format("InstalledNmethod[method=%s, codeBlob=0x%x, isDefault=%b]", method, codeBlob, isDefault); |
96 } | 96 } |
97 | 97 |
98 @Override | 98 @Override |
99 public Object execute(Object arg1, Object arg2, Object arg3) throws InvalidInstalledCodeException { | 99 public Object execute(Object arg1, Object arg2, Object arg3) throws InvalidInstalledCodeException { |
100 assert checkThreeObjectArgs(); | |
101 return CompilerToVMImpl.executeCompiledMethodIntrinsic(arg1, arg2, arg3, this); | |
102 } | |
103 | |
104 protected boolean checkThreeObjectArgs() { | |
100 assert method.getSignature().getParameterCount(!Modifier.isStatic(method.getModifiers())) == 3; | 105 assert method.getSignature().getParameterCount(!Modifier.isStatic(method.getModifiers())) == 3; |
101 assert method.getSignature().getParameterKind(0) == Kind.Object; | 106 assert method.getSignature().getParameterKind(0) == Kind.Object; |
102 assert method.getSignature().getParameterKind(1) == Kind.Object; | 107 assert method.getSignature().getParameterKind(1) == Kind.Object; |
103 assert !Modifier.isStatic(method.getModifiers()) || method.getSignature().getParameterKind(2) == Kind.Object; | 108 assert !Modifier.isStatic(method.getModifiers()) || method.getSignature().getParameterKind(2) == Kind.Object; |
104 return executeHelper(arg1, arg2, arg3, this); | 109 return true; |
105 } | |
106 | |
107 private static Object executeHelper(Object arg1, Object arg2, Object arg3, HotSpotInstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException { | |
108 return CompilerToVMImpl.executeCompiledMethodIntrinsic(arg1, arg2, arg3, hotspotInstalledCode); | |
109 } | 110 } |
110 | 111 |
111 private boolean checkArgs(Object... args) { | 112 private boolean checkArgs(Object... args) { |
112 JavaType[] sig = MetaUtil.signatureToTypes(method); | 113 JavaType[] sig = MetaUtil.signatureToTypes(method); |
113 assert args.length == sig.length : MetaUtil.format("%H.%n(%p): expected ", method) + sig.length + " args, got " + args.length; | 114 assert args.length == sig.length : MetaUtil.format("%H.%n(%p): expected ", method) + sig.length + " args, got " + args.length; |