366 ResourceMark rm; |
366 ResourceMark rm; |
367 int size = (MAX_inst_size + MAX_stubs_size + MAX_const_size); |
367 int size = (MAX_inst_size + MAX_stubs_size + MAX_const_size); |
368 BufferBlob* blob = BufferBlob::create("Compile::scratch_buffer", size); |
368 BufferBlob* blob = BufferBlob::create("Compile::scratch_buffer", size); |
369 // Record the buffer blob for next time. |
369 // Record the buffer blob for next time. |
370 set_scratch_buffer_blob(blob); |
370 set_scratch_buffer_blob(blob); |
371 guarantee(scratch_buffer_blob() != NULL, "Need BufferBlob for code generation"); |
371 // Have we run out of code space? |
|
372 if (scratch_buffer_blob() == NULL) { |
|
373 // Let CompilerBroker disable further compilations. |
|
374 record_failure("Not enough space for scratch buffer in CodeCache"); |
|
375 return; |
|
376 } |
372 |
377 |
373 // Initialize the relocation buffers |
378 // Initialize the relocation buffers |
374 relocInfo* locs_buf = (relocInfo*) blob->instructions_end() - MAX_locs_size; |
379 relocInfo* locs_buf = (relocInfo*) blob->instructions_end() - MAX_locs_size; |
375 set_scratch_locs_memory(locs_buf); |
380 set_scratch_locs_memory(locs_buf); |
376 } |
381 } |
1063 if( to && _AliasLevel >= 2 && to != TypeOopPtr::BOTTOM ) { |
1068 if( to && _AliasLevel >= 2 && to != TypeOopPtr::BOTTOM ) { |
1064 if( ptr == TypePtr::Constant ) { |
1069 if( ptr == TypePtr::Constant ) { |
1065 // No constant oop pointers (such as Strings); they alias with |
1070 // No constant oop pointers (such as Strings); they alias with |
1066 // unknown strings. |
1071 // unknown strings. |
1067 tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset); |
1072 tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset); |
|
1073 } else if( to->is_instance_field() ) { |
|
1074 tj = to; // Keep NotNull and klass_is_exact for instance type |
1068 } else if( ptr == TypePtr::NotNull || to->klass_is_exact() ) { |
1075 } else if( ptr == TypePtr::NotNull || to->klass_is_exact() ) { |
1069 // During the 2nd round of IterGVN, NotNull castings are removed. |
1076 // During the 2nd round of IterGVN, NotNull castings are removed. |
1070 // Make sure the Bottom and NotNull variants alias the same. |
1077 // Make sure the Bottom and NotNull variants alias the same. |
1071 // Also, make sure exact and non-exact variants alias the same. |
1078 // Also, make sure exact and non-exact variants alias the same. |
1072 tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset, to->instance_id()); |
1079 tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset, to->instance_id()); |
1082 tj = TypeOopPtr::BOTTOM; |
1089 tj = TypeOopPtr::BOTTOM; |
1083 offset = tj->offset(); |
1090 offset = tj->offset(); |
1084 } else { |
1091 } else { |
1085 ciInstanceKlass *canonical_holder = k->get_canonical_holder(offset); |
1092 ciInstanceKlass *canonical_holder = k->get_canonical_holder(offset); |
1086 if (!k->equals(canonical_holder) || tj->offset() != offset) { |
1093 if (!k->equals(canonical_holder) || tj->offset() != offset) { |
1087 tj = to = TypeInstPtr::make(TypePtr::BotPTR, canonical_holder, false, NULL, offset, to->instance_id()); |
1094 tj = to = TypeInstPtr::make(to->ptr(), canonical_holder, false, NULL, offset, to->instance_id()); |
1088 } |
1095 } |
1089 } |
1096 } |
1090 } |
1097 } |
1091 |
1098 |
1092 // Klass pointers to object array klasses need some flattening |
1099 // Klass pointers to object array klasses need some flattening |