Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/classLoader.cpp @ 1930:2d26b0046e0d
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 30 Nov 2010 14:53:30 +0100 |
parents | 55ac38887415 d5d065957597 |
children | 06f017f7daa7 |
comparison
equal
deleted
inserted
replaced
1484:6b7001391c97 | 1930:2d26b0046e0d |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright (c) 1997, 2010, 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. |
14 * | 14 * |
15 * You should have received a copy of the GNU General Public License version | 15 * You should have received a copy of the GNU General Public License version |
16 * 2 along with this work; if not, write to the Free Software Foundation, | 16 * 2 along with this work; if not, write to the Free Software Foundation, |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 * | 18 * |
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | 20 * or visit www.oracle.com if you need additional information or have any |
21 * have any questions. | 21 * questions. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #include "incls/_precompiled.incl" | 25 #include "incls/_precompiled.incl" |
26 #include "incls/_classLoader.cpp.incl" | 26 #include "incls/_classLoader.cpp.incl" |
830 return result(); | 830 return result(); |
831 } | 831 } |
832 | 832 |
833 | 833 |
834 instanceKlassHandle ClassLoader::load_classfile(symbolHandle h_name, TRAPS) { | 834 instanceKlassHandle ClassLoader::load_classfile(symbolHandle h_name, TRAPS) { |
835 VTuneClassLoadMarker clm; | |
836 ResourceMark rm(THREAD); | 835 ResourceMark rm(THREAD); |
837 EventMark m("loading class " INTPTR_FORMAT, (address)h_name()); | 836 EventMark m("loading class " INTPTR_FORMAT, (address)h_name()); |
838 ThreadProfilerMark tpm(ThreadProfilerMark::classLoaderRegion); | 837 ThreadProfilerMark tpm(ThreadProfilerMark::classLoaderRegion); |
839 | 838 |
840 stringStream st; | 839 stringStream st; |
1291 tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_counter, buffer); | 1290 tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_counter, buffer); |
1292 // Preload all classes to get around uncommon traps | 1291 // Preload all classes to get around uncommon traps |
1293 // Iterate over all methods in class | 1292 // Iterate over all methods in class |
1294 for (int n = 0; n < k->methods()->length(); n++) { | 1293 for (int n = 0; n < k->methods()->length(); n++) { |
1295 methodHandle m (THREAD, methodOop(k->methods()->obj_at(n))); | 1294 methodHandle m (THREAD, methodOop(k->methods()->obj_at(n))); |
1296 if (CompilationPolicy::canBeCompiled(m)) { | 1295 if (CompilationPolicy::can_be_compiled(m)) { |
1297 | 1296 |
1298 if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) { | 1297 if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) { |
1299 // Give sweeper a chance to keep up with CTW | 1298 // Give sweeper a chance to keep up with CTW |
1300 VM_ForceSafepoint op; | 1299 VM_ForceSafepoint op; |
1301 VMThread::execute(&op); | 1300 VMThread::execute(&op); |
1302 _codecache_sweep_counter = 0; | 1301 _codecache_sweep_counter = 0; |
1303 } | 1302 } |
1304 // Force compilation | 1303 // Force compilation |
1305 CompileBroker::compile_method(m, InvocationEntryBci, | 1304 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_initial_compile, |
1306 methodHandle(), 0, "CTW", THREAD); | 1305 methodHandle(), 0, "CTW", THREAD); |
1307 if (HAS_PENDING_EXCEPTION) { | 1306 if (HAS_PENDING_EXCEPTION) { |
1308 CLEAR_PENDING_EXCEPTION; | 1307 CLEAR_PENDING_EXCEPTION; |
1309 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); | 1308 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); |
1310 } | 1309 } |
1314 if (nm != NULL) { | 1313 if (nm != NULL) { |
1315 // Throw out the code so that the code cache doesn't fill up | 1314 // Throw out the code so that the code cache doesn't fill up |
1316 nm->make_not_entrant(); | 1315 nm->make_not_entrant(); |
1317 m->clear_code(); | 1316 m->clear_code(); |
1318 } | 1317 } |
1319 CompileBroker::compile_method(m, InvocationEntryBci, | 1318 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization, |
1320 methodHandle(), 0, "CTW", THREAD); | 1319 methodHandle(), 0, "CTW", THREAD); |
1321 if (HAS_PENDING_EXCEPTION) { | 1320 if (HAS_PENDING_EXCEPTION) { |
1322 CLEAR_PENDING_EXCEPTION; | 1321 CLEAR_PENDING_EXCEPTION; |
1323 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); | 1322 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); |
1324 } | 1323 } |