src/hotspot/share/c1/c1_LIRGenerator.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54200 af3f568cbd2d
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
    34 #include "ci/ciInstance.hpp"
    34 #include "ci/ciInstance.hpp"
    35 #include "ci/ciObjArray.hpp"
    35 #include "ci/ciObjArray.hpp"
    36 #include "ci/ciUtilities.hpp"
    36 #include "ci/ciUtilities.hpp"
    37 #include "gc/shared/barrierSet.hpp"
    37 #include "gc/shared/barrierSet.hpp"
    38 #include "gc/shared/c1/barrierSetC1.hpp"
    38 #include "gc/shared/c1/barrierSetC1.hpp"
       
    39 #include "oops/klass.inline.hpp"
    39 #include "runtime/arguments.hpp"
    40 #include "runtime/arguments.hpp"
    40 #include "runtime/sharedRuntime.hpp"
    41 #include "runtime/sharedRuntime.hpp"
    41 #include "runtime/stubRoutines.hpp"
    42 #include "runtime/stubRoutines.hpp"
    42 #include "runtime/vm_version.hpp"
    43 #include "runtime/vm_version.hpp"
    43 #include "utilities/bitMap.inline.hpp"
    44 #include "utilities/bitMap.inline.hpp"
  1544 
  1545 
  1545 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) {
  1546 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) {
  1546   assert(x->is_pinned(),"");
  1547   assert(x->is_pinned(),"");
  1547   bool needs_range_check = x->compute_needs_range_check();
  1548   bool needs_range_check = x->compute_needs_range_check();
  1548   bool use_length = x->length() != NULL;
  1549   bool use_length = x->length() != NULL;
  1549   bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT;
  1550   bool obj_store = is_reference_type(x->elt_type());
  1550   bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
  1551   bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
  1551                                          !get_jobject_constant(x->value())->is_null_object() ||
  1552                                          !get_jobject_constant(x->value())->is_null_object() ||
  1552                                          x->should_profile());
  1553                                          x->should_profile());
  1553 
  1554 
  1554   LIRItem array(x->array(), this);
  1555   LIRItem array(x->array(), this);
  2161     decorators |= MO_SEQ_CST;
  2162     decorators |= MO_SEQ_CST;
  2162   }
  2163   }
  2163   if (type == T_BOOLEAN) {
  2164   if (type == T_BOOLEAN) {
  2164     decorators |= C1_MASK_BOOLEAN;
  2165     decorators |= C1_MASK_BOOLEAN;
  2165   }
  2166   }
  2166   if (type == T_ARRAY || type == T_OBJECT) {
  2167   if (is_reference_type(type)) {
  2167     decorators |= ON_UNKNOWN_OOP_REF;
  2168     decorators |= ON_UNKNOWN_OOP_REF;
  2168   }
  2169   }
  2169 
  2170 
  2170   LIR_Opr result = rlock_result(x, type);
  2171   LIR_Opr result = rlock_result(x, type);
  2171   access_load_at(decorators, type,
  2172   access_load_at(decorators, type,
  2188   off.load_item();
  2189   off.load_item();
  2189 
  2190 
  2190   set_no_result(x);
  2191   set_no_result(x);
  2191 
  2192 
  2192   DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS;
  2193   DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS;
  2193   if (type == T_ARRAY || type == T_OBJECT) {
  2194   if (is_reference_type(type)) {
  2194     decorators |= ON_UNKNOWN_OOP_REF;
  2195     decorators |= ON_UNKNOWN_OOP_REF;
  2195   }
  2196   }
  2196   if (x->is_volatile()) {
  2197   if (x->is_volatile()) {
  2197     decorators |= MO_SEQ_CST;
  2198     decorators |= MO_SEQ_CST;
  2198   }
  2199   }
  2205   LIRItem off(x->offset(), this);
  2206   LIRItem off(x->offset(), this);
  2206   LIRItem value(x->value(), this);
  2207   LIRItem value(x->value(), this);
  2207 
  2208 
  2208   DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS | MO_SEQ_CST;
  2209   DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS | MO_SEQ_CST;
  2209 
  2210 
  2210   if (type == T_ARRAY || type == T_OBJECT) {
  2211   if (is_reference_type(type)) {
  2211     decorators |= ON_UNKNOWN_OOP_REF;
  2212     decorators |= ON_UNKNOWN_OOP_REF;
  2212   }
  2213   }
  2213 
  2214 
  2214   LIR_Opr result;
  2215   LIR_Opr result;
  2215   if (x->is_add()) {
  2216   if (x->is_add()) {
  2598       LIR_Opr mdp = LIR_OprFact::illegalOpr;
  2599       LIR_Opr mdp = LIR_OprFact::illegalOpr;
  2599       for (int java_index = 0, i = 0, j = 0; j < parameters_type_data->number_of_parameters(); i++) {
  2600       for (int java_index = 0, i = 0, j = 0; j < parameters_type_data->number_of_parameters(); i++) {
  2600         LIR_Opr src = args->at(i);
  2601         LIR_Opr src = args->at(i);
  2601         assert(!src->is_illegal(), "check");
  2602         assert(!src->is_illegal(), "check");
  2602         BasicType t = src->type();
  2603         BasicType t = src->type();
  2603         if (t == T_OBJECT || t == T_ARRAY) {
  2604         if (is_reference_type(t)) {
  2604           intptr_t profiled_k = parameters->type(j);
  2605           intptr_t profiled_k = parameters->type(j);
  2605           Local* local = x->state()->local_at(java_index)->as_Local();
  2606           Local* local = x->state()->local_at(java_index)->as_Local();
  2606           ciKlass* exact = profile_type(md, md->byte_offset_of_slot(parameters_type_data, ParametersTypeData::type_offset(0)),
  2607           ciKlass* exact = profile_type(md, md->byte_offset_of_slot(parameters_type_data, ParametersTypeData::type_offset(0)),
  2607                                         in_bytes(ParametersTypeData::type_offset(j)) - in_bytes(ParametersTypeData::type_offset(0)),
  2608                                         in_bytes(ParametersTypeData::type_offset(j)) - in_bytes(ParametersTypeData::type_offset(0)),
  2608                                         profiled_k, local, mdp, false, local->declared_type()->as_klass(), NULL);
  2609                                         profiled_k, local, mdp, false, local->declared_type()->as_klass(), NULL);