Mercurial > hg > graal-compiler
comparison src/share/vm/graal/graalCompiler.cpp @ 9126:bc26f978b0ce
HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
don't use the (wrong) cached value, but ask the runtime on each request.
Fixes regression on xml.* benchmarks @ specjvm2008. The problem was:
After the constructor of Object was deoptimized due to an assumption violation,
it was recompiled again after some time. However, on recompilation, the value
of hasFinalizeSubclass for the class was not updated and it was compiled again
with a, now wrong, assumption, which then triggers deoptimization again.
This was repeated until it hit the recompilation limit (defined by
PerMethodRecompilationCutoff), and therefore only executed by the interpreter
from now on, causing the performance regression.
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Mon, 15 Apr 2013 19:54:58 +0200 |
parents | b78686983a75 |
children | 147162b27799 |
comparison
equal
deleted
inserted
replaced
9125:5b25562f8bd7 | 9126:bc26f978b0ce |
---|---|
291 ResourceMark rm; | 291 ResourceMark rm; |
292 InstanceKlass* ik = (InstanceKlass*) klass(); | 292 InstanceKlass* ik = (InstanceKlass*) klass(); |
293 name = java_lang_String::create_from_str(ik->signature_name(), CHECK_NULL); | 293 name = java_lang_String::create_from_str(ik->signature_name(), CHECK_NULL); |
294 } | 294 } |
295 | 295 |
296 // TODO replace this with the correct value | |
297 bool hasFinalizableSubclass = false; | |
298 | |
299 int sizeOrSpecies; | 296 int sizeOrSpecies; |
300 if (klass->is_interface()) { | 297 if (klass->is_interface()) { |
301 sizeOrSpecies = (int) 0x80000000; // see HotSpotResolvedObjectType.INTERFACE_SPECIES_VALUE | 298 sizeOrSpecies = (int) 0x80000000; // see HotSpotResolvedObjectType.INTERFACE_SPECIES_VALUE |
302 } else if (klass->oop_is_array()) { | 299 } else if (klass->oop_is_array()) { |
303 sizeOrSpecies = (int) 0x7fffffff; // see HotSpotResolvedObjectType.ARRAY_SPECIES_VALUE | 300 sizeOrSpecies = (int) 0x7fffffff; // see HotSpotResolvedObjectType.ARRAY_SPECIES_VALUE |
306 if (!InstanceKlass::cast(klass())->can_be_fastpath_allocated()) { | 303 if (!InstanceKlass::cast(klass())->can_be_fastpath_allocated()) { |
307 sizeOrSpecies = -sizeOrSpecies; | 304 sizeOrSpecies = -sizeOrSpecies; |
308 } | 305 } |
309 } | 306 } |
310 | 307 |
311 return VMToCompiler::createResolvedJavaType(klass(), name, simpleName, java_class, hasFinalizableSubclass, sizeOrSpecies, CHECK_NULL); | 308 return VMToCompiler::createResolvedJavaType(klass(), name, simpleName, java_class, sizeOrSpecies, CHECK_NULL); |
312 } | 309 } |
313 | 310 |
314 BasicType GraalCompiler::kindToBasicType(jchar ch) { | 311 BasicType GraalCompiler::kindToBasicType(jchar ch) { |
315 switch(ch) { | 312 switch(ch) { |
316 case 'z': return T_BOOLEAN; | 313 case 'z': return T_BOOLEAN; |