Mercurial > hg > truffle
comparison src/cpu/x86/vm/stubGenerator_x86_64.cpp @ 4970:33df1aeaebbf
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 27 Feb 2012 13:10:13 +0100 |
parents | 82af018d61db b522995d91f0 |
children | 957c266d8bc5 |
comparison
equal
deleted
inserted
replaced
4703:2cfb7fb2dce7 | 4970:33df1aeaebbf |
---|---|
2259 #ifdef ASSERT | 2259 #ifdef ASSERT |
2260 BLOCK_COMMENT("assert consistent ckoff/ckval"); | 2260 BLOCK_COMMENT("assert consistent ckoff/ckval"); |
2261 // The ckoff and ckval must be mutually consistent, | 2261 // The ckoff and ckval must be mutually consistent, |
2262 // even though caller generates both. | 2262 // even though caller generates both. |
2263 { Label L; | 2263 { Label L; |
2264 int sco_offset = (klassOopDesc::header_size() * HeapWordSize + | 2264 int sco_offset = in_bytes(Klass::super_check_offset_offset()); |
2265 Klass::super_check_offset_offset_in_bytes()); | |
2266 __ cmpl(ckoff, Address(ckval, sco_offset)); | 2265 __ cmpl(ckoff, Address(ckval, sco_offset)); |
2267 __ jcc(Assembler::equal, L); | 2266 __ jcc(Assembler::equal, L); |
2268 __ stop("super_check_offset inconsistent"); | 2267 __ stop("super_check_offset inconsistent"); |
2269 __ bind(L); | 2268 __ bind(L); |
2270 } | 2269 } |
2570 // 32 30 24 16 8 2 0 | 2569 // 32 30 24 16 8 2 0 |
2571 // | 2570 // |
2572 // array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0 | 2571 // array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0 |
2573 // | 2572 // |
2574 | 2573 |
2575 const int lh_offset = klassOopDesc::header_size() * HeapWordSize + | 2574 const int lh_offset = in_bytes(Klass::layout_helper_offset()); |
2576 Klass::layout_helper_offset_in_bytes(); | |
2577 | 2575 |
2578 // Handle objArrays completely differently... | 2576 // Handle objArrays completely differently... |
2579 const jint objArray_lh = Klass::array_layout_helper(T_OBJECT); | 2577 const jint objArray_lh = Klass::array_layout_helper(T_OBJECT); |
2580 __ cmpl(Address(r10_src_klass, lh_offset), objArray_lh); | 2578 __ cmpl(Address(r10_src_klass, lh_offset), objArray_lh); |
2581 __ jcc(Assembler::equal, L_objArray); | 2579 __ jcc(Assembler::equal, L_objArray); |
2720 assert_different_registers(from, to, count, sco_temp, | 2718 assert_different_registers(from, to, count, sco_temp, |
2721 r11_dst_klass, r10_src_klass); | 2719 r11_dst_klass, r10_src_klass); |
2722 assert_clean_int(count, sco_temp); | 2720 assert_clean_int(count, sco_temp); |
2723 | 2721 |
2724 // Generate the type check. | 2722 // Generate the type check. |
2725 const int sco_offset = (klassOopDesc::header_size() * HeapWordSize + | 2723 const int sco_offset = in_bytes(Klass::super_check_offset_offset()); |
2726 Klass::super_check_offset_offset_in_bytes()); | |
2727 __ movl(sco_temp, Address(r11_dst_klass, sco_offset)); | 2724 __ movl(sco_temp, Address(r11_dst_klass, sco_offset)); |
2728 assert_clean_int(sco_temp, rax); | 2725 assert_clean_int(sco_temp, rax); |
2729 generate_type_check(r10_src_klass, sco_temp, r11_dst_klass, L_plain_copy); | 2726 generate_type_check(r10_src_klass, sco_temp, r11_dst_klass, L_plain_copy); |
2730 | 2727 |
2731 // Fetch destination element klass from the objArrayKlass header. | 2728 // Fetch destination element klass from the objArrayKlass header. |
2732 int ek_offset = (klassOopDesc::header_size() * HeapWordSize + | 2729 int ek_offset = in_bytes(objArrayKlass::element_klass_offset()); |
2733 objArrayKlass::element_klass_offset_in_bytes()); | |
2734 __ movptr(r11_dst_klass, Address(r11_dst_klass, ek_offset)); | 2730 __ movptr(r11_dst_klass, Address(r11_dst_klass, ek_offset)); |
2735 __ movl( sco_temp, Address(r11_dst_klass, sco_offset)); | 2731 __ movl( sco_temp, Address(r11_dst_klass, sco_offset)); |
2736 assert_clean_int(sco_temp, rax); | 2732 assert_clean_int(sco_temp, rax); |
2737 | 2733 |
2738 // the checkcast_copy loop needs two extra arguments: | 2734 // the checkcast_copy loop needs two extra arguments: |
2980 __ subptr(rsp, (framesize-4) << LogBytesPerInt); // prolog | 2976 __ subptr(rsp, (framesize-4) << LogBytesPerInt); // prolog |
2981 | 2977 |
2982 int frame_complete = __ pc() - start; | 2978 int frame_complete = __ pc() - start; |
2983 | 2979 |
2984 // Set up last_Java_sp and last_Java_fp | 2980 // Set up last_Java_sp and last_Java_fp |
2985 __ set_last_Java_frame(rsp, rbp, NULL); | 2981 address the_pc = __ pc(); |
2982 __ set_last_Java_frame(rsp, rbp, the_pc); | |
2983 __ andptr(rsp, -(StackAlignmentInBytes)); // Align stack | |
2986 | 2984 |
2987 // Call runtime | 2985 // Call runtime |
2988 if (arg1 != noreg) { | 2986 if (arg1 != noreg) { |
2989 assert(arg2 != c_rarg1, "clobbered"); | 2987 assert(arg2 != c_rarg1, "clobbered"); |
2990 __ movptr(c_rarg1, arg1); | 2988 __ movptr(c_rarg1, arg1); |
2997 __ call(RuntimeAddress(runtime_entry)); | 2995 __ call(RuntimeAddress(runtime_entry)); |
2998 | 2996 |
2999 // Generate oop map | 2997 // Generate oop map |
3000 OopMap* map = new OopMap(framesize, 0); | 2998 OopMap* map = new OopMap(framesize, 0); |
3001 | 2999 |
3002 oop_maps->add_gc_map(__ pc() - start, map); | 3000 oop_maps->add_gc_map(the_pc - start, map); |
3003 | 3001 |
3004 __ reset_last_Java_frame(true, false); | 3002 __ reset_last_Java_frame(true, true); |
3005 | 3003 |
3006 __ leave(); // required for proper stackwalking of RuntimeStub frame | 3004 __ leave(); // required for proper stackwalking of RuntimeStub frame |
3007 | 3005 |
3008 // check for pending exceptions | 3006 // check for pending exceptions |
3009 #ifdef ASSERT | 3007 #ifdef ASSERT |
3070 // j_rarg0 and j_rarg1 respectively. | 3068 // j_rarg0 and j_rarg1 respectively. |
3071 StubRoutines::_throw_WrongMethodTypeException_entry = | 3069 StubRoutines::_throw_WrongMethodTypeException_entry = |
3072 generate_throw_exception("WrongMethodTypeException throw_exception", | 3070 generate_throw_exception("WrongMethodTypeException throw_exception", |
3073 CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException), | 3071 CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException), |
3074 rax, rcx); | 3072 rax, rcx); |
3073 | |
3074 // Build this early so it's available for the interpreter. | |
3075 StubRoutines::_throw_StackOverflowError_entry = | |
3076 generate_throw_exception("StackOverflowError throw_exception", | |
3077 CAST_FROM_FN_PTR(address, | |
3078 SharedRuntime:: | |
3079 throw_StackOverflowError)); | |
3075 } | 3080 } |
3076 | 3081 |
3077 void generate_all() { | 3082 void generate_all() { |
3078 // Generates all stubs and initializes the entry points | 3083 // Generates all stubs and initializes the entry points |
3079 | 3084 |
3096 generate_throw_exception("NullPointerException at call throw_exception", | 3101 generate_throw_exception("NullPointerException at call throw_exception", |
3097 CAST_FROM_FN_PTR(address, | 3102 CAST_FROM_FN_PTR(address, |
3098 SharedRuntime:: | 3103 SharedRuntime:: |
3099 throw_NullPointerException_at_call)); | 3104 throw_NullPointerException_at_call)); |
3100 | 3105 |
3101 StubRoutines::_throw_StackOverflowError_entry = | |
3102 generate_throw_exception("StackOverflowError throw_exception", | |
3103 CAST_FROM_FN_PTR(address, | |
3104 SharedRuntime:: | |
3105 throw_StackOverflowError)); | |
3106 | |
3107 // entry points that are platform specific | 3106 // entry points that are platform specific |
3108 StubRoutines::x86::_f2i_fixup = generate_f2i_fixup(); | 3107 StubRoutines::x86::_f2i_fixup = generate_f2i_fixup(); |
3109 StubRoutines::x86::_f2l_fixup = generate_f2l_fixup(); | 3108 StubRoutines::x86::_f2l_fixup = generate_f2l_fixup(); |
3110 StubRoutines::x86::_d2i_fixup = generate_d2i_fixup(); | 3109 StubRoutines::x86::_d2i_fixup = generate_d2i_fixup(); |
3111 StubRoutines::x86::_d2l_fixup = generate_d2l_fixup(); | 3110 StubRoutines::x86::_d2l_fixup = generate_d2l_fixup(); |