< prev index next >
src/share/vm/opto/compile.cpp
Print this page
*** 59,68 ****
--- 59,69 ----
#include "opto/output.hpp"
#include "opto/parse.hpp"
#include "opto/phaseX.hpp"
#include "opto/rootnode.hpp"
#include "opto/runtime.hpp"
+ #include "opto/shenandoahSupport.hpp"
#include "opto/stringopts.hpp"
#include "opto/type.hpp"
#include "opto/vectornode.hpp"
#include "runtime/arguments.hpp"
#include "runtime/sharedRuntime.hpp"
*** 755,765 ****
// Normal case.
init_tf(TypeFunc::make(method()));
StartNode* s = new StartNode(root(), tf()->domain());
initial_gvn()->set_type_bottom(s);
init_start(s);
! if (method()->intrinsic_id() == vmIntrinsics::_Reference_get && UseG1GC) {
// With java.lang.ref.reference.get() we must go through the
// intrinsic when G1 is enabled - even when get() is the root
// method of the compile - so that, if necessary, the value in
// the referent field of the reference object gets recorded by
// the pre-barrier code.
--- 756,767 ----
// Normal case.
init_tf(TypeFunc::make(method()));
StartNode* s = new StartNode(root(), tf()->domain());
initial_gvn()->set_type_bottom(s);
init_start(s);
! if (method()->intrinsic_id() == vmIntrinsics::_Reference_get
! && (UseG1GC || UseShenandoahGC)) {
// With java.lang.ref.reference.get() we must go through the
// intrinsic when G1 is enabled - even when get() is the root
// method of the compile - so that, if necessary, the value in
// the referent field of the reference object gets recorded by
// the pre-barrier code.
*** 1432,1441 ****
--- 1434,1446 ----
ptr = TypePtr::BotPTR;
} else if( offset == oopDesc::mark_offset_in_bytes() ) {
tj = TypeInstPtr::MARK;
ta = TypeAryPtr::RANGE; // generic ignored junk
ptr = TypePtr::BotPTR;
+ } else if (offset == -8) {
+ // Need to distinguish brooks ptr as is.
+ tj = ta = TypeAryPtr::make(ptr,ta->ary(),ta->klass(),false,offset);
} else { // Random constant offset into array body
offset = Type::OffsetBot; // Flatten constant access into array body
tj = ta = TypeAryPtr::make(ptr,ta->ary(),ta->klass(),false,offset);
}
}
*** 1496,1506 ****
// First handle header references such as a LoadKlassNode, even if the
// object's klass is unloaded at compile time (4965979).
if (!is_known_inst) { // Do it only for non-instance types
tj = to = TypeInstPtr::make(TypePtr::BotPTR, env()->Object_klass(), false, NULL, offset);
}
! } else if (offset < 0 || offset >= k->size_helper() * wordSize) {
// Static fields are in the space above the normal instance
// fields in the java.lang.Class instance.
if (to->klass() != ciEnv::current()->Class_klass()) {
to = NULL;
tj = TypeOopPtr::BOTTOM;
--- 1501,1511 ----
// First handle header references such as a LoadKlassNode, even if the
// object's klass is unloaded at compile time (4965979).
if (!is_known_inst) { // Do it only for non-instance types
tj = to = TypeInstPtr::make(TypePtr::BotPTR, env()->Object_klass(), false, NULL, offset);
}
! } else if ((offset != -8) && (offset < 0 || offset >= k->size_helper() * wordSize)) {
// Static fields are in the space above the normal instance
// fields in the java.lang.Class instance.
if (to->klass() != ciEnv::current()->Class_klass()) {
to = NULL;
tj = TypeOopPtr::BOTTOM;
*** 1594,1604 ****
(offset == Type::OffsetBot && tj->base() == Type::AryPtr) ||
(offset == Type::OffsetBot && tj == TypeOopPtr::BOTTOM) ||
(offset == Type::OffsetBot && tj == TypePtr::BOTTOM) ||
(offset == oopDesc::mark_offset_in_bytes() && tj->base() == Type::AryPtr) ||
(offset == oopDesc::klass_offset_in_bytes() && tj->base() == Type::AryPtr) ||
! (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr) ,
"For oops, klasses, raw offset must be constant; for arrays the offset is never known" );
assert( tj->ptr() != TypePtr::TopPTR &&
tj->ptr() != TypePtr::AnyNull &&
tj->ptr() != TypePtr::Null, "No imprecise addresses" );
// assert( tj->ptr() != TypePtr::Constant ||
--- 1599,1610 ----
(offset == Type::OffsetBot && tj->base() == Type::AryPtr) ||
(offset == Type::OffsetBot && tj == TypeOopPtr::BOTTOM) ||
(offset == Type::OffsetBot && tj == TypePtr::BOTTOM) ||
(offset == oopDesc::mark_offset_in_bytes() && tj->base() == Type::AryPtr) ||
(offset == oopDesc::klass_offset_in_bytes() && tj->base() == Type::AryPtr) ||
! (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr) ||
! (offset == -8 && tj->base() == Type::AryPtr && UseShenandoahGC),
"For oops, klasses, raw offset must be constant; for arrays the offset is never known" );
assert( tj->ptr() != TypePtr::TopPTR &&
tj->ptr() != TypePtr::AnyNull &&
tj->ptr() != TypePtr::Null, "No imprecise addresses" );
// assert( tj->ptr() != TypePtr::Constant ||
*** 2848,2858 ****
wq.push(n);
for (uint next = 0; next < wq.size(); ++next) {
Node *m = wq.at(next);
for (DUIterator_Fast imax, i = m->fast_outs(imax); i < imax; i++) {
Node* use = m->fast_out(i);
! if (use->is_Mem() || use->is_EncodeNarrowPtr()) {
use->ensure_control_or_add_prec(n->in(0));
} else if (use->in(0) == NULL) {
switch(use->Opcode()) {
case Op_AddP:
case Op_DecodeN:
--- 2854,2864 ----
wq.push(n);
for (uint next = 0; next < wq.size(); ++next) {
Node *m = wq.at(next);
for (DUIterator_Fast imax, i = m->fast_outs(imax); i < imax; i++) {
Node* use = m->fast_out(i);
! if (use->is_Mem() || use->is_EncodeNarrowPtr() || use->is_ShenandoahBarrier()) {
use->ensure_control_or_add_prec(n->in(0));
} else if (use->in(0) == NULL) {
switch(use->Opcode()) {
case Op_AddP:
case Op_DecodeN:
*** 3172,3181 ****
--- 3178,3192 ----
// confuses register allocation.
if (n->req() > MemBarNode::Precedent) {
n->set_req(MemBarNode::Precedent, top());
}
break;
+ case Op_ShenandoahReadBarrier:
+ break;
+ case Op_ShenandoahWriteBarrier:
+ n->set_req(ShenandoahBarrierNode::Memory, immutable_memory());
+ break;
default:
assert( !n->is_Call(), "" );
assert( !n->is_Mem(), "" );
assert( nop != Op_ProfileBoolean, "should be eliminated during IGVN");
break;
*** 3538,3548 ****
// Verify GC barriers consistency
// Currently supported:
// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre())
void Compile::verify_barriers() {
! if (UseG1GC) {
// Verify G1 pre-barriers
const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active());
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List visited(area);
--- 3549,3559 ----
// Verify GC barriers consistency
// Currently supported:
// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre())
void Compile::verify_barriers() {
! if (UseG1GC || UseShenandoahGC) {
// Verify G1 pre-barriers
const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active());
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List visited(area);
< prev index next >