Mercurial > hg > graal-jvmci-8
comparison src/share/vm/adlc/adlparse.cpp @ 4114:6729bbc1fcd6
7003454: order constants in constant table by number of references in code
Reviewed-by: kvn, never, bdelsart
author | twisti |
---|---|
date | Wed, 16 Nov 2011 01:39:50 -0800 |
parents | c7b60b601eb4 |
children | f03a3c8bd5e5 |
comparison
equal
deleted
inserted
replaced
4113:8c57262447d3 | 4114:6729bbc1fcd6 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2011, 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. |
3113 | 3113 |
3114 // Start code line. | 3114 // Start code line. |
3115 encoding->add_code(" _constant = C->constant_table().add"); | 3115 encoding->add_code(" _constant = C->constant_table().add"); |
3116 | 3116 |
3117 // Parse everything in ( ) expression. | 3117 // Parse everything in ( ) expression. |
3118 encoding->add_code("("); | 3118 encoding->add_code("(this, "); |
3119 next_char(); // Skip '(' | 3119 next_char(); // Skip '(' |
3120 int parens_depth = 1; | 3120 int parens_depth = 1; |
3121 | 3121 |
3122 // Collect the parts of the constant expression. | 3122 // Collect the parts of the constant expression. |
3123 // (1) strings that are passed through to output | 3123 // (1) strings that are passed through to output |
3128 encoding->add_code("("); | 3128 encoding->add_code("("); |
3129 next_char(); | 3129 next_char(); |
3130 } | 3130 } |
3131 else if (_curchar == ')') { | 3131 else if (_curchar == ')') { |
3132 parens_depth--; | 3132 parens_depth--; |
3133 encoding->add_code(")"); | 3133 if (parens_depth > 0) |
3134 encoding->add_code(")"); | |
3134 next_char(); | 3135 next_char(); |
3135 } | 3136 } |
3136 else { | 3137 else { |
3137 // (1) | 3138 // (1) |
3138 // Check if there is a string to pass through to output | 3139 // Check if there is a string to pass through to output |
3155 } | 3156 } |
3156 } | 3157 } |
3157 } | 3158 } |
3158 | 3159 |
3159 // Finish code line. | 3160 // Finish code line. |
3160 encoding->add_code(";"); | 3161 encoding->add_code(");"); |
3161 | 3162 |
3162 if (_AD._adlocation_debug) { | 3163 if (_AD._adlocation_debug) { |
3163 encoding->add_code(end_line_marker()); | 3164 encoding->add_code(end_line_marker()); |
3164 } | 3165 } |
3165 | 3166 |