Thu, 05 Jan 2012 17:25:58 -0800
7119294: Two command line options cause JVM to crash
Summary: Setup thread register in MacroAssembler::incr_allocated_bytes() on x64
Reviewed-by: kvn
src/cpu/x86/vm/assembler_x86.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/x86/vm/assembler_x86.cpp Fri Dec 30 11:43:06 2011 -0800 1.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp Thu Jan 05 17:25:58 2012 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2012, 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 @@ -7993,6 +7993,16 @@ 1.11 Register var_size_in_bytes, 1.12 int con_size_in_bytes, 1.13 Register t1) { 1.14 + if (!thread->is_valid()) { 1.15 +#ifdef _LP64 1.16 + thread = r15_thread; 1.17 +#else 1.18 + assert(t1->is_valid(), "need temp reg"); 1.19 + thread = t1; 1.20 + get_thread(thread); 1.21 +#endif 1.22 + } 1.23 + 1.24 #ifdef _LP64 1.25 if (var_size_in_bytes->is_valid()) { 1.26 addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); 1.27 @@ -8000,12 +8010,6 @@ 1.28 addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); 1.29 } 1.30 #else 1.31 - if (!thread->is_valid()) { 1.32 - assert(t1->is_valid(), "need temp reg"); 1.33 - thread = t1; 1.34 - get_thread(thread); 1.35 - } 1.36 - 1.37 if (var_size_in_bytes->is_valid()) { 1.38 addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); 1.39 } else {