Skip to content

Commit 3c46737

Browse files
author
duke
committed
Automatic merge of jdk:master into master
2 parents a851ced + 3b9c5a3 commit 3c46737

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,30 +1995,13 @@ void BytecodeInterpreter::run(interpreterState istate) {
19951995
if (ik->is_initialized() && ik->can_be_fastpath_allocated() ) {
19961996
size_t obj_size = ik->size_helper();
19971997
oop result = NULL;
1998-
// If the TLAB isn't pre-zeroed then we'll have to do it
1999-
bool need_zero = !ZeroTLAB;
20001998
if (UseTLAB) {
20011999
result = (oop) THREAD->tlab().allocate(obj_size);
20022000
}
2003-
// Disable non-TLAB-based fast-path, because profiling requires that all
2004-
// allocations go through InterpreterRuntime::_new() if THREAD->tlab().allocate
2005-
// returns NULL.
2006-
if (result == NULL) {
2007-
need_zero = true;
2008-
// Try allocate in shared eden
2009-
retry:
2010-
HeapWord* compare_to = *Universe::heap()->top_addr();
2011-
HeapWord* new_top = compare_to + obj_size;
2012-
if (new_top <= *Universe::heap()->end_addr()) {
2013-
if (Atomic::cmpxchg(Universe::heap()->top_addr(), compare_to, new_top) != compare_to) {
2014-
goto retry;
2015-
}
2016-
result = (oop) compare_to;
2017-
}
2018-
}
20192001
if (result != NULL) {
2020-
// Initialize object (if nonzero size and need) and then the header
2021-
if (need_zero ) {
2002+
// Initialize object (if nonzero size and need) and then the header.
2003+
// If the TLAB isn't pre-zeroed then we'll have to do it.
2004+
if (!ZeroTLAB) {
20222005
HeapWord* to_zero = cast_from_oop<HeapWord*>(result) + sizeof(oopDesc) / oopSize;
20232006
obj_size -= sizeof(oopDesc) / oopSize;
20242007
if (obj_size > 0 ) {

0 commit comments

Comments
 (0)