hotspot/src/cpu/x86/vm/assembler_x86.cpp
changeset 11438 d98e7bed0cd6
parent 11436 63492afc6a27
child 11791 3be8cae67887
equal deleted inserted replaced
11437:2fa33fde54b9 11438:d98e7bed0cd6
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2012, 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.
  7991 
  7991 
  7992 void MacroAssembler::incr_allocated_bytes(Register thread,
  7992 void MacroAssembler::incr_allocated_bytes(Register thread,
  7993                                           Register var_size_in_bytes,
  7993                                           Register var_size_in_bytes,
  7994                                           int con_size_in_bytes,
  7994                                           int con_size_in_bytes,
  7995                                           Register t1) {
  7995                                           Register t1) {
       
  7996   if (!thread->is_valid()) {
       
  7997 #ifdef _LP64
       
  7998     thread = r15_thread;
       
  7999 #else
       
  8000     assert(t1->is_valid(), "need temp reg");
       
  8001     thread = t1;
       
  8002     get_thread(thread);
       
  8003 #endif
       
  8004   }
       
  8005 
  7996 #ifdef _LP64
  8006 #ifdef _LP64
  7997   if (var_size_in_bytes->is_valid()) {
  8007   if (var_size_in_bytes->is_valid()) {
  7998     addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes);
  8008     addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes);
  7999   } else {
  8009   } else {
  8000     addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes);
  8010     addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes);
  8001   }
  8011   }
  8002 #else
  8012 #else
  8003   if (!thread->is_valid()) {
       
  8004     assert(t1->is_valid(), "need temp reg");
       
  8005     thread = t1;
       
  8006     get_thread(thread);
       
  8007   }
       
  8008 
       
  8009   if (var_size_in_bytes->is_valid()) {
  8013   if (var_size_in_bytes->is_valid()) {
  8010     addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes);
  8014     addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes);
  8011   } else {
  8015   } else {
  8012     addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes);
  8016     addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes);
  8013   }
  8017   }