aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/x86/vm/templateTable_x86_32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/x86/vm/templateTable_x86_32.cpp')
-rw-r--r--src/cpu/x86/vm/templateTable_x86_32.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/cpu/x86/vm/templateTable_x86_32.cpp b/src/cpu/x86/vm/templateTable_x86_32.cpp
index 898069bc9..345b5f62c 100644
--- a/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -3203,10 +3203,12 @@ void TemplateTable::_new() {
const bool allow_shared_alloc =
Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode;
- if (UseTLAB) {
- const Register thread = rcx;
-
+ const Register thread = rcx;
+ if (UseTLAB || allow_shared_alloc) {
__ get_thread(thread);
+ }
+
+ if (UseTLAB) {
__ movptr(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset())));
__ lea(rbx, Address(rax, rdx, Address::times_1));
__ cmpptr(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset())));
@@ -3247,6 +3249,8 @@ void TemplateTable::_new() {
// if someone beat us on the allocation, try again, otherwise continue
__ jcc(Assembler::notEqual, retry);
+
+ __ incr_allocated_bytes(thread, rdx, 0);
}
if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) {
@@ -3256,12 +3260,12 @@ void TemplateTable::_new() {
__ decrement(rdx, sizeof(oopDesc));
__ jcc(Assembler::zero, initialize_header);
- // Initialize topmost object field, divide rdx by 8, check if odd and
- // test if zero.
+ // Initialize topmost object field, divide rdx by 8, check if odd and
+ // test if zero.
__ xorl(rcx, rcx); // use zero reg to clear memory (shorter code)
__ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd
- // rdx must have been multiple of 8
+ // rdx must have been multiple of 8
#ifdef ASSERT
// make sure rdx was multiple of 8
Label L;