405 int HashtableTextDump::scan_prefix(int* utf8_length) {
406 if (*_p == '@') {
407 scan_prefix_type();
408 }
409
410 switch (_prefix_type) {
411 case SymbolPrefix:
412 *utf8_length = scan_symbol_prefix(); break;
413 case StringPrefix:
414 *utf8_length = scan_string_prefix(); break;
415 default:
416 tty->print_cr("Shared input data type: Unknown.");
417 corrupted(_p, "Unknown data type");
418 }
419
420 return _prefix_type;
421 }
422
423 int HashtableTextDump::scan_string_prefix() {
424 // Expect /[0-9]+: /
425 int utf8_length;
426 get_num(':', &utf8_length);
427 if (*_p != ' ') {
428 corrupted(_p, "Wrong prefix format for string");
429 }
430 _p++;
431 return utf8_length;
432 }
433
434 int HashtableTextDump::scan_symbol_prefix() {
435 // Expect /[0-9]+ (-|)[0-9]+: /
436 int utf8_length;
437 get_num(' ', &utf8_length);
438 if (*_p == '-') {
439 _p++;
440 }
441 int ref_num;
442 (void)get_num(':', &ref_num);
443 if (*_p != ' ') {
444 corrupted(_p, "Wrong prefix format for symbol");
445 }
446 _p++;
447 return utf8_length;
448 }
449
450 jchar HashtableTextDump::unescape(const char* from, const char* end, int count) {
451 jchar value = 0;
452
453 corrupted_if(from + count > end);
454
455 for (int i=0; i<count; i++) {
456 char c = *from++;
|
405 int HashtableTextDump::scan_prefix(int* utf8_length) {
406 if (*_p == '@') {
407 scan_prefix_type();
408 }
409
410 switch (_prefix_type) {
411 case SymbolPrefix:
412 *utf8_length = scan_symbol_prefix(); break;
413 case StringPrefix:
414 *utf8_length = scan_string_prefix(); break;
415 default:
416 tty->print_cr("Shared input data type: Unknown.");
417 corrupted(_p, "Unknown data type");
418 }
419
420 return _prefix_type;
421 }
422
423 int HashtableTextDump::scan_string_prefix() {
424 // Expect /[0-9]+: /
425 int utf8_length = 0;
426 get_num(':', &utf8_length);
427 if (*_p != ' ') {
428 corrupted(_p, "Wrong prefix format for string");
429 }
430 _p++;
431 return utf8_length;
432 }
433
434 int HashtableTextDump::scan_symbol_prefix() {
435 // Expect /[0-9]+ (-|)[0-9]+: /
436 int utf8_length = 0;
437 get_num(' ', &utf8_length);
438 if (*_p == '-') {
439 _p++;
440 }
441 int ref_num;
442 (void)get_num(':', &ref_num);
443 if (*_p != ' ') {
444 corrupted(_p, "Wrong prefix format for symbol");
445 }
446 _p++;
447 return utf8_length;
448 }
449
450 jchar HashtableTextDump::unescape(const char* from, const char* end, int count) {
451 jchar value = 0;
452
453 corrupted_if(from + count > end);
454
455 for (int i=0; i<count; i++) {
456 char c = *from++;
|