Mercurial > hg > graal-compiler
comparison src/share/vm/interpreter/interpreterRuntime.cpp @ 10105:aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
Summary: Allocate the method's profiling related metadata until they are needed.
Reviewed-by: coleenp, roland
author | jiangli |
---|---|
date | Tue, 09 Apr 2013 17:17:41 -0400 |
parents | 0c8717a92b2d |
children | 8df6ddda8090 |
comparison
equal
deleted
inserted
replaced
9055:dcdeb150988c | 10105:aeaca88565e6 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2013, 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. |
452 // enough stack space available to reprotect the stack. | 452 // enough stack space available to reprotect the stack. |
453 #ifndef CC_INTERP | 453 #ifndef CC_INTERP |
454 continuation = Interpreter::remove_activation_entry(); | 454 continuation = Interpreter::remove_activation_entry(); |
455 #endif | 455 #endif |
456 // Count this for compilation purposes | 456 // Count this for compilation purposes |
457 h_method->interpreter_throwout_increment(); | 457 h_method->interpreter_throwout_increment(THREAD); |
458 } else { | 458 } else { |
459 // handler in this method => change bci/bcp to handler bci/bcp and continue there | 459 // handler in this method => change bci/bcp to handler bci/bcp and continue there |
460 handler_pc = h_method->code_base() + handler_bci; | 460 handler_pc = h_method->code_base() + handler_bci; |
461 #ifndef CC_INTERP | 461 #ifndef CC_INTERP |
462 set_bcp_and_mdp(handler_pc, thread); | 462 set_bcp_and_mdp(handler_pc, thread); |
904 // need to take the lock before making any ProfileData structures. | 904 // need to take the lock before making any ProfileData structures. |
905 ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(fr.interpreter_frame_mdp())); | 905 ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(fr.interpreter_frame_mdp())); |
906 RetData* rdata = data->as_RetData(); | 906 RetData* rdata = data->as_RetData(); |
907 address new_mdp = rdata->fixup_ret(return_bci, h_mdo); | 907 address new_mdp = rdata->fixup_ret(return_bci, h_mdo); |
908 fr.interpreter_frame_set_mdp(new_mdp); | 908 fr.interpreter_frame_set_mdp(new_mdp); |
909 IRT_END | |
910 | |
911 IRT_ENTRY(MethodCounters*, InterpreterRuntime::build_method_counters(JavaThread* thread, Method* m)) | |
912 MethodCounters* mcs = Method::build_method_counters(m, thread); | |
913 if (HAS_PENDING_EXCEPTION) { | |
914 assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here"); | |
915 CLEAR_PENDING_EXCEPTION; | |
916 } | |
917 return mcs; | |
909 IRT_END | 918 IRT_END |
910 | 919 |
911 | 920 |
912 IRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* thread)) | 921 IRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* thread)) |
913 // We used to need an explict preserve_arguments here for invoke bytecodes. However, | 922 // We used to need an explict preserve_arguments here for invoke bytecodes. However, |