comparison src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 22cee0ee8927
children db9981fd3124
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2012, 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.
26 #include "c1/c1_Defs.hpp" 26 #include "c1/c1_Defs.hpp"
27 #include "c1/c1_MacroAssembler.hpp" 27 #include "c1/c1_MacroAssembler.hpp"
28 #include "c1/c1_Runtime1.hpp" 28 #include "c1/c1_Runtime1.hpp"
29 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreter.hpp"
30 #include "nativeInst_sparc.hpp" 30 #include "nativeInst_sparc.hpp"
31 #include "oops/compiledICHolderOop.hpp" 31 #include "oops/compiledICHolder.hpp"
32 #include "oops/oop.inline.hpp" 32 #include "oops/oop.inline.hpp"
33 #include "prims/jvmtiExport.hpp" 33 #include "prims/jvmtiExport.hpp"
34 #include "register_sparc.hpp" 34 #include "register_sparc.hpp"
35 #include "runtime/sharedRuntime.hpp" 35 #include "runtime/sharedRuntime.hpp"
36 #include "runtime/signature.hpp" 36 #include "runtime/signature.hpp"
37 #include "runtime/vframeArray.hpp" 37 #include "runtime/vframeArray.hpp"
38 #include "vmreg_sparc.inline.hpp" 38 #include "vmreg_sparc.inline.hpp"
39 39
40 // Implementation of StubAssembler 40 // Implementation of StubAssembler
41 41
42 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry_point, int number_of_arguments) { 42 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) {
43 // for sparc changing the number of arguments doesn't change 43 // for sparc changing the number of arguments doesn't change
44 // anything about the frame size so we'll always lie and claim that 44 // anything about the frame size so we'll always lie and claim that
45 // we are only passing 1 argument. 45 // we are only passing 1 argument.
46 set_num_rt_args(1); 46 set_num_rt_args(1);
47 47
98 // be a little paranoid and clear the result 98 // be a little paranoid and clear the result
99 Address vm_result_addr(G2_thread, JavaThread::vm_result_offset()); 99 Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
100 st_ptr(G0, vm_result_addr); 100 st_ptr(G0, vm_result_addr);
101 } 101 }
102 102
103 if (oop_result2->is_valid()) { 103 // get second result if there is one and reset the value in the thread
104 get_vm_result_2(oop_result2); 104 if (metadata_result->is_valid()) {
105 get_vm_result_2 (metadata_result);
105 } else { 106 } else {
106 // be a little paranoid and clear the result 107 // be a little paranoid and clear the result
107 Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset()); 108 Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
108 st_ptr(G0, vm_result_addr_2); 109 st_ptr(G0, vm_result_addr_2);
109 } 110 }
110 111
111 return call_offset; 112 return call_offset;
112 } 113 }
113 114
114 115
115 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1) { 116 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1) {
116 // O0 is reserved for the thread 117 // O0 is reserved for the thread
117 mov(arg1, O1); 118 mov(arg1, O1);
118 return call_RT(oop_result1, oop_result2, entry, 1); 119 return call_RT(oop_result1, metadata_result, entry, 1);
119 } 120 }
120 121
121 122
122 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2) { 123 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2) {
123 // O0 is reserved for the thread 124 // O0 is reserved for the thread
124 mov(arg1, O1); 125 mov(arg1, O1);
125 mov(arg2, O2); assert(arg2 != O1, "smashed argument"); 126 mov(arg2, O2); assert(arg2 != O1, "smashed argument");
126 return call_RT(oop_result1, oop_result2, entry, 2); 127 return call_RT(oop_result1, metadata_result, entry, 2);
127 } 128 }
128 129
129 130
130 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2, Register arg3) { 131 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3) {
131 // O0 is reserved for the thread 132 // O0 is reserved for the thread
132 mov(arg1, O1); 133 mov(arg1, O1);
133 mov(arg2, O2); assert(arg2 != O1, "smashed argument"); 134 mov(arg2, O2); assert(arg2 != O1, "smashed argument");
134 mov(arg3, O3); assert(arg3 != O1 && arg3 != O2, "smashed argument"); 135 mov(arg3, O3); assert(arg3 != O1 && arg3 != O2, "smashed argument");
135 return call_RT(oop_result1, oop_result2, entry, 3); 136 return call_RT(oop_result1, metadata_result, entry, 3);
136 } 137 }
137 138
138 139
139 // Implementation of Runtime1 140 // Implementation of Runtime1
140 141
396 // to stomp the real return address. 397 // to stomp the real return address.
397 __ save_frame(0); 398 __ save_frame(0);
398 399
399 if (id == fast_new_instance_init_check_id) { 400 if (id == fast_new_instance_init_check_id) {
400 // make sure the klass is initialized 401 // make sure the klass is initialized
401 __ ldub(G5_klass, in_bytes(instanceKlass::init_state_offset()), G3_t1); 402 __ ldub(G5_klass, in_bytes(InstanceKlass::init_state_offset()), G3_t1);
402 __ cmp_and_br_short(G3_t1, instanceKlass::fully_initialized, Assembler::notEqual, Assembler::pn, slow_path); 403 __ cmp_and_br_short(G3_t1, InstanceKlass::fully_initialized, Assembler::notEqual, Assembler::pn, slow_path);
403 } 404 }
404 #ifdef ASSERT 405 #ifdef ASSERT
405 // assert object can be fast path allocated 406 // assert object can be fast path allocated
406 { 407 {
407 Label ok, not_ok; 408 Label ok, not_ok;
791 break; 792 break;
792 793
793 case load_klass_patching_id: 794 case load_klass_patching_id:
794 { __ set_info("load_klass_patching", dont_gc_arguments); 795 { __ set_info("load_klass_patching", dont_gc_arguments);
795 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); 796 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching));
797 }
798 break;
799
800 case load_mirror_patching_id:
801 { __ set_info("load_mirror_patching", dont_gc_arguments);
802 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching));
796 } 803 }
797 break; 804 break;
798 805
799 case dtrace_object_alloc_id: 806 case dtrace_object_alloc_id:
800 { // O0: object 807 { // O0: object