comparison src/share/vm/graal/graalVmIds.hpp @ 7811:94ea9a864fc6

Remove usages of VmIds.toString.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 18 Feb 2013 19:08:52 -0800
parents 5aa05e6f9dee
children a42dc71ad051
comparison
equal deleted inserted replaced
7810:5aa05e6f9dee 7811:94ea9a864fc6
37 public: 37 public:
38 38
39 // Returns the stub address with the given vmId taken from a java.lang.Long 39 // Returns the stub address with the given vmId taken from a java.lang.Long
40 static address getStub(oop id); 40 static address getStub(oop id);
41 41
42 // Helper function to convert a symbol to a java.lang.String object
43 template <typename T> static T toString(Symbol* symbol, TRAPS);
44
45 // Helper function to convert a java.lang.String object to a symbol (this will return NULL if the symbol doesn't exist in the system) 42 // Helper function to convert a java.lang.String object to a symbol (this will return NULL if the symbol doesn't exist in the system)
46 static Symbol* toSymbol(jstring string); 43 static Symbol* toSymbol(jstring string);
47 44
48 // Helper function to get the contents of a java.lang.Long 45 // Helper function to get the contents of a java.lang.Long
49 static jlong getBoxedLong(oop obj); 46 static jlong getBoxedLong(oop obj);
50 }; 47 };
51 48
52 inline address VmIds::getStub(oop obj) { 49 inline address VmIds::getStub(oop obj) {
53 return (address)(getBoxedLong(obj)); 50 return (address)(getBoxedLong(obj));
54 }
55
56 template <> inline Handle VmIds::toString<Handle>(Symbol* symbol, TRAPS) {
57 return java_lang_String::create_from_symbol(symbol, THREAD);
58 }
59
60 template <> inline oop VmIds::toString<oop>(Symbol* symbol, TRAPS) {
61 return toString<Handle>(symbol, THREAD)();
62 }
63
64 template <> inline jstring VmIds::toString<jstring>(Symbol* symbol, TRAPS) {
65 return (jstring)JNIHandles::make_local(toString<oop>(symbol, THREAD));
66 }
67
68 template <> inline jobject VmIds::toString<jobject>(Symbol* symbol, TRAPS) {
69 return JNIHandles::make_local(toString<oop>(symbol, THREAD));
70 } 51 }
71 52
72 inline Symbol* VmIds::toSymbol(jstring string) { 53 inline Symbol* VmIds::toSymbol(jstring string) {
73 return java_lang_String::as_symbol(JNIHandles::resolve(string), Thread::current()); 54 return java_lang_String::as_symbol(JNIHandles::resolve(string), Thread::current());
74 } 55 }