hotspot/src/share/vm/opto/graphKit.cpp
changeset 2574 1d5f85c2d755
parent 2570 ecc7862946d4
child 2867 69187054225f
equal deleted inserted replaced
2573:b5002ef26155 2574:1d5f85c2d755
  2978 // helper for both newarray and anewarray
  2978 // helper for both newarray and anewarray
  2979 // The 'length' parameter is (obviously) the length of the array.
  2979 // The 'length' parameter is (obviously) the length of the array.
  2980 // See comments on new_instance for the meaning of the other arguments.
  2980 // See comments on new_instance for the meaning of the other arguments.
  2981 Node* GraphKit::new_array(Node* klass_node,     // array klass (maybe variable)
  2981 Node* GraphKit::new_array(Node* klass_node,     // array klass (maybe variable)
  2982                           Node* length,         // number of array elements
  2982                           Node* length,         // number of array elements
       
  2983                           int   nargs,          // number of arguments to push back for uncommon trap
  2983                           bool raw_mem_only,    // affect only raw memory
  2984                           bool raw_mem_only,    // affect only raw memory
  2984                           Node* *return_size_val) {
  2985                           Node* *return_size_val) {
  2985   jint  layout_con = Klass::_lh_neutral_value;
  2986   jint  layout_con = Klass::_lh_neutral_value;
  2986   Node* layout_val = get_layout_helper(klass_node, layout_con);
  2987   Node* layout_val = get_layout_helper(klass_node, layout_con);
  2987   int   layout_is_con = (layout_val == NULL);
  2988   int   layout_is_con = (layout_val == NULL);
  2993     // so that we can fold up all the address arithmetic.
  2994     // so that we can fold up all the address arithmetic.
  2994     layout_con = Klass::array_layout_helper(T_OBJECT);
  2995     layout_con = Klass::array_layout_helper(T_OBJECT);
  2995     Node* cmp_lh = _gvn.transform( new(C, 3) CmpINode(layout_val, intcon(layout_con)) );
  2996     Node* cmp_lh = _gvn.transform( new(C, 3) CmpINode(layout_val, intcon(layout_con)) );
  2996     Node* bol_lh = _gvn.transform( new(C, 2) BoolNode(cmp_lh, BoolTest::eq) );
  2997     Node* bol_lh = _gvn.transform( new(C, 2) BoolNode(cmp_lh, BoolTest::eq) );
  2997     { BuildCutout unless(this, bol_lh, PROB_MAX);
  2998     { BuildCutout unless(this, bol_lh, PROB_MAX);
       
  2999       _sp += nargs;
  2998       uncommon_trap(Deoptimization::Reason_class_check,
  3000       uncommon_trap(Deoptimization::Reason_class_check,
  2999                     Deoptimization::Action_maybe_recompile);
  3001                     Deoptimization::Action_maybe_recompile);
  3000     }
  3002     }
  3001     layout_val = NULL;
  3003     layout_val = NULL;
  3002     layout_is_con = true;
  3004     layout_is_con = true;