src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
changeset 53223 df6cbf676c70
parent 52829 af52abc1f61e
child 53226 4ff3f9d83fe5
equal deleted inserted replaced
53222:8be214962266 53223:df6cbf676c70
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   187   init_class_id(Class_LoadBarrier);
   187   init_class_id(Class_LoadBarrier);
   188   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
   188   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
   189   bs->register_potential_barrier_node(this);
   189   bs->register_potential_barrier_node(this);
   190 }
   190 }
   191 
   191 
       
   192 uint LoadBarrierNode::size_of() const {
       
   193   return sizeof(*this);
       
   194 }
       
   195 
       
   196 uint LoadBarrierNode::cmp(const Node& n) const {
       
   197   ShouldNotReachHere();
       
   198   return 0;
       
   199 }
       
   200 
   192 const Type *LoadBarrierNode::bottom_type() const {
   201 const Type *LoadBarrierNode::bottom_type() const {
   193   const Type** floadbarrier = (const Type **)(Compile::current()->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*)));
   202   const Type** floadbarrier = (const Type **)(Compile::current()->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*)));
   194   Node* in_oop = in(Oop);
   203   Node* in_oop = in(Oop);
   195   floadbarrier[Control] = Type::CONTROL;
   204   floadbarrier[Control] = Type::CONTROL;
   196   floadbarrier[Memory] = Type::MEMORY;
   205   floadbarrier[Memory] = Type::MEMORY;
   197   floadbarrier[Oop] = in_oop == NULL ? Type::TOP : in_oop->bottom_type();
   206   floadbarrier[Oop] = in_oop == NULL ? Type::TOP : in_oop->bottom_type();
   198   return TypeTuple::make(Number_of_Outputs, floadbarrier);
   207   return TypeTuple::make(Number_of_Outputs, floadbarrier);
       
   208 }
       
   209 
       
   210 const TypePtr* LoadBarrierNode::adr_type() const {
       
   211   ShouldNotReachHere();
       
   212   return NULL;
   199 }
   213 }
   200 
   214 
   201 const Type *LoadBarrierNode::Value(PhaseGVN *phase) const {
   215 const Type *LoadBarrierNode::Value(PhaseGVN *phase) const {
   202   const Type** floadbarrier = (const Type **)(phase->C->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*)));
   216   const Type** floadbarrier = (const Type **)(phase->C->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*)));
   203   const Type* val_t = phase->type(in(Oop));
   217   const Type* val_t = phase->type(in(Oop));
   439   }
   453   }
   440 
   454 
   441   return NULL;
   455   return NULL;
   442 }
   456 }
   443 
   457 
       
   458 uint LoadBarrierNode::match_edge(uint idx) const {
       
   459   ShouldNotReachHere();
       
   460   return 0;
       
   461 }
       
   462 
   444 void LoadBarrierNode::fix_similar_in_uses(PhaseIterGVN* igvn) {
   463 void LoadBarrierNode::fix_similar_in_uses(PhaseIterGVN* igvn) {
   445   Node* out_res = proj_out_or_null(Oop);
   464   Node* out_res = proj_out_or_null(Oop);
   446   if (out_res == NULL) {
   465   if (out_res == NULL) {
   447     return;
   466     return;
   448   }
   467   }