hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
changeset 1066 717c3345024f
parent 1 489c9b5090e2
child 1217 5eb97f366a6a
child 1394 43b4b8b54e65
equal deleted inserted replaced
1065:dbeb68f8a0ee 1066:717c3345024f
    41               ExternalAddress((address)&float_zero));
    41               ExternalAddress((address)&float_zero));
    42   } else if (input()->is_double_xmm()) {
    42   } else if (input()->is_double_xmm()) {
    43     __ comisd(input()->as_xmm_double_reg(),
    43     __ comisd(input()->as_xmm_double_reg(),
    44               ExternalAddress((address)&double_zero));
    44               ExternalAddress((address)&double_zero));
    45   } else {
    45   } else {
    46     __ pushl(rax);
    46     LP64_ONLY(ShouldNotReachHere());
       
    47     __ push(rax);
    47     __ ftst();
    48     __ ftst();
    48     __ fnstsw_ax();
    49     __ fnstsw_ax();
    49     __ sahf();
    50     __ sahf();
    50     __ popl(rax);
    51     __ pop(rax);
    51   }
    52   }
    52 
    53 
    53   Label NaN, do_return;
    54   Label NaN, do_return;
    54   __ jccb(Assembler::parity, NaN);
    55   __ jccb(Assembler::parity, NaN);
    55   __ jccb(Assembler::below, do_return);
    56   __ jccb(Assembler::below, do_return);
    59   __ decrement(result()->as_register());
    60   __ decrement(result()->as_register());
    60   __ jmpb(do_return);
    61   __ jmpb(do_return);
    61 
    62 
    62   // input is NaN -> return 0
    63   // input is NaN -> return 0
    63   __ bind(NaN);
    64   __ bind(NaN);
    64   __ xorl(result()->as_register(), result()->as_register());
    65   __ xorptr(result()->as_register(), result()->as_register());
    65 
    66 
    66   __ bind(do_return);
    67   __ bind(do_return);
    67   __ jmp(_continuation);
    68   __ jmp(_continuation);
    68 }
    69 }
    69 
    70 
   137 
   138 
   138 
   139 
   139 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
   140 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
   140   assert(__ rsp_offset() == 0, "frame size should be fixed");
   141   assert(__ rsp_offset() == 0, "frame size should be fixed");
   141   __ bind(_entry);
   142   __ bind(_entry);
   142   __ movl(rdx, _klass_reg->as_register());
   143   __ movptr(rdx, _klass_reg->as_register());
   143   __ call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
   144   __ call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
   144   ce->add_call_info_here(_info);
   145   ce->add_call_info_here(_info);
   145   ce->verify_oop_map(_info);
   146   ce->verify_oop_map(_info);
   146   assert(_result->as_register() == rax, "result must in rax,");
   147   assert(_result->as_register() == rax, "result must in rax,");
   147   __ jmp(_continuation);
   148   __ jmp(_continuation);
   304       __ block_comment(" being_initialized check");
   305       __ block_comment(" being_initialized check");
   305     }
   306     }
   306     assert(_obj != noreg, "must be a valid register");
   307     assert(_obj != noreg, "must be a valid register");
   307     Register tmp = rax;
   308     Register tmp = rax;
   308     if (_obj == tmp) tmp = rbx;
   309     if (_obj == tmp) tmp = rbx;
   309     __ pushl(tmp);
   310     __ push(tmp);
   310     __ get_thread(tmp);
   311     __ get_thread(tmp);
   311     __ cmpl(tmp, Address(_obj, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
   312     __ cmpptr(tmp, Address(_obj, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
   312     __ popl(tmp);
   313     __ pop(tmp);
   313     __ jcc(Assembler::notEqual, call_patch);
   314     __ jcc(Assembler::notEqual, call_patch);
   314 
   315 
   315     // access_field patches may execute the patched code before it's
   316     // access_field patches may execute the patched code before it's
   316     // copied back into place so we need to jump back into the main
   317     // copied back into place so we need to jump back into the main
   317     // code of the nmethod to continue execution.
   318     // code of the nmethod to continue execution.
   432   // next registers will get stored on the stack
   433   // next registers will get stored on the stack
   433   for (int i = 0; i < 5 ; i++ ) {
   434   for (int i = 0; i < 5 ; i++ ) {
   434     VMReg r_1 = args[i].first();
   435     VMReg r_1 = args[i].first();
   435     if (r_1->is_stack()) {
   436     if (r_1->is_stack()) {
   436       int st_off = r_1->reg2stack() * wordSize;
   437       int st_off = r_1->reg2stack() * wordSize;
   437       __ movl (Address(rsp, st_off), r[i]);
   438       __ movptr (Address(rsp, st_off), r[i]);
   438     } else {
   439     } else {
   439       assert(r[i] == args[i].first()->as_Register(), "Wrong register for arg ");
   440       assert(r[i] == args[i].first()->as_Register(), "Wrong register for arg ");
   440     }
   441     }
   441   }
   442   }
   442 
   443 
   447                          relocInfo::static_call_type);
   448                          relocInfo::static_call_type);
   448   __ call(resolve);
   449   __ call(resolve);
   449   ce->add_call_info_here(info());
   450   ce->add_call_info_here(info());
   450 
   451 
   451 #ifndef PRODUCT
   452 #ifndef PRODUCT
   452   __ increment(ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
   453   __ incrementl(ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
   453 #endif
   454 #endif
   454 
   455 
   455   __ jmp(_continuation);
   456   __ jmp(_continuation);
   456 }
   457 }
   457 
   458