1.1 --- a/src/share/vm/code/dependencies.hpp Tue Aug 12 22:29:36 2014 +0000 1.2 +++ b/src/share/vm/code/dependencies.hpp Thu Aug 07 18:09:12 2014 -0700 1.3 @@ -368,20 +368,36 @@ 1.4 void copy_to(nmethod* nm); 1.5 1.6 void log_all_dependencies(); 1.7 - void log_dependency(DepType dept, int nargs, ciBaseObject* args[]) { 1.8 - write_dependency_to(log(), dept, nargs, args); 1.9 + 1.10 + void log_dependency(DepType dept, GrowableArray<ciBaseObject*>* args) { 1.11 + ResourceMark rm; 1.12 + int argslen = args->length(); 1.13 + write_dependency_to(log(), dept, args); 1.14 + guarantee(argslen == args->length(), 1.15 + "args array cannot grow inside nested ResoureMark scope"); 1.16 } 1.17 + 1.18 void log_dependency(DepType dept, 1.19 ciBaseObject* x0, 1.20 ciBaseObject* x1 = NULL, 1.21 ciBaseObject* x2 = NULL) { 1.22 - if (log() == NULL) return; 1.23 - ciBaseObject* args[max_arg_count]; 1.24 - args[0] = x0; 1.25 - args[1] = x1; 1.26 - args[2] = x2; 1.27 - assert(2 < max_arg_count, ""); 1.28 - log_dependency(dept, dep_args(dept), args); 1.29 + if (log() == NULL) { 1.30 + return; 1.31 + } 1.32 + ResourceMark rm; 1.33 + GrowableArray<ciBaseObject*>* ciargs = 1.34 + new GrowableArray<ciBaseObject*>(dep_args(dept)); 1.35 + assert (x0 != NULL, "no log x0"); 1.36 + ciargs->push(x0); 1.37 + 1.38 + if (x1 != NULL) { 1.39 + ciargs->push(x1); 1.40 + } 1.41 + if (x2 != NULL) { 1.42 + ciargs->push(x2); 1.43 + } 1.44 + assert(ciargs->length() == dep_args(dept), ""); 1.45 + log_dependency(dept, ciargs); 1.46 } 1.47 1.48 class DepArgument : public ResourceObj { 1.49 @@ -404,20 +420,8 @@ 1.50 Metadata* metadata_value() const { assert(!_is_oop && _valid, "must be"); return (Metadata*) _value; } 1.51 }; 1.52 1.53 - static void write_dependency_to(CompileLog* log, 1.54 - DepType dept, 1.55 - int nargs, ciBaseObject* args[], 1.56 - Klass* witness = NULL); 1.57 - static void write_dependency_to(CompileLog* log, 1.58 - DepType dept, 1.59 - int nargs, DepArgument args[], 1.60 - Klass* witness = NULL); 1.61 - static void write_dependency_to(xmlStream* xtty, 1.62 - DepType dept, 1.63 - int nargs, DepArgument args[], 1.64 - Klass* witness = NULL); 1.65 static void print_dependency(DepType dept, 1.66 - int nargs, DepArgument args[], 1.67 + GrowableArray<DepArgument>* args, 1.68 Klass* witness = NULL); 1.69 1.70 private: 1.71 @@ -426,6 +430,18 @@ 1.72 1.73 static Klass* ctxk_encoded_as_null(DepType dept, Metadata* x); 1.74 1.75 + static void write_dependency_to(CompileLog* log, 1.76 + DepType dept, 1.77 + GrowableArray<ciBaseObject*>* args, 1.78 + Klass* witness = NULL); 1.79 + static void write_dependency_to(CompileLog* log, 1.80 + DepType dept, 1.81 + GrowableArray<DepArgument>* args, 1.82 + Klass* witness = NULL); 1.83 + static void write_dependency_to(xmlStream* xtty, 1.84 + DepType dept, 1.85 + GrowableArray<DepArgument>* args, 1.86 + Klass* witness = NULL); 1.87 public: 1.88 // Use this to iterate over an nmethod's dependency set. 1.89 // Works on new and old dependency sets.