comparison graal/com.oracle.max.criutils/src/com/oracle/max/criutils/JniMangle.java @ 5507:dc71b06d09f8

Moving classes from cri.ri to api.meta.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 07 Jun 2012 18:24:06 +0200
parents 4c3d953f8131
children b4c406861c33
comparison
equal deleted inserted replaced
5506:56860d3f9f39 5507:dc71b06d09f8
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.max.criutils; 23 package com.oracle.max.criutils;
24 24
25 import com.oracle.max.cri.ci.*; 25 import com.oracle.graal.api.meta.*;
26 import com.oracle.max.cri.ri.*;
27 26
28 /** 27 /**
29 * A utility for mangling Java method name and signatures into C function names. 28 * A utility for mangling Java method name and signatures into C function names.
30 * 29 *
31 * @see "http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/design.html#wp615" 30 * @see "http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/design.html#wp615"
79 * @param splitSuffix determines if {@link #LONG_NAME_DELIMITER} should be used as described above 78 * @param splitSuffix determines if {@link #LONG_NAME_DELIMITER} should be used as described above
80 * @return the symbol for the C function as described above 79 * @return the symbol for the C function as described above
81 */ 80 */
82 public static String mangleMethod(RiResolvedType declaringClass, String name, RiSignature signature, boolean splitSuffix) { 81 public static String mangleMethod(RiResolvedType declaringClass, String name, RiSignature signature, boolean splitSuffix) {
83 final StringBuilder result = new StringBuilder(100); 82 final StringBuilder result = new StringBuilder(100);
84 final String declaringClassName = CiUtil.toJavaName(declaringClass); 83 final String declaringClassName = RiUtil.toJavaName(declaringClass);
85 result.append("Java_").append(mangle(declaringClassName)).append('_').append(mangle(name)); 84 result.append("Java_").append(mangle(declaringClassName)).append('_').append(mangle(name));
86 if (signature != null) { 85 if (signature != null) {
87 if (splitSuffix) { 86 if (splitSuffix) {
88 result.append(LONG_NAME_DELIMITER); 87 result.append(LONG_NAME_DELIMITER);
89 } 88 }