src/share/vm/opto/stringopts.hpp

Mon, 31 Oct 2011 03:06:42 -0700

author
twisti
date
Mon, 31 Oct 2011 03:06:42 -0700
changeset 3249
e3b0dcc327b9
parent 2314
f95d63e2154a
child 3760
8f972594effc
permissions
-rw-r--r--

7104561: UseRDPCForConstantTableBase doesn't work after shorten branches changes
Reviewed-by: never, kvn

never@1515 1 /*
stefank@2314 2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
never@1515 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
never@1515 4 *
never@1515 5 * This code is free software; you can redistribute it and/or modify it
never@1515 6 * under the terms of the GNU General Public License version 2 only, as
never@1515 7 * published by the Free Software Foundation.
never@1515 8 *
never@1515 9 * This code is distributed in the hope that it will be useful, but WITHOUT
never@1515 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
never@1515 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
never@1515 12 * version 2 for more details (a copy is included in the LICENSE file that
never@1515 13 * accompanied this code).
never@1515 14 *
never@1515 15 * You should have received a copy of the GNU General Public License version
never@1515 16 * 2 along with this work; if not, write to the Free Software Foundation,
never@1515 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
never@1515 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
never@1515 22 *
never@1515 23 */
never@1515 24
stefank@2314 25 #ifndef SHARE_VM_OPTO_STRINGOPTS_HPP
stefank@2314 26 #define SHARE_VM_OPTO_STRINGOPTS_HPP
stefank@2314 27
stefank@2314 28 #include "opto/node.hpp"
stefank@2314 29 #include "opto/phaseX.hpp"
stefank@2314 30
never@1515 31 class StringConcat;
never@1515 32
never@1515 33 class PhaseStringOpts : public Phase {
never@1515 34 friend class StringConcat;
never@1515 35
never@1515 36 private:
never@1515 37 PhaseGVN* _gvn;
never@1515 38
never@1515 39 // List of dead nodes to clean up aggressively at the end
never@1515 40 Unique_Node_List dead_worklist;
never@1515 41
never@1515 42 // Memory slices needed for code gen
never@1515 43 int char_adr_idx;
never@1515 44 int value_field_idx;
never@1515 45 int count_field_idx;
never@1515 46 int offset_field_idx;
never@1515 47
never@1515 48 // Integer.sizeTable - used for int to String conversion
never@1515 49 ciField* size_table_field;
never@1515 50
never@1515 51 // A set for use by various stages
never@1515 52 VectorSet _visited;
never@1515 53
never@1515 54 // Collect a list of all SB.toString calls
never@1515 55 Node_List collect_toString_calls();
never@1515 56
never@1515 57 // Examine the use of the SB alloc to see if it can be replace with
never@1515 58 // a single string construction.
never@1515 59 StringConcat* build_candidate(CallStaticJavaNode* call);
never@1515 60
never@1515 61 // Replace all the SB calls in concat with an optimization String allocation
never@1515 62 void replace_string_concat(StringConcat* concat);
never@1515 63
never@1515 64 // Load the value of a static field, performing any constant folding.
never@1515 65 Node* fetch_static_field(GraphKit& kit, ciField* field);
never@1515 66
never@1515 67 // Compute the number of characters required to represent the int value
never@1515 68 Node* int_stringSize(GraphKit& kit, Node* value);
never@1515 69
never@1515 70 // Copy the characters representing value into char_array starting at start
never@1515 71 void int_getChars(GraphKit& kit, Node* value, Node* char_array, Node* start, Node* end);
never@1515 72
never@1515 73 // Copy of the contents of the String str into char_array starting at index start.
never@1515 74 Node* copy_string(GraphKit& kit, Node* str, Node* char_array, Node* start);
never@1515 75
never@1515 76 // Clean up any leftover nodes
never@1515 77 void record_dead_node(Node* node);
never@1515 78 void remove_dead_nodes();
never@1515 79
never@1515 80 PhaseGVN* gvn() { return _gvn; }
never@1515 81
never@1515 82 enum {
never@1515 83 // max length of constant string copy unrolling in copy_string
never@1515 84 unroll_string_copy_length = 6
never@1515 85 };
never@1515 86
never@1515 87 public:
never@1515 88 PhaseStringOpts(PhaseGVN* gvn, Unique_Node_List* worklist);
never@1515 89 };
stefank@2314 90
stefank@2314 91 #endif // SHARE_VM_OPTO_STRINGOPTS_HPP

mercurial