source: npl/java/openjdk/patches/icedtea_zero_buildfix.patch @ 76ea60c

Last change on this file since 76ea60c was 981dbbc, checked in by Edwin Eefting <edwin@datux.nl>, 7 years ago

build openjdk, not used yet

  • Property mode set to 100644
File size: 16.1 KB
  • ChangeLog

    # HG changeset patch
    # User Andrew John Hughes <gnu_andrew@member.fsf.org>
    # Date 1358298469 0
    # Node ID 5fc3319dea01730bb3fdc1cd1b156f37e153553f
    # Parent  fa200daee35457cb507ab8bf4b55cd3b3535e0b8
    Fix application of 6924259 to Zero's HotSpot, which was broken by addition of 7158800 in 2.1.3.
    
    2013-01-16  Andrew John Hughes  <gnu.andrew@member.fsf.org>
    
    	* patches/hotspot/zero/6924259-string_offset.patch:
    	Fix patch to apply against HotSpot from 2.1.3.
    
    diff -r fa200daee354 -r 5fc3319dea01 ChangeLog
    a b  
     12013-01-16  Andrew John Hughes  <gnu.andrew@member.fsf.org>
     2
     3        * patches/hotspot/zero/6924259-string_offset.patch:
     4        Fix patch to apply against HotSpot from 2.1.3.
     5
    162013-01-15  Andrew John Hughes  <gnu.andrew@member.fsf.org>
    27
    38        * NEWS: Mention PaX bug fix from Gentoo,
  • patches/hotspot/zero/6924259-string_offset.patch

    diff -r fa200daee354 -r 5fc3319dea01 patches/hotspot/zero/6924259-string_offset.patch
    a b  
    1 # HG changeset patch
    2 # User kvn
    3 # Date 1337013360 25200
    4 # Node ID 3facbb14e873f14af743e05139e6e48b5890ffcc
    5 # Parent  ea3152ff2a498749bf5d889b247902f5d02915be
    6 6924259: Remove String.count/String.offset
    7 Summary: Allow a version of String class that doesn't have count and offset fields.
    8 Reviewed-by: never, coleenp
    9 
    10 diff --git a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
    11 --- openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
    12 +++ openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
     1diff -Nru openjdk.orig/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
     2--- openjdk.orig/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp     2012-10-17 08:52:30.000000000 +0100
     3+++ openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp  2013-01-16 00:42:59.059088003 +0000
    134@@ -1,5 +1,5 @@
    145 /*
    156- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
     
    9990 
    10091     __ lduh(base0, limit, chr0);
    10192     __ bind(Lloop);
    102 diff --git a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
    103 --- openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
    104 +++ openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
     93diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
     94--- openjdk.orig/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2013-01-16 00:41:43.257866830 +0000
     95+++ openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp      2013-01-16 00:42:59.059088003 +0000
    10596@@ -1,5 +1,5 @@
    10697 /*
    10798- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
     
    109100  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    110101  *
    111102  * This code is free software; you can redistribute it and/or modify it
    112 @@ -505,19 +505,28 @@
     103@@ -506,19 +506,28 @@
    113104 
    114105   // Get addresses of first characters from both Strings
    115106   __ load_heap_oop(rsi, Address(rax, java_lang_String::value_offset_in_bytes()));
     
    145136   __ mov   (rcx, rbx);
    146137   __ subptr(rbx, rax); // subtract lengths
    147138   __ push  (rbx);      // result
    148 diff --git a/src/share/vm/classfile/javaClasses.cpp b/src/share/vm/classfile/javaClasses.cpp
    149 --- openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp
    150 +++ openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp
     139diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.cpp openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp
     140--- openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.cpp 2013-01-16 00:41:43.273867087 +0000
     141+++ openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp      2013-01-16 00:42:59.071088195 +0000
    151142@@ -1,5 +1,5 @@
    152143 /*
    153144- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     
    155146  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    156147  *
    157148  * This code is free software; you can redistribute it and/or modify it
    158 @@ -143,7 +143,27 @@
     149@@ -144,7 +144,27 @@
    159150 }
    160151 
    161152 
     
    224215 
    225216   // java.lang.Class
    226217 
    227 diff --git a/src/share/vm/classfile/javaClasses.hpp b/src/share/vm/classfile/javaClasses.hpp
    228 --- openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp
    229 +++ openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp
     218diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.hpp openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp
     219--- openjdk.orig/hotspot/src/share/vm/classfile/javaClasses.hpp 2012-10-17 08:52:30.000000000 +0100
     220+++ openjdk/hotspot/src/share/vm/classfile/javaClasses.hpp      2013-01-16 00:42:59.071088195 +0000
    230221@@ -1,5 +1,5 @@
    231222 /*
    232223- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     
    349340   }
    350341   static int utf8_length(oop java_string);
    351342 
    352 diff --git a/src/share/vm/classfile/systemDictionary.cpp b/src/share/vm/classfile/systemDictionary.cpp
    353 --- openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp
    354 +++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp
    355 @@ -1971,6 +1971,9 @@
     343diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp
     344--- openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp    2012-10-17 08:52:30.000000000 +0100
     345+++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp 2013-01-16 00:42:59.075088258 +0000
     346@@ -1953,6 +1953,9 @@
    356347   // first do Object, String, Class
    357348   initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
    358349 
     
    362353   java_lang_Class::compute_offsets();
    363354 
    364355   // Fixup mirrors for classes loaded before java.lang.Class.
    365 diff --git a/src/share/vm/classfile/vmSymbols.hpp b/src/share/vm/classfile/vmSymbols.hpp
    366 --- openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp
    367 +++ openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp
    368 @@ -339,6 +339,9 @@
     356diff -Nru openjdk.orig/hotspot/src/share/vm/classfile/vmSymbols.hpp openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp
     357--- openjdk.orig/hotspot/src/share/vm/classfile/vmSymbols.hpp   2012-10-17 08:52:30.000000000 +0100
     358+++ openjdk/hotspot/src/share/vm/classfile/vmSymbols.hpp        2013-01-16 00:42:59.083088388 +0000
     359@@ -337,6 +337,9 @@
    369360   template(park_event_name,                           "nativeParkEventPointer")                   \
    370361   template(cache_field_name,                          "cache")                                    \
    371362   template(value_name,                                "value")                                    \
     
    375366   template(frontCacheEnabled_name,                    "frontCacheEnabled")                        \
    376367   template(stringCacheEnabled_name,                   "stringCacheEnabled")                       \
    377368   template(numberOfLeadingZeros_name,                 "numberOfLeadingZeros")                     \
    378 diff --git a/src/share/vm/memory/dump.cpp b/src/share/vm/memory/dump.cpp
    379 --- openjdk/hotspot/src/share/vm/memory/dump.cpp
    380 +++ openjdk/hotspot/src/share/vm/memory/dump.cpp
     369diff -Nru openjdk.orig/hotspot/src/share/vm/memory/dump.cpp openjdk/hotspot/src/share/vm/memory/dump.cpp
     370--- openjdk.orig/hotspot/src/share/vm/memory/dump.cpp   2012-10-17 08:52:30.000000000 +0100
     371+++ openjdk/hotspot/src/share/vm/memory/dump.cpp        2013-01-16 00:43:46.135846474 +0000
    381372@@ -78,8 +78,8 @@
    382373   void do_oop(oop* p) {
    383374     if (p != NULL) {
     
    386377-
    387378+      if (obj->klass() == SystemDictionary::String_klass() &&
    388379+          java_lang_String::has_hash_field()) {
    389          int hash = java_lang_String::hash_string(obj);
     380         int hash = java_lang_String::to_hash(obj);
    390381         obj->int_field_put(hash_offset, hash);
    391382       }
    392 diff --git a/src/share/vm/opto/graphKit.cpp b/src/share/vm/opto/graphKit.cpp
    393 --- openjdk/hotspot/src/share/vm/opto/graphKit.cpp
    394 +++ openjdk/hotspot/src/share/vm/opto/graphKit.cpp
     383diff -Nru openjdk.orig/hotspot/src/share/vm/opto/graphKit.cpp openjdk/hotspot/src/share/vm/opto/graphKit.cpp
     384--- openjdk.orig/hotspot/src/share/vm/opto/graphKit.cpp 2012-10-17 08:52:30.000000000 +0100
     385+++ openjdk/hotspot/src/share/vm/opto/graphKit.cpp      2013-01-16 00:42:59.091088517 +0000
    395386@@ -1,5 +1,5 @@
    396387 /*
    397388- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
     
    399390  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    400391  *
    401392  * This code is free software; you can redistribute it and/or modify it
    402 @@ -3748,3 +3748,81 @@
     393@@ -3730,3 +3730,81 @@
    403394   final_sync(ideal);
    404395 }
    405396 #undef __
     
    481472+  store_to_memory(ctrl, basic_plus_adr(str, count_offset),
    482473+                  value, T_INT, count_field_idx);
    483474+}
    484 diff --git a/src/share/vm/opto/graphKit.hpp b/src/share/vm/opto/graphKit.hpp
    485 --- openjdk/hotspot/src/share/vm/opto/graphKit.hpp
    486 +++ openjdk/hotspot/src/share/vm/opto/graphKit.hpp
     475diff -Nru openjdk.orig/hotspot/src/share/vm/opto/graphKit.hpp openjdk/hotspot/src/share/vm/opto/graphKit.hpp
     476--- openjdk.orig/hotspot/src/share/vm/opto/graphKit.hpp 2012-10-17 08:52:30.000000000 +0100
     477+++ openjdk/hotspot/src/share/vm/opto/graphKit.hpp      2013-01-16 00:42:59.095088581 +0000
    487478@@ -1,5 +1,5 @@
    488479 /*
    489480- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
     
    506497   // Handy for making control flow
    507498   IfNode* create_and_map_if(Node* ctrl, Node* tst, float prob, float cnt) {
    508499     IfNode* iff = new (C, 2) IfNode(ctrl, tst, prob, cnt);// New IfNode's
    509 diff --git a/src/share/vm/opto/library_call.cpp b/src/share/vm/opto/library_call.cpp
    510 --- openjdk/hotspot/src/share/vm/opto/library_call.cpp
    511 +++ openjdk/hotspot/src/share/vm/opto/library_call.cpp
     500diff -Nru openjdk.orig/hotspot/src/share/vm/opto/library_call.cpp openjdk/hotspot/src/share/vm/opto/library_call.cpp
     501--- openjdk.orig/hotspot/src/share/vm/opto/library_call.cpp     2012-10-17 08:52:30.000000000 +0100
     502+++ openjdk/hotspot/src/share/vm/opto/library_call.cpp  2013-01-16 00:42:59.095088581 +0000
    512503@@ -147,7 +147,8 @@
    513504     return generate_method_call(method_id, true, false);
    514505   }
     
    519510   bool inline_string_compareTo();
    520511   bool inline_string_indexOf();
    521512   Node* string_indexOf(Node* string_object, ciTypeArray* target_array, jint offset, jint cache_i, jint md2_i);
    522 @@ -844,48 +845,45 @@
     513@@ -844,48 +845,76 @@
    523514 
    524515 
    525516 //------------------------------make_string_method_node------------------------
     
    588579     result = new (C, 5) StrEqualsNode(control(), memory(TypeAryPtr::CHARS),
    589580-                                      str1_start, str2_start, cnt1);
    590581+                               str1_start, str2_start, str1_len);
    591      break;
    592    default:
    593      ShouldNotReachHere();
    594 @@ -898,15 +896,42 @@
    595    return _gvn.transform(result);
    596  }
    597  
     582+    break;
     583+  default:
     584+    ShouldNotReachHere();
     585+    return NULL;
     586+  }
     587+
     588+  // All these intrinsics have checks.
     589+  C->set_has_split_ifs(true); // Has chance for split-if optimization
     590+
     591+  return _gvn.transform(result);
     592+}
     593+
    598594+// Helper method for String intrinsic functions. This version is called
    599595+// with str1 and str2 pointing to char[] nodes, with cnt1 and cnt2 pointing
    600596+// to Int nodes containing the lenghts of str1 and str2.
     
    614610+  case Op_StrEquals:
    615611+    result = new (C, 5) StrEqualsNode(control(), memory(TypeAryPtr::CHARS),
    616612+                                 str1_start, str2_start, cnt1);
    617 +    break;
    618 +  default:
    619 +    ShouldNotReachHere();
    620 +    return NULL;
    621 +  }
    622 +
    623 +  // All these intrinsics have checks.
    624 +  C->set_has_split_ifs(true); // Has chance for split-if optimization
    625 +
    626 +  return _gvn.transform(result);
    627 +}
    628 +
    629  //------------------------------inline_string_compareTo------------------------
    630  bool LibraryCallKit::inline_string_compareTo() {
     613     break;
     614   default:
     615     ShouldNotReachHere();
     616@@ -903,10 +932,6 @@
    631617 
    632618   if (!Matcher::has_match_rule(Op_StrComp)) return false;
    633619 
     
    690676-    // Get counts for string and argument
    691677-    Node* receiver_cnta = basic_plus_adr(receiver, receiver, count_offset);
    692678-    receiver_cnt  = make_load(no_ctrl, receiver_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
    693 -
    694 -    Node* argument_cnta = basic_plus_adr(argument, argument, count_offset);
    695 -    argument_cnt  = make_load(no_ctrl, argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
    696679+    Node* no_ctrl = NULL;
    697680+
    698681+    // Get start addr of receiver
     
    707690+    Node* argument_val   = load_String_value(no_ctrl, argument);
    708691+    Node* argument_offset = load_String_offset(no_ctrl, argument);
    709692+    Node* argument_start = array_element_address(argument_val, argument_offset, T_CHAR);
    710 +
     693 
     694-    Node* argument_cnta = basic_plus_adr(argument, argument, count_offset);
     695-    argument_cnt  = make_load(no_ctrl, argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
    711696+    // Get length of argument
    712697+    Node* argument_cnt  = load_String_length(no_ctrl, argument);
    713698 
     
    718703       region->init_req(4, if_ne);
    719704     }
    720705-  }
    721 -
     706 
    722707-  // Check for count == 0 is done by mach node StrEquals.
    723 -
     708+    // Check for count == 0 is done by assembler code for StrEquals.
     709 
    724710-  if (!stopped()) {
    725711-    Node* equals = make_string_method_node(Op_StrEquals, receiver, receiver_cnt, argument, argument_cnt);
    726712-    phi->init_req(1, equals);
    727713-    region->init_req(1, control());
    728 +
    729 +    // Check for count == 0 is done by assembler code for StrEquals.
    730 +
    731714+    if (!stopped()) {
    732715+      Node* equals = make_string_method_node(Op_StrEquals, receiver_start, receiver_cnt, argument_start, argument_cnt);
    733716+      phi->init_req(1, equals);
     
    778761-    // Get counts for string and substr
    779762-    Node* source_cnta = basic_plus_adr(receiver, receiver, count_offset);
    780763-    Node* source_cnt  = make_load(no_ctrl, source_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
    781 -
    782 -    Node* substr_cnta = basic_plus_adr(argument, argument, count_offset);
    783 -    Node* substr_cnt  = make_load(no_ctrl, substr_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
    784764+    // Get start addr of source string
    785765+    Node* source = load_String_value(no_ctrl, receiver);
    786766+    Node* source_offset = load_String_offset(no_ctrl, receiver);
     
    793773+    Node* substr = load_String_value(no_ctrl, argument);
    794774+    Node* substr_offset = load_String_offset(no_ctrl, argument);
    795775+    Node* substr_start = array_element_address(substr, substr_offset, T_CHAR);
    796 +
     776 
     777-    Node* substr_cnta = basic_plus_adr(argument, argument, count_offset);
     778-    Node* substr_cnt  = make_load(no_ctrl, substr_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
    797779+    // Get length of source string
    798780+    Node* substr_cnt  = load_String_length(no_ctrl, argument);
    799781 
     
    831813     // constant strings have no offset and count == length which
    832814     // simplifies the resulting code somewhat so lets optimize for that.
    833815     if (o != 0 || c != pat->length()) {
    834 diff --git a/src/share/vm/opto/stringopts.cpp b/src/share/vm/opto/stringopts.cpp
    835 --- openjdk/hotspot/src/share/vm/opto/stringopts.cpp
    836 +++ openjdk/hotspot/src/share/vm/opto/stringopts.cpp
     816diff -Nru openjdk.orig/hotspot/src/share/vm/opto/stringopts.cpp openjdk/hotspot/src/share/vm/opto/stringopts.cpp
     817--- openjdk.orig/hotspot/src/share/vm/opto/stringopts.cpp       2012-10-17 08:52:30.000000000 +0100
     818+++ openjdk/hotspot/src/share/vm/opto/stringopts.cpp    2013-01-16 00:42:59.099088646 +0000
    837819@@ -1,5 +1,5 @@
    838820 /*
    839821- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
     
    912894 
    913895   // hook up the outgoing control and result
    914896   kit.replace_call(sc->end(), result);
    915 diff --git a/src/share/vm/opto/stringopts.hpp b/src/share/vm/opto/stringopts.hpp
    916 --- openjdk/hotspot/src/share/vm/opto/stringopts.hpp
    917 +++ openjdk/hotspot/src/share/vm/opto/stringopts.hpp
     897diff -Nru openjdk.orig/hotspot/src/share/vm/opto/stringopts.hpp openjdk/hotspot/src/share/vm/opto/stringopts.hpp
     898--- openjdk.orig/hotspot/src/share/vm/opto/stringopts.hpp       2012-10-17 08:52:30.000000000 +0100
     899+++ openjdk/hotspot/src/share/vm/opto/stringopts.hpp    2013-01-16 00:42:59.103088711 +0000
    918900@@ -1,5 +1,5 @@
    919901 /*
    920902- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
Note: See TracBrowser for help on using the repository browser.