< prev index next >

src/hotspot/share/c1/c1_CodeStubs.hpp

Print this page
rev 49869 : 8201593: Print array length in ArrayIndexOutOfBoundsException.
Reviewed-by: dholmes

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -145,21 +145,26 @@
 // configured to throw IndexOutOfBoundsException in constructor
 class RangeCheckStub: public CodeStub {
  private:
   CodeEmitInfo* _info;
   LIR_Opr       _index;
+  LIR_Opr       _array;
   bool          _throw_index_out_of_bounds_exception;
 
  public:
-  RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, bool throw_index_out_of_bounds_exception = false);
+  // For ArrayIndexOutOfBoundsException.
+  RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array);
+  // For IndexOutOfBoundsException.
+  RangeCheckStub(CodeEmitInfo* info, LIR_Opr index);
   virtual void emit_code(LIR_Assembler* e);
   virtual CodeEmitInfo* info() const             { return _info; }
   virtual bool is_exception_throw_stub() const   { return true; }
   virtual bool is_range_check_stub() const       { return true; }
   virtual void visit(LIR_OpVisitState* visitor) {
     visitor->do_slow_case(_info);
     visitor->do_input(_index);
+    if (_array) { visitor->do_input(_array); }
   }
 #ifndef PRODUCT
   virtual void print_name(outputStream* out) const { out->print("RangeCheckStub"); }
 #endif // PRODUCT
 };
< prev index next >