Mercurial > hg > truffle
annotate src/share/vm/opto/stringopts.hpp @ 1721:413ad0331a0c
6977924: Changes for 6975078 produce build error with certain gcc versions
Summary: The changes introduced for 6975078 assign badHeapOopVal to the _allocation field in the ResourceObj class. In 32 bit linux builds with certain versions of gcc this assignment will be flagged as an error while compiling allocation.cpp. In 32 bit builds the constant value badHeapOopVal (which is cast to an intptr_t) is negative. The _allocation field is typed as an unsigned intptr_t and gcc catches this as an error.
Reviewed-by: jcoomes, ysr, phh
author | johnc |
---|---|
date | Wed, 18 Aug 2010 10:59:06 -0700 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
rev | line source |
---|---|
1080 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1080
diff
changeset
|
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
1080 | 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:
1080
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1080
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:
1080
diff
changeset
|
21 * questions. |
1080 | 22 * |
23 */ | |
24 | |
25 class StringConcat; | |
26 | |
27 class PhaseStringOpts : public Phase { | |
28 friend class StringConcat; | |
29 | |
30 private: | |
31 PhaseGVN* _gvn; | |
32 | |
33 // List of dead nodes to clean up aggressively at the end | |
34 Unique_Node_List dead_worklist; | |
35 | |
36 // Memory slices needed for code gen | |
37 int char_adr_idx; | |
38 int value_field_idx; | |
39 int count_field_idx; | |
40 int offset_field_idx; | |
41 | |
42 // Integer.sizeTable - used for int to String conversion | |
43 ciField* size_table_field; | |
44 | |
45 // A set for use by various stages | |
46 VectorSet _visited; | |
47 | |
48 // Collect a list of all SB.toString calls | |
49 Node_List collect_toString_calls(); | |
50 | |
51 // Examine the use of the SB alloc to see if it can be replace with | |
52 // a single string construction. | |
53 StringConcat* build_candidate(CallStaticJavaNode* call); | |
54 | |
55 // Replace all the SB calls in concat with an optimization String allocation | |
56 void replace_string_concat(StringConcat* concat); | |
57 | |
58 // Load the value of a static field, performing any constant folding. | |
59 Node* fetch_static_field(GraphKit& kit, ciField* field); | |
60 | |
61 // Compute the number of characters required to represent the int value | |
62 Node* int_stringSize(GraphKit& kit, Node* value); | |
63 | |
64 // Copy the characters representing value into char_array starting at start | |
65 void int_getChars(GraphKit& kit, Node* value, Node* char_array, Node* start, Node* end); | |
66 | |
67 // Copy of the contents of the String str into char_array starting at index start. | |
68 Node* copy_string(GraphKit& kit, Node* str, Node* char_array, Node* start); | |
69 | |
70 // Clean up any leftover nodes | |
71 void record_dead_node(Node* node); | |
72 void remove_dead_nodes(); | |
73 | |
74 PhaseGVN* gvn() { return _gvn; } | |
75 | |
76 enum { | |
77 // max length of constant string copy unrolling in copy_string | |
78 unroll_string_copy_length = 6 | |
79 }; | |
80 | |
81 public: | |
82 PhaseStringOpts(PhaseGVN* gvn, Unique_Node_List* worklist); | |
83 }; |