src/share/vm/compiler/compilerOracle.cpp

Print this page

        

*** 385,400 **** // cmd java.lang.String::foo // VM syntax // cmd java/lang/String[. ]foo // - static const char* patterns[] = { - "%*[ \t]%255" RANGEDOT " " "%255" RANGE0 "%n", - "%*[ \t]%255" RANGEDOT "::" "%255" RANGE0 "%n", - "%*[ \t]%255" RANGESLASH "%*[ .]" "%255" RANGE0 "%n", - }; - static MethodMatcher::Mode check_mode(char name[], const char*& error_msg) { int match = MethodMatcher::Exact; while (name[0] == '*') { match |= MethodMatcher::Suffix; strcpy(name, name + 1); --- 385,394 ----
*** 419,435 **** char class_name[], MethodMatcher::Mode* c_mode, char method_name[], MethodMatcher::Mode* m_mode, int* bytes_read, const char*& error_msg) { *bytes_read = 0; error_msg = NULL; ! for (uint i = 0; i < ARRAY_SIZE(patterns); i++) { ! if (2 == sscanf(line, patterns[i], class_name, method_name, bytes_read)) { *c_mode = check_mode(class_name, error_msg); *m_mode = check_mode(method_name, error_msg); return *c_mode != MethodMatcher::Unknown && *m_mode != MethodMatcher::Unknown; } - } return false; } --- 413,434 ---- char class_name[], MethodMatcher::Mode* c_mode, char method_name[], MethodMatcher::Mode* m_mode, int* bytes_read, const char*& error_msg) { *bytes_read = 0; error_msg = NULL; ! int scanned = sscanf(line, "%*[ \t]%255" RANGEDOT " " "%255" RANGE0 "%n", class_name, method_name, bytes_read); ! if (scanned != 2) { ! scanned = sscanf(line, "%*[ \t]%255" RANGEDOT "::" "%255" RANGE0 "%n", class_name, method_name, bytes_read); ! if (scanned != 2) { ! scanned = sscanf(line, "%*[ \t]%255" RANGESLASH "%*[ .]" "%255" RANGE0 "%n", class_name, method_name, bytes_read); ! } ! } ! if (scanned == 2) { *c_mode = check_mode(class_name, error_msg); *m_mode = check_mode(method_name, error_msg); return *c_mode != MethodMatcher::Unknown && *m_mode != MethodMatcher::Unknown; } return false; }