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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
23 */
24
25 #include "incls/_precompiled.incl"
26 #include "incls/_templateTable_sparc.cpp.incl"
27
28 #ifndef CC_INTERP
29 #define __ _masm->
30
31
32 //----------------------------------------------------------------------------------------------------
33 // Platform-dependent initialization
34
35 void TemplateTable::pd_initialize() {
36 // (none)
37 }
38
39
40 //----------------------------------------------------------------------------------------------------
41 // Condition conversion
42 Assembler::Condition ccNot(TemplateTable::Condition cc) {
43 switch (cc) {
44 case TemplateTable::equal : return Assembler::notEqual;
45 case TemplateTable::not_equal : return Assembler::equal;
46 case TemplateTable::less : return Assembler::greaterEqual;
47 case TemplateTable::less_equal : return Assembler::greater;
3075 __ add(G3_scratch, typeArrayOopDesc::header_size(T_BYTE) * wordSize, G3_scratch);
3076 __ ldub(G3_scratch, Roffset, G3_scratch);
3077 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3078 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3079 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3080
3081 //__ sll(Roffset, LogBytesPerWord, Roffset); // executed in delay slot
3082 __ add(Roffset, sizeof(constantPoolOopDesc), Roffset);
3083 __ ld_ptr(Rscratch, Roffset, RinstanceKlass);
3084
3085 // make sure klass is fully initialized:
3086 __ ld(RinstanceKlass, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc), G3_scratch);
3087 __ cmp(G3_scratch, instanceKlass::fully_initialized);
3088 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3089 __ delayed()->ld(RinstanceKlass, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc), Roffset);
3090
3091 // get instance_size in instanceKlass (already aligned)
3092 //__ ld(RinstanceKlass, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc), Roffset);
3093
3094 // make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class
3095 __ btst(Klass::_lh_instance_slow_path_bit, Roffset);
3096 __ br(Assembler::notZero, false, Assembler::pn, slow_case);
3097 __ delayed()->nop();
3098
3099 // allocate the instance
3100 // 1) Try to allocate in the TLAB
3101 // 2) if fail, and the TLAB is not full enough to discard, allocate in the shared Eden
3102 // 3) if the above fails (or is not applicable), go to a slow case
3103 // (creates a new TLAB, etc.)
3104
3105 const bool allow_shared_alloc =
3106 Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode;
3107
3108 if(UseTLAB) {
3109 Register RoldTopValue = RallocatedObject;
3110 Register RtopAddr = G3_scratch, RtlabWasteLimitValue = G3_scratch;
3111 Register RnewTopValue = G1_scratch;
3112 Register RendValue = Rscratch;
3113 Register RfreeValue = RnewTopValue;
3114
3115 // check if we can allocate in the TLAB
3116 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), RoldTopValue); // sets up RalocatedObject
3117 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_end_offset()), RendValue);
|
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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
23 */
24
25 #include "incls/_precompiled.incl"
26 #include "incls/_templateTable_sparc.cpp.incl"
27
28 #error "NYI: mixa.patch not yet implemented for this platform"
29
30 #ifndef CC_INTERP
31 #define __ _masm->
32
33
34 //----------------------------------------------------------------------------------------------------
35 // Platform-dependent initialization
36
37 void TemplateTable::pd_initialize() {
38 // (none)
39 }
40
41
42 //----------------------------------------------------------------------------------------------------
43 // Condition conversion
44 Assembler::Condition ccNot(TemplateTable::Condition cc) {
45 switch (cc) {
46 case TemplateTable::equal : return Assembler::notEqual;
47 case TemplateTable::not_equal : return Assembler::equal;
48 case TemplateTable::less : return Assembler::greaterEqual;
49 case TemplateTable::less_equal : return Assembler::greater;
3077 __ add(G3_scratch, typeArrayOopDesc::header_size(T_BYTE) * wordSize, G3_scratch);
3078 __ ldub(G3_scratch, Roffset, G3_scratch);
3079 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3080 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3081 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3082
3083 //__ sll(Roffset, LogBytesPerWord, Roffset); // executed in delay slot
3084 __ add(Roffset, sizeof(constantPoolOopDesc), Roffset);
3085 __ ld_ptr(Rscratch, Roffset, RinstanceKlass);
3086
3087 // make sure klass is fully initialized:
3088 __ ld(RinstanceKlass, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc), G3_scratch);
3089 __ cmp(G3_scratch, instanceKlass::fully_initialized);
3090 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3091 __ delayed()->ld(RinstanceKlass, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc), Roffset);
3092
3093 // get instance_size in instanceKlass (already aligned)
3094 //__ ld(RinstanceKlass, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc), Roffset);
3095
3096 // make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class
3097 __ btst(LayoutHelper::_slow_path_low_bit, Roffset);
3098 __ br(Assembler::notZero, false, Assembler::pn, slow_case);
3099 __ delayed()->and3(Roffset, ~LayoutHelper::_size_low_mask, Roffset);
3100
3101 // allocate the instance
3102 // 1) Try to allocate in the TLAB
3103 // 2) if fail, and the TLAB is not full enough to discard, allocate in the shared Eden
3104 // 3) if the above fails (or is not applicable), go to a slow case
3105 // (creates a new TLAB, etc.)
3106
3107 const bool allow_shared_alloc =
3108 Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode;
3109
3110 if(UseTLAB) {
3111 Register RoldTopValue = RallocatedObject;
3112 Register RtopAddr = G3_scratch, RtlabWasteLimitValue = G3_scratch;
3113 Register RnewTopValue = G1_scratch;
3114 Register RendValue = Rscratch;
3115 Register RfreeValue = RnewTopValue;
3116
3117 // check if we can allocate in the TLAB
3118 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), RoldTopValue); // sets up RalocatedObject
3119 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_end_offset()), RendValue);
|