comparison src/share/vm/runtime/vmStructs.cpp @ 10136:cc12becb22e7

Merge
author dcubed
date Sun, 21 Apr 2013 21:05:02 -0700
parents 5b6512efcdc4 5a9fa2ba85f0
children 0b55a78c6be5
comparison
equal deleted inserted replaced
10134:a527ddd44e07 10136:cc12becb22e7
3116 } 3116 }
3117 } 3117 }
3118 // Search for the base type by peeling off const and * 3118 // Search for the base type by peeling off const and *
3119 size_t len = strlen(typeName); 3119 size_t len = strlen(typeName);
3120 if (typeName[len-1] == '*') { 3120 if (typeName[len-1] == '*') {
3121 char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal); 3121 char * s = new char[len];
3122 strncpy(s, typeName, len - 1); 3122 strncpy(s, typeName, len - 1);
3123 s[len-1] = '\0'; 3123 s[len-1] = '\0';
3124 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); 3124 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
3125 if (recursiveFindType(origtypes, s, true) == 1) { 3125 if (recursiveFindType(origtypes, s, true) == 1) {
3126 FREE_C_HEAP_ARRAY(char, s, mtInternal); 3126 delete [] s;
3127 return 1; 3127 return 1;
3128 } 3128 }
3129 FREE_C_HEAP_ARRAY(char, s, mtInternal); 3129 delete [] s;
3130 } 3130 }
3131 const char* start = NULL; 3131 const char* start = NULL;
3132 if (strstr(typeName, "GrowableArray<") == typeName) { 3132 if (strstr(typeName, "GrowableArray<") == typeName) {
3133 start = typeName + strlen("GrowableArray<"); 3133 start = typeName + strlen("GrowableArray<");
3134 } else if (strstr(typeName, "Array<") == typeName) { 3134 } else if (strstr(typeName, "Array<") == typeName) {
3135 start = typeName + strlen("Array<"); 3135 start = typeName + strlen("Array<");
3136 } 3136 }
3137 if (start != NULL) { 3137 if (start != NULL) {
3138 const char * end = strrchr(typeName, '>'); 3138 const char * end = strrchr(typeName, '>');
3139 int len = end - start + 1; 3139 int len = end - start + 1;
3140 char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal); 3140 char * s = new char[len];
3141 strncpy(s, start, len - 1); 3141 strncpy(s, start, len - 1);
3142 s[len-1] = '\0'; 3142 s[len-1] = '\0';
3143 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); 3143 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
3144 if (recursiveFindType(origtypes, s, true) == 1) { 3144 if (recursiveFindType(origtypes, s, true) == 1) {
3145 FREE_C_HEAP_ARRAY(char, s, mtInternal); 3145 delete [] s;
3146 return 1; 3146 return 1;
3147 } 3147 }
3148 FREE_C_HEAP_ARRAY(char, s, mtInternal); 3148 delete [] s;
3149 } 3149 }
3150 if (strstr(typeName, "const ") == typeName) { 3150 if (strstr(typeName, "const ") == typeName) {
3151 const char * s = typeName + strlen("const "); 3151 const char * s = typeName + strlen("const ");
3152 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); 3152 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
3153 if (recursiveFindType(origtypes, s, true) == 1) { 3153 if (recursiveFindType(origtypes, s, true) == 1) {