comparison src/share/vm/compiler/compilerOracle.cpp @ 7066:7d815d842ee0

Merge.
author Christian Haeubl <haeubl@ssw.jku.at>
date Fri, 23 Nov 2012 11:50:27 +0100
parents e522a00b91aa
children 989155e2d07a
comparison
equal deleted inserted replaced
7065:cfacf5d5bade 7066:7d815d842ee0
26 #include "compiler/compilerOracle.hpp" 26 #include "compiler/compilerOracle.hpp"
27 #include "memory/allocation.inline.hpp" 27 #include "memory/allocation.inline.hpp"
28 #include "memory/oopFactory.hpp" 28 #include "memory/oopFactory.hpp"
29 #include "memory/resourceArea.hpp" 29 #include "memory/resourceArea.hpp"
30 #include "oops/klass.hpp" 30 #include "oops/klass.hpp"
31 #include "oops/methodOop.hpp" 31 #include "oops/method.hpp"
32 #include "oops/oop.inline.hpp" 32 #include "oops/oop.inline.hpp"
33 #include "oops/symbol.hpp" 33 #include "oops/symbol.hpp"
34 #include "runtime/handles.inline.hpp" 34 #include "runtime/handles.inline.hpp"
35 #include "runtime/jniHandles.hpp" 35 #include "runtime/jniHandles.hpp"
36 36
65 Symbol* signature, MethodMatcher* next); 65 Symbol* signature, MethodMatcher* next);
66 MethodMatcher(Symbol* class_name, Symbol* method_name, MethodMatcher* next); 66 MethodMatcher(Symbol* class_name, Symbol* method_name, MethodMatcher* next);
67 67
68 // utility method 68 // utility method
69 MethodMatcher* find(methodHandle method) { 69 MethodMatcher* find(methodHandle method) {
70 Symbol* class_name = Klass::cast(method->method_holder())->name(); 70 Symbol* class_name = method->method_holder()->name();
71 Symbol* method_name = method->name(); 71 Symbol* method_name = method->name();
72 for (MethodMatcher* current = this; current != NULL; current = current->_next) { 72 for (MethodMatcher* current = this; current != NULL; current = current->_next) {
73 if (match(class_name, current->class_name(), current->_class_mode) && 73 if (match(class_name, current->class_name(), current->_class_mode) &&
74 match(method_name, current->method_name(), current->_method_mode) && 74 match(method_name, current->method_name(), current->_method_mode) &&
75 (current->signature() == NULL || current->signature() == method->signature())) { 75 (current->signature() == NULL || current->signature() == method->signature())) {
453 // exclude,java/lang/String.indexOf 453 // exclude,java/lang/String.indexOf
454 // For backward compatibility, allow space as separator also. 454 // For backward compatibility, allow space as separator also.
455 // exclude java/lang/String indexOf 455 // exclude java/lang/String indexOf
456 // exclude,java/lang/String,indexOf 456 // exclude,java/lang/String,indexOf
457 // For easy cut-and-paste of method names, allow VM output format 457 // For easy cut-and-paste of method names, allow VM output format
458 // as produced by methodOopDesc::print_short_name: 458 // as produced by Method::print_short_name:
459 // exclude java.lang.String::indexOf 459 // exclude java.lang.String::indexOf
460 // For simple implementation convenience here, convert them all to space. 460 // For simple implementation convenience here, convert them all to space.
461 if (have_colon) { 461 if (have_colon) {
462 if (*lp == '.') *lp = '/'; // dots build the package prefix 462 if (*lp == '.') *lp = '/'; // dots build the package prefix
463 if (*lp == ':') *lp = ' '; 463 if (*lp == ':') *lp = ' ';
572 if (stream == NULL) return; 572 if (stream == NULL) return;
573 573
574 char token[1024]; 574 char token[1024];
575 int pos = 0; 575 int pos = 0;
576 int c = getc(stream); 576 int c = getc(stream);
577 while(c != EOF) { 577 while(c != EOF && pos < (int)(sizeof(token)-1)) {
578 if (c == '\n') { 578 if (c == '\n') {
579 token[pos++] = '\0'; 579 token[pos++] = '\0';
580 parse_from_line(token); 580 parse_from_line(token);
581 pos = 0; 581 pos = 0;
582 } else { 582 } else {
593 void CompilerOracle::parse_from_string(const char* str, void (*parse_line)(char*)) { 593 void CompilerOracle::parse_from_string(const char* str, void (*parse_line)(char*)) {
594 char token[1024]; 594 char token[1024];
595 int pos = 0; 595 int pos = 0;
596 const char* sp = str; 596 const char* sp = str;
597 int c = *sp++; 597 int c = *sp++;
598 while (c != '\0') { 598 while (c != '\0' && pos < (int)(sizeof(token)-1)) {
599 if (c == '\n') { 599 if (c == '\n') {
600 token[pos++] = '\0'; 600 token[pos++] = '\0';
601 parse_line(token); 601 parse_line(token);
602 pos = 0; 602 pos = 0;
603 } else { 603 } else {
622 622
623 void CompilerOracle::append_exclude_to_file(methodHandle method) { 623 void CompilerOracle::append_exclude_to_file(methodHandle method) {
624 assert(has_command_file(), "command file must be specified"); 624 assert(has_command_file(), "command file must be specified");
625 fileStream stream(fopen(cc_file(), "at")); 625 fileStream stream(fopen(cc_file(), "at"));
626 stream.print("exclude "); 626 stream.print("exclude ");
627 Klass::cast(method->method_holder())->name()->print_symbol_on(&stream); 627 method->method_holder()->name()->print_symbol_on(&stream);
628 stream.print("."); 628 stream.print(".");
629 method->name()->print_symbol_on(&stream); 629 method->name()->print_symbol_on(&stream);
630 method->signature()->print_symbol_on(&stream); 630 method->signature()->print_symbol_on(&stream);
631 stream.cr(); 631 stream.cr();
632 stream.cr(); 632 stream.cr();