1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2011, 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. |
4081 // store klass last. concurrent gcs assumes klass length is valid if |
4081 // store klass last. concurrent gcs assumes klass length is valid if |
4082 // klass field is not null. |
4082 // klass field is not null. |
4083 store_klass(t2, top); |
4083 store_klass(t2, top); |
4084 verify_oop(top); |
4084 verify_oop(top); |
4085 |
4085 |
|
4086 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1); |
|
4087 sub(top, t1, t1); // size of tlab's allocated portion |
|
4088 incr_allocated_bytes(t1, 0, t2); |
|
4089 |
4086 // refill the tlab with an eden allocation |
4090 // refill the tlab with an eden allocation |
4087 bind(do_refill); |
4091 bind(do_refill); |
4088 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); |
4092 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); |
4089 sll_ptr(t1, LogHeapWordSize, t1); |
4093 sll_ptr(t1, LogHeapWordSize, t1); |
4090 // add object_size ?? |
4094 // allocate new tlab, address returned in top |
4091 eden_allocate(top, t1, 0, t2, t3, slow_case); |
4095 eden_allocate(top, t1, 0, t2, t3, slow_case); |
4092 |
4096 |
4093 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_start_offset())); |
4097 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_start_offset())); |
4094 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_top_offset())); |
4098 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_top_offset())); |
4095 #ifdef ASSERT |
4099 #ifdef ASSERT |
4111 sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top); |
4115 sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top); |
4112 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset())); |
4116 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset())); |
4113 verify_tlab(); |
4117 verify_tlab(); |
4114 br(Assembler::always, false, Assembler::pt, retry); |
4118 br(Assembler::always, false, Assembler::pt, retry); |
4115 delayed()->nop(); |
4119 delayed()->nop(); |
|
4120 } |
|
4121 |
|
4122 void MacroAssembler::incr_allocated_bytes(Register var_size_in_bytes, |
|
4123 int con_size_in_bytes, |
|
4124 Register t1) { |
|
4125 // Bump total bytes allocated by this thread |
|
4126 assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch |
|
4127 assert_different_registers(var_size_in_bytes, t1); |
|
4128 // v8 support has gone the way of the dodo |
|
4129 ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1); |
|
4130 if (var_size_in_bytes->is_valid()) { |
|
4131 add(t1, var_size_in_bytes, t1); |
|
4132 } else { |
|
4133 add(t1, con_size_in_bytes, t1); |
|
4134 } |
|
4135 stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset())); |
4116 } |
4136 } |
4117 |
4137 |
4118 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { |
4138 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { |
4119 switch (cond) { |
4139 switch (cond) { |
4120 // Note some conditions are synonyms for others |
4140 // Note some conditions are synonyms for others |