< prev index next >

src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp

Print this page
   1 /*
   2  * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 144   debug_only(__ should_not_reach_here());
 145 }
 146 
 147 void DivByZeroStub::emit_code(LIR_Assembler* ce) {
 148   if (_offset != -1) {
 149     ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
 150   }
 151   __ bind(_entry);
 152   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id)));
 153   ce->add_call_info_here(_info);
 154   debug_only(__ should_not_reach_here());
 155 }
 156 
 157 
 158 // Implementation of LoadFlattenedArrayStub
 159 
 160 LoadFlattenedArrayStub::LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) {
 161   _array = array;
 162   _index = index;
 163   _result = result;
 164   _info = new CodeEmitInfo(info);
 165 }
 166 
 167 void LoadFlattenedArrayStub::visit(LIR_OpVisitState* visitor) {
 168   visitor->do_slow_case(_info);
 169   visitor->do_input(_array);
 170   visitor->do_input(_index);
 171   visitor->do_output(_result);
 172 
 173   // Tell the register allocator that the runtime call will scratch rax.
 174   visitor->do_output(FrameMap::rax_oop_opr);

 175 }
 176 
 177 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
 178   assert(__ rsp_offset() == 0, "frame size should be fixed");
 179   __ bind(_entry);
 180   ce->store_parameter(_array->as_register(), 1);
 181   ce->store_parameter(_index->as_register(), 0);
 182   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::load_flattened_array_id)));
 183   ce->add_call_info_here(_info);
 184   ce->verify_oop_map(_info);
 185   if (_result->as_register() != rax) {
 186     __ movptr(_result->as_register(), rax);
 187   }
 188   __ jmp(_continuation);
 189 }
 190 
 191 
 192 // Implementation of StoreFlattenedArrayStub
 193 
 194 StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {


   1 /*
   2  * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 144   debug_only(__ should_not_reach_here());
 145 }
 146 
 147 void DivByZeroStub::emit_code(LIR_Assembler* ce) {
 148   if (_offset != -1) {
 149     ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
 150   }
 151   __ bind(_entry);
 152   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id)));
 153   ce->add_call_info_here(_info);
 154   debug_only(__ should_not_reach_here());
 155 }
 156 
 157 
 158 // Implementation of LoadFlattenedArrayStub
 159 
 160 LoadFlattenedArrayStub::LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) {
 161   _array = array;
 162   _index = index;
 163   _result = result;









 164   // Tell the register allocator that the runtime call will scratch rax.
 165   _scratch_reg = FrameMap::rax_oop_opr;
 166   _info = new CodeEmitInfo(info);
 167 }
 168 
 169 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
 170   assert(__ rsp_offset() == 0, "frame size should be fixed");
 171   __ bind(_entry);
 172   ce->store_parameter(_array->as_register(), 1);
 173   ce->store_parameter(_index->as_register(), 0);
 174   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::load_flattened_array_id)));
 175   ce->add_call_info_here(_info);
 176   ce->verify_oop_map(_info);
 177   if (_result->as_register() != rax) {
 178     __ movptr(_result->as_register(), rax);
 179   }
 180   __ jmp(_continuation);
 181 }
 182 
 183 
 184 // Implementation of StoreFlattenedArrayStub
 185 
 186 StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {


< prev index next >