[981dbbc] | 1 | |
---|
| 2 | # HG changeset patch |
---|
| 3 | # User Andrew John Hughes <gnu_andrew@member.fsf.org> |
---|
| 4 | # Date 1358298469 0 |
---|
| 5 | # Node ID 5fc3319dea01730bb3fdc1cd1b156f37e153553f |
---|
| 6 | # Parent fa200daee35457cb507ab8bf4b55cd3b3535e0b8 |
---|
| 7 | Fix application of 6924259 to Zero's HotSpot, which was broken by addition of 7158800 in 2.1.3. |
---|
| 8 | |
---|
| 9 | 2013-01-16 Andrew John Hughes <gnu.andrew@member.fsf.org> |
---|
| 10 | |
---|
| 11 | * patches/hotspot/zero/6924259-string_offset.patch: |
---|
| 12 | Fix patch to apply against HotSpot from 2.1.3. |
---|
| 13 | |
---|
| 14 | diff -r fa200daee354 -r 5fc3319dea01 ChangeLog |
---|
| 15 | --- a/ChangeLog Tue Jan 15 09:43:14 2013 +0000 |
---|
| 16 | +++ b/ChangeLog Wed Jan 16 01:07:49 2013 +0000 |
---|
| 17 | @@ -1,3 +1,8 @@ |
---|
| 18 | +2013-01-16 Andrew John Hughes <gnu.andrew@member.fsf.org> |
---|
| 19 | + |
---|
| 20 | + * patches/hotspot/zero/6924259-string_offset.patch: |
---|
| 21 | + Fix patch to apply against HotSpot from 2.1.3. |
---|
| 22 | + |
---|
| 23 | 2013-01-15 Andrew John Hughes <gnu.andrew@member.fsf.org> |
---|
| 24 | |
---|
| 25 | * NEWS: Mention PaX bug fix from Gentoo, |
---|
| 26 | diff -r fa200daee354 -r 5fc3319dea01 patches/hotspot/zero/6924259-string_offset.patch |
---|
| 27 | --- a/patches/hotspot/zero/6924259-string_offset.patch Tue Jan 15 09:43:14 2013 +0000 |
---|
| 28 | +++ b/patches/hotspot/zero/6924259-string_offset.patch Wed Jan 16 01:07:49 2013 +0000 |
---|
| 29 | @@ -1,15 +1,6 @@ |
---|
| 30 | -# HG changeset patch |
---|
| 31 | -# User kvn |
---|
| 32 | -# Date 1337013360 25200 |
---|
| 33 | -# Node ID 3facbb14e873f14af743e05139e6e48b5890ffcc |
---|
| 34 | -# Parent ea3152ff2a498749bf5d889b247902f5d02915be |
---|
| 35 | -6924259: Remove String.count/String.offset |
---|
| 36 | -Summary: Allow a version of String class that doesn't have count and offset fields. |
---|
| 37 | -Reviewed-by: never, coleenp |
---|
| 38 | - |
---|
| 39 | -diff --git a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp |
---|
| 40 | ---- openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp |
---|
| 41 | -+++ openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp |
---|
| 42 | +diff -Nru openjdk.orig/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp |
---|
| 43 | +--- openjdk.orig/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 44 | ++++ openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp 2013-01-16 00:42:59.059088003 +0000 |
---|
| 45 | @@ -1,5 +1,5 @@ |
---|
| 46 | /* |
---|
| 47 | - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. |
---|
| 48 | @@ -99,9 +90,9 @@ |
---|
| 49 | |
---|
| 50 | __ lduh(base0, limit, chr0); |
---|
| 51 | __ bind(Lloop); |
---|
| 52 | -diff --git a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp |
---|
| 53 | ---- openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp |
---|
| 54 | -+++ openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp |
---|
| 55 | +diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp |
---|
| 56 | +--- openjdk.orig/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2013-01-16 00:41:43.257866830 +0000 |
---|
| 57 | ++++ openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2013-01-16 00:42:59.059088003 +0000 |
---|
| 58 | @@ -1,5 +1,5 @@ |
---|
| 59 | /* |
---|
| 60 | - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. |
---|
| 61 | @@ -109,7 +100,7 @@ |
---|
| 62 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
---|
| 63 | * |
---|
| 64 | * This code is free software; you can redistribute it and/or modify it |
---|
| 65 | -@@ -505,19 +505,28 @@ |
---|
| 66 | +@@ -506,19 +506,28 @@ |
---|
| 67 | |
---|
| 68 | // Get addresses of first characters from both Strings |
---|
| 69 | __ load_heap_oop(rsi, Address(rax, java_lang_String::value_offset_in_bytes())); |
---|
| 70 | @@ -145,9 +136,9 @@ |
---|
| 71 | __ mov (rcx, rbx); |
---|
| 72 | __ subptr(rbx, rax); // subtract lengths |
---|
| 73 | __ push (rbx); // result |
---|
| 74 | -diff --git a/src/share/vm/classfile/javaClasses.cpp b/src/share/vm/classfile/javaClasses.cpp |
---|
| 75 | ---- openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp |
---|
| 76 | -+++ openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp |
---|
| 77 | +diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.cpp openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp |
---|
| 78 | +--- openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.cpp 2013-01-16 00:41:43.273867087 +0000 |
---|
| 79 | ++++ openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp 2013-01-16 00:42:59.071088195 +0000 |
---|
| 80 | @@ -1,5 +1,5 @@ |
---|
| 81 | /* |
---|
| 82 | - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
---|
| 83 | @@ -155,7 +146,7 @@ |
---|
| 84 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
---|
| 85 | * |
---|
| 86 | * This code is free software; you can redistribute it and/or modify it |
---|
| 87 | -@@ -143,7 +143,27 @@ |
---|
| 88 | +@@ -144,7 +144,27 @@ |
---|
| 89 | } |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | @@ -224,9 +215,9 @@ |
---|
| 93 | |
---|
| 94 | // java.lang.Class |
---|
| 95 | |
---|
| 96 | -diff --git a/src/share/vm/classfile/javaClasses.hpp b/src/share/vm/classfile/javaClasses.hpp |
---|
| 97 | ---- openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp |
---|
| 98 | -+++ openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp |
---|
| 99 | +diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.hpp openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp |
---|
| 100 | +--- openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.hpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 101 | ++++ openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp 2013-01-16 00:42:59.071088195 +0000 |
---|
| 102 | @@ -1,5 +1,5 @@ |
---|
| 103 | /* |
---|
| 104 | - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
---|
| 105 | @@ -349,10 +340,10 @@ |
---|
| 106 | } |
---|
| 107 | static int utf8_length(oop java_string); |
---|
| 108 | |
---|
| 109 | -diff --git a/src/share/vm/classfile/systemDictionary.cpp b/src/share/vm/classfile/systemDictionary.cpp |
---|
| 110 | ---- openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp |
---|
| 111 | -+++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp |
---|
| 112 | -@@ -1971,6 +1971,9 @@ |
---|
| 113 | +diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp |
---|
| 114 | +--- openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 115 | ++++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp 2013-01-16 00:42:59.075088258 +0000 |
---|
| 116 | +@@ -1953,6 +1953,9 @@ |
---|
| 117 | // first do Object, String, Class |
---|
| 118 | initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK); |
---|
| 119 | |
---|
| 120 | @@ -362,10 +353,10 @@ |
---|
| 121 | java_lang_Class::compute_offsets(); |
---|
| 122 | |
---|
| 123 | // Fixup mirrors for classes loaded before java.lang.Class. |
---|
| 124 | -diff --git a/src/share/vm/classfile/vmSymbols.hpp b/src/share/vm/classfile/vmSymbols.hpp |
---|
| 125 | ---- openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp |
---|
| 126 | -+++ openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp |
---|
| 127 | -@@ -339,6 +339,9 @@ |
---|
| 128 | +diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/vmSymbols.hpp openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp |
---|
| 129 | +--- openjdk.orig/hotspot/src/share/vm/classfile/vmSymbols.hpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 130 | ++++ openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp 2013-01-16 00:42:59.083088388 +0000 |
---|
| 131 | +@@ -337,6 +337,9 @@ |
---|
| 132 | template(park_event_name, "nativeParkEventPointer") \ |
---|
| 133 | template(cache_field_name, "cache") \ |
---|
| 134 | template(value_name, "value") \ |
---|
| 135 | @@ -375,9 +366,9 @@ |
---|
| 136 | template(frontCacheEnabled_name, "frontCacheEnabled") \ |
---|
| 137 | template(stringCacheEnabled_name, "stringCacheEnabled") \ |
---|
| 138 | template(numberOfLeadingZeros_name, "numberOfLeadingZeros") \ |
---|
| 139 | -diff --git a/src/share/vm/memory/dump.cpp b/src/share/vm/memory/dump.cpp |
---|
| 140 | ---- openjdk/hotspot/src/share/vm/memory/dump.cpp |
---|
| 141 | -+++ openjdk/hotspot/src/share/vm/memory/dump.cpp |
---|
| 142 | +diff -Nru openjdk.orig/hotspot/src/share/vm/memory/dump.cpp openjdk/hotspot/src/share/vm/memory/dump.cpp |
---|
| 143 | +--- openjdk.orig/hotspot/src/share/vm/memory/dump.cpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 144 | ++++ openjdk/hotspot/src/share/vm/memory/dump.cpp 2013-01-16 00:43:46.135846474 +0000 |
---|
| 145 | @@ -78,8 +78,8 @@ |
---|
| 146 | void do_oop(oop* p) { |
---|
| 147 | if (p != NULL) { |
---|
| 148 | @@ -386,12 +377,12 @@ |
---|
| 149 | - |
---|
| 150 | + if (obj->klass() == SystemDictionary::String_klass() && |
---|
| 151 | + java_lang_String::has_hash_field()) { |
---|
| 152 | - int hash = java_lang_String::hash_string(obj); |
---|
| 153 | + int hash = java_lang_String::to_hash(obj); |
---|
| 154 | obj->int_field_put(hash_offset, hash); |
---|
| 155 | } |
---|
| 156 | -diff --git a/src/share/vm/opto/graphKit.cpp b/src/share/vm/opto/graphKit.cpp |
---|
| 157 | ---- openjdk/hotspot/src/share/vm/opto/graphKit.cpp |
---|
| 158 | -+++ openjdk/hotspot/src/share/vm/opto/graphKit.cpp |
---|
| 159 | +diff -Nru openjdk.orig/hotspot/src/share/vm/opto/graphKit.cpp openjdk/hotspot/src/share/vm/opto/graphKit.cpp |
---|
| 160 | +--- openjdk.orig/hotspot/src/share/vm/opto/graphKit.cpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 161 | ++++ openjdk/hotspot/src/share/vm/opto/graphKit.cpp 2013-01-16 00:42:59.091088517 +0000 |
---|
| 162 | @@ -1,5 +1,5 @@ |
---|
| 163 | /* |
---|
| 164 | - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
---|
| 165 | @@ -399,7 +390,7 @@ |
---|
| 166 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
---|
| 167 | * |
---|
| 168 | * This code is free software; you can redistribute it and/or modify it |
---|
| 169 | -@@ -3748,3 +3748,81 @@ |
---|
| 170 | +@@ -3730,3 +3730,81 @@ |
---|
| 171 | final_sync(ideal); |
---|
| 172 | } |
---|
| 173 | #undef __ |
---|
| 174 | @@ -481,9 +472,9 @@ |
---|
| 175 | + store_to_memory(ctrl, basic_plus_adr(str, count_offset), |
---|
| 176 | + value, T_INT, count_field_idx); |
---|
| 177 | +} |
---|
| 178 | -diff --git a/src/share/vm/opto/graphKit.hpp b/src/share/vm/opto/graphKit.hpp |
---|
| 179 | ---- openjdk/hotspot/src/share/vm/opto/graphKit.hpp |
---|
| 180 | -+++ openjdk/hotspot/src/share/vm/opto/graphKit.hpp |
---|
| 181 | +diff -Nru openjdk.orig/hotspot/src/share/vm/opto/graphKit.hpp openjdk/hotspot/src/share/vm/opto/graphKit.hpp |
---|
| 182 | +--- openjdk.orig/hotspot/src/share/vm/opto/graphKit.hpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 183 | ++++ openjdk/hotspot/src/share/vm/opto/graphKit.hpp 2013-01-16 00:42:59.095088581 +0000 |
---|
| 184 | @@ -1,5 +1,5 @@ |
---|
| 185 | /* |
---|
| 186 | - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
---|
| 187 | @@ -506,9 +497,9 @@ |
---|
| 188 | // Handy for making control flow |
---|
| 189 | IfNode* create_and_map_if(Node* ctrl, Node* tst, float prob, float cnt) { |
---|
| 190 | IfNode* iff = new (C, 2) IfNode(ctrl, tst, prob, cnt);// New IfNode's |
---|
| 191 | -diff --git a/src/share/vm/opto/library_call.cpp b/src/share/vm/opto/library_call.cpp |
---|
| 192 | ---- openjdk/hotspot/src/share/vm/opto/library_call.cpp |
---|
| 193 | -+++ openjdk/hotspot/src/share/vm/opto/library_call.cpp |
---|
| 194 | +diff -Nru openjdk.orig/hotspot/src/share/vm/opto/library_call.cpp openjdk/hotspot/src/share/vm/opto/library_call.cpp |
---|
| 195 | +--- openjdk.orig/hotspot/src/share/vm/opto/library_call.cpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 196 | ++++ openjdk/hotspot/src/share/vm/opto/library_call.cpp 2013-01-16 00:42:59.095088581 +0000 |
---|
| 197 | @@ -147,7 +147,8 @@ |
---|
| 198 | return generate_method_call(method_id, true, false); |
---|
| 199 | } |
---|
| 200 | @@ -519,7 +510,7 @@ |
---|
| 201 | bool inline_string_compareTo(); |
---|
| 202 | bool inline_string_indexOf(); |
---|
| 203 | Node* string_indexOf(Node* string_object, ciTypeArray* target_array, jint offset, jint cache_i, jint md2_i); |
---|
| 204 | -@@ -844,48 +845,45 @@ |
---|
| 205 | +@@ -844,48 +845,76 @@ |
---|
| 206 | |
---|
| 207 | |
---|
| 208 | //------------------------------make_string_method_node------------------------ |
---|
| 209 | @@ -588,13 +579,18 @@ |
---|
| 210 | result = new (C, 5) StrEqualsNode(control(), memory(TypeAryPtr::CHARS), |
---|
| 211 | - str1_start, str2_start, cnt1); |
---|
| 212 | + str1_start, str2_start, str1_len); |
---|
| 213 | - break; |
---|
| 214 | - default: |
---|
| 215 | - ShouldNotReachHere(); |
---|
| 216 | -@@ -898,15 +896,42 @@ |
---|
| 217 | - return _gvn.transform(result); |
---|
| 218 | - } |
---|
| 219 | - |
---|
| 220 | ++ break; |
---|
| 221 | ++ default: |
---|
| 222 | ++ ShouldNotReachHere(); |
---|
| 223 | ++ return NULL; |
---|
| 224 | ++ } |
---|
| 225 | ++ |
---|
| 226 | ++ // All these intrinsics have checks. |
---|
| 227 | ++ C->set_has_split_ifs(true); // Has chance for split-if optimization |
---|
| 228 | ++ |
---|
| 229 | ++ return _gvn.transform(result); |
---|
| 230 | ++} |
---|
| 231 | ++ |
---|
| 232 | +// Helper method for String intrinsic functions. This version is called |
---|
| 233 | +// with str1 and str2 pointing to char[] nodes, with cnt1 and cnt2 pointing |
---|
| 234 | +// to Int nodes containing the lenghts of str1 and str2. |
---|
| 235 | @@ -614,20 +610,10 @@ |
---|
| 236 | + case Op_StrEquals: |
---|
| 237 | + result = new (C, 5) StrEqualsNode(control(), memory(TypeAryPtr::CHARS), |
---|
| 238 | + str1_start, str2_start, cnt1); |
---|
| 239 | -+ break; |
---|
| 240 | -+ default: |
---|
| 241 | -+ ShouldNotReachHere(); |
---|
| 242 | -+ return NULL; |
---|
| 243 | -+ } |
---|
| 244 | -+ |
---|
| 245 | -+ // All these intrinsics have checks. |
---|
| 246 | -+ C->set_has_split_ifs(true); // Has chance for split-if optimization |
---|
| 247 | -+ |
---|
| 248 | -+ return _gvn.transform(result); |
---|
| 249 | -+} |
---|
| 250 | -+ |
---|
| 251 | - //------------------------------inline_string_compareTo------------------------ |
---|
| 252 | - bool LibraryCallKit::inline_string_compareTo() { |
---|
| 253 | + break; |
---|
| 254 | + default: |
---|
| 255 | + ShouldNotReachHere(); |
---|
| 256 | +@@ -903,10 +932,6 @@ |
---|
| 257 | |
---|
| 258 | if (!Matcher::has_match_rule(Op_StrComp)) return false; |
---|
| 259 | |
---|
| 260 | @@ -690,9 +676,6 @@ |
---|
| 261 | - // Get counts for string and argument |
---|
| 262 | - Node* receiver_cnta = basic_plus_adr(receiver, receiver, count_offset); |
---|
| 263 | - receiver_cnt = make_load(no_ctrl, receiver_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); |
---|
| 264 | -- |
---|
| 265 | -- Node* argument_cnta = basic_plus_adr(argument, argument, count_offset); |
---|
| 266 | -- argument_cnt = make_load(no_ctrl, argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); |
---|
| 267 | + Node* no_ctrl = NULL; |
---|
| 268 | + |
---|
| 269 | + // Get start addr of receiver |
---|
| 270 | @@ -707,7 +690,9 @@ |
---|
| 271 | + Node* argument_val = load_String_value(no_ctrl, argument); |
---|
| 272 | + Node* argument_offset = load_String_offset(no_ctrl, argument); |
---|
| 273 | + Node* argument_start = array_element_address(argument_val, argument_offset, T_CHAR); |
---|
| 274 | -+ |
---|
| 275 | + |
---|
| 276 | +- Node* argument_cnta = basic_plus_adr(argument, argument, count_offset); |
---|
| 277 | +- argument_cnt = make_load(no_ctrl, argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); |
---|
| 278 | + // Get length of argument |
---|
| 279 | + Node* argument_cnt = load_String_length(no_ctrl, argument); |
---|
| 280 | |
---|
| 281 | @@ -718,16 +703,14 @@ |
---|
| 282 | region->init_req(4, if_ne); |
---|
| 283 | } |
---|
| 284 | - } |
---|
| 285 | -- |
---|
| 286 | + |
---|
| 287 | - // Check for count == 0 is done by mach node StrEquals. |
---|
| 288 | -- |
---|
| 289 | ++ // Check for count == 0 is done by assembler code for StrEquals. |
---|
| 290 | + |
---|
| 291 | - if (!stopped()) { |
---|
| 292 | - Node* equals = make_string_method_node(Op_StrEquals, receiver, receiver_cnt, argument, argument_cnt); |
---|
| 293 | - phi->init_req(1, equals); |
---|
| 294 | - region->init_req(1, control()); |
---|
| 295 | -+ |
---|
| 296 | -+ // Check for count == 0 is done by assembler code for StrEquals. |
---|
| 297 | -+ |
---|
| 298 | + if (!stopped()) { |
---|
| 299 | + Node* equals = make_string_method_node(Op_StrEquals, receiver_start, receiver_cnt, argument_start, argument_cnt); |
---|
| 300 | + phi->init_req(1, equals); |
---|
| 301 | @@ -778,9 +761,6 @@ |
---|
| 302 | - // Get counts for string and substr |
---|
| 303 | - Node* source_cnta = basic_plus_adr(receiver, receiver, count_offset); |
---|
| 304 | - Node* source_cnt = make_load(no_ctrl, source_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); |
---|
| 305 | -- |
---|
| 306 | -- Node* substr_cnta = basic_plus_adr(argument, argument, count_offset); |
---|
| 307 | -- Node* substr_cnt = make_load(no_ctrl, substr_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); |
---|
| 308 | + // Get start addr of source string |
---|
| 309 | + Node* source = load_String_value(no_ctrl, receiver); |
---|
| 310 | + Node* source_offset = load_String_offset(no_ctrl, receiver); |
---|
| 311 | @@ -793,7 +773,9 @@ |
---|
| 312 | + Node* substr = load_String_value(no_ctrl, argument); |
---|
| 313 | + Node* substr_offset = load_String_offset(no_ctrl, argument); |
---|
| 314 | + Node* substr_start = array_element_address(substr, substr_offset, T_CHAR); |
---|
| 315 | -+ |
---|
| 316 | + |
---|
| 317 | +- Node* substr_cnta = basic_plus_adr(argument, argument, count_offset); |
---|
| 318 | +- Node* substr_cnt = make_load(no_ctrl, substr_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); |
---|
| 319 | + // Get length of source string |
---|
| 320 | + Node* substr_cnt = load_String_length(no_ctrl, argument); |
---|
| 321 | |
---|
| 322 | @@ -831,9 +813,9 @@ |
---|
| 323 | // constant strings have no offset and count == length which |
---|
| 324 | // simplifies the resulting code somewhat so lets optimize for that. |
---|
| 325 | if (o != 0 || c != pat->length()) { |
---|
| 326 | -diff --git a/src/share/vm/opto/stringopts.cpp b/src/share/vm/opto/stringopts.cpp |
---|
| 327 | ---- openjdk/hotspot/src/share/vm/opto/stringopts.cpp |
---|
| 328 | -+++ openjdk/hotspot/src/share/vm/opto/stringopts.cpp |
---|
| 329 | +diff -Nru openjdk.orig/hotspot/src/share/vm/opto/stringopts.cpp openjdk/hotspot/src/share/vm/opto/stringopts.cpp |
---|
| 330 | +--- openjdk.orig/hotspot/src/share/vm/opto/stringopts.cpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 331 | ++++ openjdk/hotspot/src/share/vm/opto/stringopts.cpp 2013-01-16 00:42:59.099088646 +0000 |
---|
| 332 | @@ -1,5 +1,5 @@ |
---|
| 333 | /* |
---|
| 334 | - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
---|
| 335 | @@ -912,9 +894,9 @@ |
---|
| 336 | |
---|
| 337 | // hook up the outgoing control and result |
---|
| 338 | kit.replace_call(sc->end(), result); |
---|
| 339 | -diff --git a/src/share/vm/opto/stringopts.hpp b/src/share/vm/opto/stringopts.hpp |
---|
| 340 | ---- openjdk/hotspot/src/share/vm/opto/stringopts.hpp |
---|
| 341 | -+++ openjdk/hotspot/src/share/vm/opto/stringopts.hpp |
---|
| 342 | +diff -Nru openjdk.orig/hotspot/src/share/vm/opto/stringopts.hpp openjdk/hotspot/src/share/vm/opto/stringopts.hpp |
---|
| 343 | +--- openjdk.orig/hotspot/src/share/vm/opto/stringopts.hpp 2012-10-17 08:52:30.000000000 +0100 |
---|
| 344 | ++++ openjdk/hotspot/src/share/vm/opto/stringopts.hpp 2013-01-16 00:42:59.103088711 +0000 |
---|
| 345 | @@ -1,5 +1,5 @@ |
---|
| 346 | /* |
---|
| 347 | - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
---|
| 348 | |
---|
| 349 | |
---|