src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp
changeset 50094 2f79462aab9b
parent 49950 7b916885654d
child 50380 bec342339138
equal deleted inserted replaced
50093:55153a374d18 50094:2f79462aab9b
     1 /*
     1 /*
     2  * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2008, 2018, 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.
   183   __ should_not_reach_here();
   183   __ should_not_reach_here();
   184 
   184 
   185   return entry;
   185   return entry;
   186 }
   186 }
   187 
   187 
   188 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler(const char* name) {
   188 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler() {
   189   address entry = __ pc();
   189   address entry = __ pc();
   190 
   190 
   191   // index is in R4_ArrayIndexOutOfBounds_index
   191   // index is in R4_ArrayIndexOutOfBounds_index
   192 
       
   193   InlinedString Lname(name);
       
   194 
   192 
   195   // expression stack must be empty before entering the VM if an exception happened
   193   // expression stack must be empty before entering the VM if an exception happened
   196   __ empty_expression_stack();
   194   __ empty_expression_stack();
   197 
   195 
   198   // setup parameters
   196   // setup parameters
   199   __ ldr_literal(R1, Lname);
   197   // Array expected in R1.
   200   __ mov(R2, R4_ArrayIndexOutOfBounds_index);
   198   __ mov(R2, R4_ArrayIndexOutOfBounds_index);
   201 
   199 
   202   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException), R1, R2);
   200   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException), R1, R2);
   203 
   201 
   204   __ nop(); // to avoid filling CPU pipeline with invalid instructions
   202   __ nop(); // to avoid filling CPU pipeline with invalid instructions
   205   __ nop();
   203   __ nop();
   206   __ should_not_reach_here();
   204   __ should_not_reach_here();
   207   __ bind_literal(Lname);
       
   208 
   205 
   209   return entry;
   206   return entry;
   210 }
   207 }
   211 
   208 
   212 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
   209 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {