Mercurial > hg > graal-compiler
annotate src/share/vm/c1/c1_Compiler.cpp @ 1930:2d26b0046e0d
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 30 Nov 2010 14:53:30 +0100 |
parents | 72cfb36c6bb2 b812ff5abc73 |
children | 06f017f7daa7 |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
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 | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
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, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 #include "incls/_precompiled.incl" | |
26 #include "incls/_c1_Compiler.cpp.incl" | |
27 | |
28 volatile int Compiler::_runtimes = uninitialized; | |
29 | |
30 Compiler::Compiler() { | |
31 } | |
32 | |
33 | |
34 Compiler::~Compiler() { | |
35 Unimplemented(); | |
36 } | |
37 | |
38 | |
1584 | 39 void Compiler::initialize_all() { |
40 BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob(); | |
41 Arena* arena = new Arena(); | |
42 Runtime1::initialize(buffer_blob); | |
43 FrameMap::initialize(); | |
44 // initialize data structures | |
45 ValueType::initialize(arena); | |
46 // Instruction::initialize(); | |
47 // BlockBegin::initialize(); | |
48 GraphBuilder::initialize(); | |
49 // note: to use more than one instance of LinearScan at a time this function call has to | |
50 // be moved somewhere outside of this constructor: | |
51 Interval::initialize(arena); | |
52 } | |
53 | |
54 | |
0 | 55 void Compiler::initialize() { |
56 if (_runtimes != initialized) { | |
1584 | 57 initialize_runtimes( initialize_all, &_runtimes); |
0 | 58 } |
59 mark_initialized(); | |
60 } | |
61 | |
62 | |
1584 | 63 BufferBlob* Compiler::build_buffer_blob() { |
64 // setup CodeBuffer. Preallocate a BufferBlob of size | |
65 // NMethodSizeLimit plus some extra space for constants. | |
66 int code_buffer_size = Compilation::desired_max_code_buffer_size() + | |
67 Compilation::desired_max_constant_size(); | |
68 BufferBlob* blob = BufferBlob::create("Compiler1 temporary CodeBuffer", | |
69 code_buffer_size); | |
70 guarantee(blob != NULL, "must create initial code buffer"); | |
71 return blob; | |
72 } | |
73 | |
74 | |
0 | 75 void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) { |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
0
diff
changeset
|
76 assert(!UseC1X, "c1 called in UseC1X mode!"); |
1584 | 77 // Allocate buffer blob once at startup since allocation for each |
78 // compilation seems to be too expensive (at least on Intel win32). | |
79 BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob(); | |
80 if (buffer_blob == NULL) { | |
81 buffer_blob = build_buffer_blob(); | |
82 CompilerThread::current()->set_buffer_blob(buffer_blob); | |
83 } | |
0 | 84 |
85 if (!is_initialized()) { | |
86 initialize(); | |
87 } | |
88 // invoke compilation | |
89 { | |
90 // We are nested here because we need for the destructor | |
91 // of Compilation to occur before we release the any | |
92 // competing compiler thread | |
93 ResourceMark rm; | |
1584 | 94 Compilation c(this, env, method, entry_bci, buffer_blob); |
0 | 95 } |
96 } | |
97 | |
98 | |
99 void Compiler::print_timers() { | |
100 Compilation::print_timers(); | |
101 } |