1.1 --- a/src/cpu/sparc/vm/assembler_sparc.cpp Fri Jan 07 03:41:07 2011 -0800 1.2 +++ b/src/cpu/sparc/vm/assembler_sparc.cpp Fri Jan 07 15:54:32 2011 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -4102,11 +4102,15 @@ 1.11 store_klass(t2, top); 1.12 verify_oop(top); 1.13 1.14 + ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1); 1.15 + sub(top, t1, t1); // size of tlab's allocated portion 1.16 + incr_allocated_bytes(t1, 0, t2); 1.17 + 1.18 // refill the tlab with an eden allocation 1.19 bind(do_refill); 1.20 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); 1.21 sll_ptr(t1, LogHeapWordSize, t1); 1.22 - // add object_size ?? 1.23 + // allocate new tlab, address returned in top 1.24 eden_allocate(top, t1, 0, t2, t3, slow_case); 1.25 1.26 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_start_offset())); 1.27 @@ -4134,6 +4138,22 @@ 1.28 delayed()->nop(); 1.29 } 1.30 1.31 +void MacroAssembler::incr_allocated_bytes(Register var_size_in_bytes, 1.32 + int con_size_in_bytes, 1.33 + Register t1) { 1.34 + // Bump total bytes allocated by this thread 1.35 + assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch 1.36 + assert_different_registers(var_size_in_bytes, t1); 1.37 + // v8 support has gone the way of the dodo 1.38 + ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1); 1.39 + if (var_size_in_bytes->is_valid()) { 1.40 + add(t1, var_size_in_bytes, t1); 1.41 + } else { 1.42 + add(t1, con_size_in_bytes, t1); 1.43 + } 1.44 + stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset())); 1.45 +} 1.46 + 1.47 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { 1.48 switch (cond) { 1.49 // Note some conditions are synonyms for others