< prev index next >

src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp

Print this page


  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_CodeStubs.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_MacroAssembler.hpp"
  30 #include "c1/c1_Runtime1.hpp"
  31 #include "nativeInst_x86.hpp"

  32 #include "runtime/sharedRuntime.hpp"
  33 #include "utilities/align.hpp"
  34 #include "utilities/macros.hpp"
  35 #include "vmreg_x86.inline.hpp"
  36 
  37 
  38 #define __ ce->masm()->
  39 
  40 float ConversionStub::float_zero = 0.0;
  41 double ConversionStub::double_zero = 0.0;
  42 
  43 void ConversionStub::emit_code(LIR_Assembler* ce) {
  44   __ bind(_entry);
  45   assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub");
  46 
  47 
  48   if (input()->is_single_xmm()) {
  49     __ comiss(input()->as_xmm_float_reg(),
  50               ExternalAddress((address)&float_zero));
  51   } else if (input()->is_double_xmm()) {


 134   _info = new CodeEmitInfo(info);
 135 }
 136 
 137 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
 138   __ bind(_entry);
 139   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
 140   __ call(RuntimeAddress(a));
 141   ce->add_call_info_here(_info);
 142   ce->verify_oop_map(_info);
 143   debug_only(__ should_not_reach_here());
 144 }
 145 
 146 void DivByZeroStub::emit_code(LIR_Assembler* ce) {
 147   if (_offset != -1) {
 148     ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
 149   }
 150   __ bind(_entry);
 151   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id)));
 152   ce->add_call_info_here(_info);
 153   debug_only(__ should_not_reach_here());

























 154 }
 155 
 156 
 157 // Implementation of NewInstanceStub
 158 
 159 NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
 160   _result = result;
 161   _klass = klass;
 162   _klass_reg = klass_reg;
 163   _info = new CodeEmitInfo(info);
 164   assert(stub_id == Runtime1::new_instance_id                 ||
 165          stub_id == Runtime1::fast_new_instance_id            ||
 166          stub_id == Runtime1::fast_new_instance_init_check_id,
 167          "need new_instance id");
 168   _stub_id   = stub_id;
 169 }
 170 
 171 
 172 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
 173   assert(__ rsp_offset() == 0, "frame size should be fixed");




  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_CodeStubs.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_MacroAssembler.hpp"
  30 #include "c1/c1_Runtime1.hpp"
  31 #include "nativeInst_x86.hpp"
  32 #include "oops/objArrayKlass.hpp"
  33 #include "runtime/sharedRuntime.hpp"
  34 #include "utilities/align.hpp"
  35 #include "utilities/macros.hpp"
  36 #include "vmreg_x86.inline.hpp"
  37 
  38 
  39 #define __ ce->masm()->
  40 
  41 float ConversionStub::float_zero = 0.0;
  42 double ConversionStub::double_zero = 0.0;
  43 
  44 void ConversionStub::emit_code(LIR_Assembler* ce) {
  45   __ bind(_entry);
  46   assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub");
  47 
  48 
  49   if (input()->is_single_xmm()) {
  50     __ comiss(input()->as_xmm_float_reg(),
  51               ExternalAddress((address)&float_zero));
  52   } else if (input()->is_double_xmm()) {


 135   _info = new CodeEmitInfo(info);
 136 }
 137 
 138 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
 139   __ bind(_entry);
 140   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
 141   __ call(RuntimeAddress(a));
 142   ce->add_call_info_here(_info);
 143   ce->verify_oop_map(_info);
 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 
 168 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
 169   assert(__ rsp_offset() == 0, "frame size should be fixed");
 170   __ bind(_entry);
 171   ce->store_parameter(_array->as_register(), 1);
 172   ce->store_parameter(_index->as_register(), 0);
 173   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::load_flattened_array_id)));
 174   ce->add_call_info_here(_info);
 175   ce->verify_oop_map(_info);
 176   if (_result->as_register() != rax) {
 177     __ movptr(_result->as_register(), rax);
 178   }
 179   __ jmp(_continuation);
 180 }
 181 
 182 
 183 // Implementation of NewInstanceStub
 184 
 185 NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
 186   _result = result;
 187   _klass = klass;
 188   _klass_reg = klass_reg;
 189   _info = new CodeEmitInfo(info);
 190   assert(stub_id == Runtime1::new_instance_id                 ||
 191          stub_id == Runtime1::fast_new_instance_id            ||
 192          stub_id == Runtime1::fast_new_instance_init_check_id,
 193          "need new_instance id");
 194   _stub_id   = stub_id;
 195 }
 196 
 197 
 198 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
 199   assert(__ rsp_offset() == 0, "frame size should be fixed");


< prev index next >