comparison src/share/vm/graal/graalCompiler.cpp @ 10409:36bcc10e01c0

merge fixes
author Doug Simon <doug.simon@oracle.com>
date Wed, 19 Jun 2013 15:37:32 +0200
parents a323a9e20f9d
children 4b88e5c93f04
comparison
equal deleted inserted replaced
10408:836a62f43af9 10409:36bcc10e01c0
134 if (_deopted_leaf_graph_count == LEAF_GRAPH_ARRAY_SIZE) { 134 if (_deopted_leaf_graph_count == LEAF_GRAPH_ARRAY_SIZE) {
135 length = 0; 135 length = 0;
136 } else { 136 } else {
137 length = _deopted_leaf_graph_count; 137 length = _deopted_leaf_graph_count;
138 } 138 }
139 elements = new jlong[length]; 139 elements = NEW_C_HEAP_ARRAY(jlong, length, mtCompiler);
140 for (int i = 0; i < length; i++) { 140 for (int i = 0; i < length; i++) {
141 elements[i] = _deopted_leaf_graphs[i]; 141 elements[i] = _deopted_leaf_graphs[i];
142 } 142 }
143 _deopted_leaf_graph_count = 0; 143 _deopted_leaf_graph_count = 0;
144 } 144 }
145 typeArrayOop array = oopFactory::new_longArray(length, CHECK_NULL); 145 typeArrayOop array = oopFactory::new_longArray(length, CHECK_NULL);
146 for (int i = 0; i < length; i++) { 146 for (int i = 0; i < length; i++) {
147 array->long_at_put(i, elements[i]); 147 array->long_at_put(i, elements[i]);
148 } 148 }
149 delete elements; 149 FREE_C_HEAP_ARRAY(jlong, elements, mtCompiler);
150 return array; 150 return array;
151 } 151 }
152 152
153 void GraalCompiler::initialize_buffer_blob() { 153 void GraalCompiler::initialize_buffer_blob() {
154 154
169 169
170 assert(_initialized, "must already be initialized"); 170 assert(_initialized, "must already be initialized");
171 ResourceMark rm; 171 ResourceMark rm;
172 JavaThread::current()->set_is_compiling(true); 172 JavaThread::current()->set_is_compiling(true);
173 Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK); 173 Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK);
174 VMToCompiler::compileMethod(method(), holder, entry_bci, blocking, method->graal_priority()); 174 MethodCounters* mcs = method->method_counters();
175 VMToCompiler::compileMethod(method(), holder, entry_bci, blocking, mcs->graal_priority());
175 JavaThread::current()->set_is_compiling(false); 176 JavaThread::current()->set_is_compiling(false);
176 } 177 }
177 178
178 // Compilation entry point for methods 179 // Compilation entry point for methods
179 void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { 180 void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
221 Symbol* klass_name = NULL; 222 Symbol* klass_name = NULL;
222 { 223 {
223 // We have to lock the cpool to keep the oop from being resolved 224 // We have to lock the cpool to keep the oop from being resolved
224 // while we are accessing it. But we must release the lock before 225 // while we are accessing it. But we must release the lock before
225 // calling up into Java. 226 // calling up into Java.
226 MonitorLockerEx ml(cp->lock()); 227 oop cplock = cp->lock();
228 ObjectLocker ol(cplock, THREAD, cplock != NULL);
227 constantTag tag = cp->tag_at(index); 229 constantTag tag = cp->tag_at(index);
228 if (tag.is_klass()) { 230 if (tag.is_klass()) {
229 // The klass has been inserted into the constant pool 231 // The klass has been inserted into the constant pool
230 // very recently. 232 // very recently.
231 return GraalCompiler::get_JavaType(cp->resolved_klass_at(index), CHECK_NULL); 233 return GraalCompiler::get_JavaType(cp->resolved_klass_at(index), CHECK_NULL);