From owner-svn-ports-head@FreeBSD.ORG Tue Dec 16 00:26:00 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C4B8946; Tue, 16 Dec 2014 00:26:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06CD827A; Tue, 16 Dec 2014 00:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBG0Pxg1006544; Tue, 16 Dec 2014 00:25:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBG0PxNc006541; Tue, 16 Dec 2014 00:25:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201412160025.sBG0PxNc006541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 16 Dec 2014 00:25:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r374780 - in head/java: openjdk6/files openjdk7/files openjdk8/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 00:26:00 -0000 Author: jkim Date: Tue Dec 16 00:25:58 2014 New Revision: 374780 URL: https://svnweb.freebsd.org/changeset/ports/374780 QAT: https://qat.redports.org/buildarchive/r374780/ Log: Add an upstream patch to remove adlc's unused class FileBuffRegion. https://bugs.openjdk.java.net/browse/JDK-8041620 Note this is an attempt to fix build with upcoming Clang 3.5. Obtained from: jdk9 Added: head/java/openjdk6/files/patch-remove-FileBuffRegion (contents, props changed) head/java/openjdk7/files/patch-remove-FileBuffRegion (contents, props changed) head/java/openjdk8/files/patch-remove-FileBuffRegion (contents, props changed) Added: head/java/openjdk6/files/patch-remove-FileBuffRegion ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk6/files/patch-remove-FileBuffRegion Tue Dec 16 00:25:58 2014 (r374780) @@ -0,0 +1,270 @@ + +# HG changeset patch +# User lfoltan +# Date 1399384615 14400 +# Node ID 21130eb5768d79c7f3a4ef0b9d976d1942de09ad +# Parent e7a6a3354c8409f739c52ffeb224bb59c1351b64 +8041620: Solaris Studio 12.4 C++ 5.13 change in behavior for placing friend declarations within surrounding scope. +Summary: Remove adlc's unused class FileBuffRegion. +Reviewed-by: coleenp, dholmes, kvn + +diff -r e7a6a3354c84 -r 21130eb5768d src/share/vm/adlc/filebuff.cpp +--- hotspot/src/share/vm/adlc/filebuff.cpp Tue May 06 08:59:57 2014 -0400 ++++ hotspot/src/share/vm/adlc/filebuff.cpp Tue May 06 09:56:55 2014 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -89,200 +89,6 @@ + return retval; + } + +-//------------------------------FileBuffRegion--------------------------------- +-// Create a new region in a FileBuff. +-FileBuffRegion::FileBuffRegion( FileBuff* bufr, int soln, int ln, +- int off, int len) +-: _bfr(bufr), _sol(soln), _line(ln), _offset(off), _length(len) { +- _next = NULL; // No chained regions +-} +- +-//------------------------------~FileBuffRegion-------------------------------- +-// Delete the entire linked list of buffer regions. +-FileBuffRegion::~FileBuffRegion() { +- if( _next ) delete _next; +-} +- +-//------------------------------copy------------------------------------------- +-// Deep copy a FileBuffRegion +-FileBuffRegion *FileBuffRegion::copy() { +- if( !this ) return NULL; // The empty buffer region +- FileBuffRegion *br = new FileBuffRegion(_bfr,_sol,_line,_offset,_length); +- if( _next ) br->_next = _next->copy(); +- return br; +-} +- +-//------------------------------merge------------------------------------------ +-// Merge another buffer region into this buffer region. Make overlapping areas +-// become a single region. Remove (delete) the input FileBuffRegion. +-// Since the buffer regions are sorted by file offset, this is a varient of a +-// "sorted-merge" running in linear time. +-FileBuffRegion *FileBuffRegion::merge( FileBuffRegion *br ) { +- if( !br ) return this; // Merging nothing +- if( !this ) return br; // Merging into nothing +- +- assert( _bfr == br->_bfr, "" ); // Check for pointer-equivalent buffers +- +- if( _offset < br->_offset ) { // "this" starts before "br" +- if( _offset+_length < br->_offset ) { // "this" ends before "br" +- if( _next ) _next->merge( br ); // Merge with remainder of list +- else _next = br; // No more in this list; just append. +- } else { // Regions overlap. +- int l = br->_offset + br->_length - _offset; +- if( l > _length ) _length = l; // Pick larger region +- FileBuffRegion *nr = br->_next; // Get rest of region +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been subsumed). +- if( nr ) merge( nr ); // Merge with rest of region +- } // End of if regions overlap or not. +- } else { // "this" starts after "br" +- if( br->_offset+br->_length < _offset ) { // "br" ends before "this" +- FileBuffRegion *nr = new FileBuffRegion(_bfr,_sol,_line,_offset,_length); +- nr->_next = _next; // Structure copy "this" guy to "nr" +- *this = *br; // Structure copy "br" over "this". +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been copied) +- merge( nr ); // Finish merging +- } else { // Regions overlap. +- int l = _offset + _length - br->_offset; +- if( l > _length ) _length = l; // Pick larger region +- _offset = br->_offset; // Start with earlier region +- _sol = br->_sol; // Also use earlier line start +- _line = br->_line; // Also use earlier line +- FileBuffRegion *nr = br->_next; // Get rest of region +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been subsumed). +- if( nr ) merge( nr ); // Merge with rest of region +- } // End of if regions overlap or not. +- } +- return this; +-} +- +-//------------------------------expandtab-------------------------------------- +-static int expandtab( ostream &os, int off, char c, char fill1, char fill2 ) { +- if( c == '\t' ) { // Tab? +- do os << fill1; // Expand the tab; Output space +- while( (++off) & 7 ); // Expand to tab stop +- } else { // Normal character +- os << fill2; // Display normal character +- off++; // Increment "cursor" offset +- } +- return off; +-} +- +-//------------------------------printline-------------------------------------- +-// Print and highlite a region of a line. Return the amount of highliting left +-// to do (i.e. highlite length minus length of line). +-static int printline( ostream& os, const char *fname, int line, +- const char *_sol, int skip, int len ) { +- +- // Display the entire tab-expanded line +- os << fname << ":" << line << ": "; +- const char *t = strchr(_sol,'\n')+1; // End of line +- int off = 0; // Cursor offset for tab expansion +- const char *s = _sol; // Nice string pointer +- while( t-s ) { // Display whole line +- char c = *s++; // Get next character to display +- off = expandtab(os,off,c,' ',c); +- } +- +- // Display the tab-expanded skippings before underlining. +- os << fname << ":" << line << ": "; +- off = 0; // Cursor offset for tab expansion +- s = _sol; // Restart string pointer +- +- // Start underlining. +- if( skip != -1 ) { // The no-start-indicating flag +- const char *u = _sol+skip; // Amount to skip +- while( u-s ) // Display skipped part +- off = expandtab(os,off,*s++,' ',' '); +- os << '^'; // Start region +- off++; // Moved cursor +- len--; // 1 less char to do +- if( *s++ == '\t' ) // Starting character is a tab? +- off = expandtab(os,off,'\t','-','^'); +- } +- +- // Long region doesn't end on this line +- int llen = (int)(t-s); // Length of line, minus what's already done +- if( len > llen ) { // Doing entire rest of line? +- while( t-s ) // Display rest of line +- off = expandtab(os,off,*s++,'-','-'); +- os << '\n'; // EOL +- return len-llen; // Return what's not yet done. +- } +- +- // Region does end on this line. This code fails subtly if the region ends +- // in a tab character. +- int i; +- for( i=1; iprint(os); // Print region +- brp = brp->_next; // Chain to next +- } +- return os; // Return final stream +-} +- +-//------------------------------print------------------------------------------ +-// Print the FileBuffRegion to a stream. FileBuffRegions are printed with the +-// filename and line number to the left, and complete text lines to the right. +-// Selected portions (portions of a line actually in the FileBuffRegion are +-// underlined. Ellipses are used for long multi-line regions. +-//void FileBuffRegion::print( std::ostream& os ) { +-void FileBuffRegion::print( ostream& os ) { +- if( !this ) return; // Nothing to print +- char *s = _bfr->get_line(); +- int skip = (int)(_offset - _sol); // Amount to skip to start of data +- int len = printline( os, _bfr->_fp->_name, _line, s, skip, _length ); +- +- if( !len ) return; // All done; exit +- +- // Here we require at least 2 lines +- int off1 = _length - len + skip; // Length of line 1 +- int off2 = off1 + _sol; // Offset to start of line 2 +- char *s2 = _bfr->get_line(); // Start of line 2 +- char *s3 = strchr( s2, '\n' )+1; // Start of line 3 (unread) +- if( len <= (s3-s2) ) { // It all fits on the next line +- printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Print&underline +- return; +- } +- +- // Here we require at least 3 lines +- int off3 = off2 + (int)(s3-s2); // Offset to start of line 3 +- s3 = _bfr->get_line(); // Start of line 3 (read) +- const char *s4 = strchr( s3, '\n' )+1;// Start of line 4 (unread) +- if( len < (s4-s3) ) { // It all fits on the next 2 lines +- s2 = _bfr->get_line(); +- len = printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Line 2 +- s3 = _bfr->get_line(); +- printline( os, _bfr->_fp->_name, _line+2, s3, -1, len ); // Line 3 +- return; +- } +- +- // Here we require at least 4 lines. +- // Print only the 1st and last line, with ellipses in middle. +- os << "...\n"; // The ellipses +- int cline = _line+1; // Skipped 2 lines +- do { // Do until find last line +- len -= (int)(s3-s2); // Remove length of line +- cline++; // Next line +- s2 = _bfr->get_line(); // Get next line from end of this line +- s3 = strchr( s2, '\n' ) + 1;// Get end of next line +- } while( len > (s3-s2) ); // Repeat until last line +- printline( os, _bfr->_fp->_name, cline, s2, -1, len ); // Print & underline +-} +- + //------------------------------file_error------------------------------------- + void FileBuff::file_error(int flag, int linenum, const char *fmt, ...) + { +diff -r e7a6a3354c84 -r 21130eb5768d src/share/vm/adlc/filebuff.hpp +--- hotspot/src/share/vm/adlc/filebuff.hpp Tue May 06 08:59:57 2014 -0400 ++++ hotspot/src/share/vm/adlc/filebuff.hpp Tue May 06 09:56:55 2014 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -46,7 +46,6 @@ + // This class defines a nicely behaved buffer of text. Entire file of text + // is read into buffer at creation, with sentinels at start and end. + class FileBuff { +- friend class FileBuffRegion; + private: + long _bufferSize; // Size of text holding buffer. + long _offset; // Expected filepointer offset. +@@ -82,29 +81,4 @@ + // when the pointer is valid (i.e. just obtained from getline()). + long getoff(const char* s) { return _bufoff + (long)(s - _buf); } + }; +- +-//------------------------------FileBuffRegion--------------------------------- +-// A buffer region is really a region of some file, specified as a linked list +-// of offsets and lengths. These regions can be merged; overlapping regions +-// will coalesce. +-class FileBuffRegion { +- public: // Workaround dev-studio friend/private bug +- FileBuffRegion *_next; // Linked list of regions sorted by offset. +- private: +- FileBuff *_bfr; // The Buffer of the file +- int _offset, _length; // The file area +- int _sol; // Start of line where the file area starts +- int _line; // First line of region +- +- public: +- FileBuffRegion(FileBuff*, int sol, int line, int offset, int len); +- ~FileBuffRegion(); +- +- FileBuffRegion *copy(); // Deep copy +- FileBuffRegion *merge(FileBuffRegion*); // Merge 2 regions; delete input +- +- void print(ostream&); +- friend ostream& operator<< (ostream&, FileBuffRegion&); +-}; +- + #endif // SHARE_VM_ADLC_FILEBUFF_HPP + Added: head/java/openjdk7/files/patch-remove-FileBuffRegion ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk7/files/patch-remove-FileBuffRegion Tue Dec 16 00:25:58 2014 (r374780) @@ -0,0 +1,270 @@ + +# HG changeset patch +# User lfoltan +# Date 1399384615 14400 +# Node ID 21130eb5768d79c7f3a4ef0b9d976d1942de09ad +# Parent e7a6a3354c8409f739c52ffeb224bb59c1351b64 +8041620: Solaris Studio 12.4 C++ 5.13 change in behavior for placing friend declarations within surrounding scope. +Summary: Remove adlc's unused class FileBuffRegion. +Reviewed-by: coleenp, dholmes, kvn + +diff -r e7a6a3354c84 -r 21130eb5768d src/share/vm/adlc/filebuff.cpp +--- hotspot/src/share/vm/adlc/filebuff.cpp Tue May 06 08:59:57 2014 -0400 ++++ hotspot/src/share/vm/adlc/filebuff.cpp Tue May 06 09:56:55 2014 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -89,200 +89,6 @@ + return retval; + } + +-//------------------------------FileBuffRegion--------------------------------- +-// Create a new region in a FileBuff. +-FileBuffRegion::FileBuffRegion( FileBuff* bufr, int soln, int ln, +- int off, int len) +-: _bfr(bufr), _sol(soln), _line(ln), _offset(off), _length(len) { +- _next = NULL; // No chained regions +-} +- +-//------------------------------~FileBuffRegion-------------------------------- +-// Delete the entire linked list of buffer regions. +-FileBuffRegion::~FileBuffRegion() { +- if( _next ) delete _next; +-} +- +-//------------------------------copy------------------------------------------- +-// Deep copy a FileBuffRegion +-FileBuffRegion *FileBuffRegion::copy() { +- if( !this ) return NULL; // The empty buffer region +- FileBuffRegion *br = new FileBuffRegion(_bfr,_sol,_line,_offset,_length); +- if( _next ) br->_next = _next->copy(); +- return br; +-} +- +-//------------------------------merge------------------------------------------ +-// Merge another buffer region into this buffer region. Make overlapping areas +-// become a single region. Remove (delete) the input FileBuffRegion. +-// Since the buffer regions are sorted by file offset, this is a varient of a +-// "sorted-merge" running in linear time. +-FileBuffRegion *FileBuffRegion::merge( FileBuffRegion *br ) { +- if( !br ) return this; // Merging nothing +- if( !this ) return br; // Merging into nothing +- +- assert( _bfr == br->_bfr, "" ); // Check for pointer-equivalent buffers +- +- if( _offset < br->_offset ) { // "this" starts before "br" +- if( _offset+_length < br->_offset ) { // "this" ends before "br" +- if( _next ) _next->merge( br ); // Merge with remainder of list +- else _next = br; // No more in this list; just append. +- } else { // Regions overlap. +- int l = br->_offset + br->_length - _offset; +- if( l > _length ) _length = l; // Pick larger region +- FileBuffRegion *nr = br->_next; // Get rest of region +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been subsumed). +- if( nr ) merge( nr ); // Merge with rest of region +- } // End of if regions overlap or not. +- } else { // "this" starts after "br" +- if( br->_offset+br->_length < _offset ) { // "br" ends before "this" +- FileBuffRegion *nr = new FileBuffRegion(_bfr,_sol,_line,_offset,_length); +- nr->_next = _next; // Structure copy "this" guy to "nr" +- *this = *br; // Structure copy "br" over "this". +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been copied) +- merge( nr ); // Finish merging +- } else { // Regions overlap. +- int l = _offset + _length - br->_offset; +- if( l > _length ) _length = l; // Pick larger region +- _offset = br->_offset; // Start with earlier region +- _sol = br->_sol; // Also use earlier line start +- _line = br->_line; // Also use earlier line +- FileBuffRegion *nr = br->_next; // Get rest of region +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been subsumed). +- if( nr ) merge( nr ); // Merge with rest of region +- } // End of if regions overlap or not. +- } +- return this; +-} +- +-//------------------------------expandtab-------------------------------------- +-static int expandtab( ostream &os, int off, char c, char fill1, char fill2 ) { +- if( c == '\t' ) { // Tab? +- do os << fill1; // Expand the tab; Output space +- while( (++off) & 7 ); // Expand to tab stop +- } else { // Normal character +- os << fill2; // Display normal character +- off++; // Increment "cursor" offset +- } +- return off; +-} +- +-//------------------------------printline-------------------------------------- +-// Print and highlite a region of a line. Return the amount of highliting left +-// to do (i.e. highlite length minus length of line). +-static int printline( ostream& os, const char *fname, int line, +- const char *_sol, int skip, int len ) { +- +- // Display the entire tab-expanded line +- os << fname << ":" << line << ": "; +- const char *t = strchr(_sol,'\n')+1; // End of line +- int off = 0; // Cursor offset for tab expansion +- const char *s = _sol; // Nice string pointer +- while( t-s ) { // Display whole line +- char c = *s++; // Get next character to display +- off = expandtab(os,off,c,' ',c); +- } +- +- // Display the tab-expanded skippings before underlining. +- os << fname << ":" << line << ": "; +- off = 0; // Cursor offset for tab expansion +- s = _sol; // Restart string pointer +- +- // Start underlining. +- if( skip != -1 ) { // The no-start-indicating flag +- const char *u = _sol+skip; // Amount to skip +- while( u-s ) // Display skipped part +- off = expandtab(os,off,*s++,' ',' '); +- os << '^'; // Start region +- off++; // Moved cursor +- len--; // 1 less char to do +- if( *s++ == '\t' ) // Starting character is a tab? +- off = expandtab(os,off,'\t','-','^'); +- } +- +- // Long region doesn't end on this line +- int llen = (int)(t-s); // Length of line, minus what's already done +- if( len > llen ) { // Doing entire rest of line? +- while( t-s ) // Display rest of line +- off = expandtab(os,off,*s++,'-','-'); +- os << '\n'; // EOL +- return len-llen; // Return what's not yet done. +- } +- +- // Region does end on this line. This code fails subtly if the region ends +- // in a tab character. +- int i; +- for( i=1; iprint(os); // Print region +- brp = brp->_next; // Chain to next +- } +- return os; // Return final stream +-} +- +-//------------------------------print------------------------------------------ +-// Print the FileBuffRegion to a stream. FileBuffRegions are printed with the +-// filename and line number to the left, and complete text lines to the right. +-// Selected portions (portions of a line actually in the FileBuffRegion are +-// underlined. Ellipses are used for long multi-line regions. +-//void FileBuffRegion::print( std::ostream& os ) { +-void FileBuffRegion::print( ostream& os ) { +- if( !this ) return; // Nothing to print +- char *s = _bfr->get_line(); +- int skip = (int)(_offset - _sol); // Amount to skip to start of data +- int len = printline( os, _bfr->_fp->_name, _line, s, skip, _length ); +- +- if( !len ) return; // All done; exit +- +- // Here we require at least 2 lines +- int off1 = _length - len + skip; // Length of line 1 +- int off2 = off1 + _sol; // Offset to start of line 2 +- char *s2 = _bfr->get_line(); // Start of line 2 +- char *s3 = strchr( s2, '\n' )+1; // Start of line 3 (unread) +- if( len <= (s3-s2) ) { // It all fits on the next line +- printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Print&underline +- return; +- } +- +- // Here we require at least 3 lines +- int off3 = off2 + (int)(s3-s2); // Offset to start of line 3 +- s3 = _bfr->get_line(); // Start of line 3 (read) +- const char *s4 = strchr( s3, '\n' )+1;// Start of line 4 (unread) +- if( len < (s4-s3) ) { // It all fits on the next 2 lines +- s2 = _bfr->get_line(); +- len = printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Line 2 +- s3 = _bfr->get_line(); +- printline( os, _bfr->_fp->_name, _line+2, s3, -1, len ); // Line 3 +- return; +- } +- +- // Here we require at least 4 lines. +- // Print only the 1st and last line, with ellipses in middle. +- os << "...\n"; // The ellipses +- int cline = _line+1; // Skipped 2 lines +- do { // Do until find last line +- len -= (int)(s3-s2); // Remove length of line +- cline++; // Next line +- s2 = _bfr->get_line(); // Get next line from end of this line +- s3 = strchr( s2, '\n' ) + 1;// Get end of next line +- } while( len > (s3-s2) ); // Repeat until last line +- printline( os, _bfr->_fp->_name, cline, s2, -1, len ); // Print & underline +-} +- + //------------------------------file_error------------------------------------- + void FileBuff::file_error(int flag, int linenum, const char *fmt, ...) + { +diff -r e7a6a3354c84 -r 21130eb5768d src/share/vm/adlc/filebuff.hpp +--- hotspot/src/share/vm/adlc/filebuff.hpp Tue May 06 08:59:57 2014 -0400 ++++ hotspot/src/share/vm/adlc/filebuff.hpp Tue May 06 09:56:55 2014 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -46,7 +46,6 @@ + // This class defines a nicely behaved buffer of text. Entire file of text + // is read into buffer at creation, with sentinels at start and end. + class FileBuff { +- friend class FileBuffRegion; + private: + long _bufferSize; // Size of text holding buffer. + long _offset; // Expected filepointer offset. +@@ -82,29 +81,4 @@ + // when the pointer is valid (i.e. just obtained from getline()). + long getoff(const char* s) { return _bufoff + (long)(s - _buf); } + }; +- +-//------------------------------FileBuffRegion--------------------------------- +-// A buffer region is really a region of some file, specified as a linked list +-// of offsets and lengths. These regions can be merged; overlapping regions +-// will coalesce. +-class FileBuffRegion { +- public: // Workaround dev-studio friend/private bug +- FileBuffRegion *_next; // Linked list of regions sorted by offset. +- private: +- FileBuff *_bfr; // The Buffer of the file +- int _offset, _length; // The file area +- int _sol; // Start of line where the file area starts +- int _line; // First line of region +- +- public: +- FileBuffRegion(FileBuff*, int sol, int line, int offset, int len); +- ~FileBuffRegion(); +- +- FileBuffRegion *copy(); // Deep copy +- FileBuffRegion *merge(FileBuffRegion*); // Merge 2 regions; delete input +- +- void print(ostream&); +- friend ostream& operator<< (ostream&, FileBuffRegion&); +-}; +- + #endif // SHARE_VM_ADLC_FILEBUFF_HPP + Added: head/java/openjdk8/files/patch-remove-FileBuffRegion ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk8/files/patch-remove-FileBuffRegion Tue Dec 16 00:25:58 2014 (r374780) @@ -0,0 +1,270 @@ + +# HG changeset patch +# User lfoltan +# Date 1399384615 14400 +# Node ID 21130eb5768d79c7f3a4ef0b9d976d1942de09ad +# Parent e7a6a3354c8409f739c52ffeb224bb59c1351b64 +8041620: Solaris Studio 12.4 C++ 5.13 change in behavior for placing friend declarations within surrounding scope. +Summary: Remove adlc's unused class FileBuffRegion. +Reviewed-by: coleenp, dholmes, kvn + +diff -r e7a6a3354c84 -r 21130eb5768d src/share/vm/adlc/filebuff.cpp +--- hotspot/src/share/vm/adlc/filebuff.cpp Tue May 06 08:59:57 2014 -0400 ++++ hotspot/src/share/vm/adlc/filebuff.cpp Tue May 06 09:56:55 2014 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -89,200 +89,6 @@ + return retval; + } + +-//------------------------------FileBuffRegion--------------------------------- +-// Create a new region in a FileBuff. +-FileBuffRegion::FileBuffRegion( FileBuff* bufr, int soln, int ln, +- int off, int len) +-: _bfr(bufr), _sol(soln), _line(ln), _offset(off), _length(len) { +- _next = NULL; // No chained regions +-} +- +-//------------------------------~FileBuffRegion-------------------------------- +-// Delete the entire linked list of buffer regions. +-FileBuffRegion::~FileBuffRegion() { +- if( _next ) delete _next; +-} +- +-//------------------------------copy------------------------------------------- +-// Deep copy a FileBuffRegion +-FileBuffRegion *FileBuffRegion::copy() { +- if( !this ) return NULL; // The empty buffer region +- FileBuffRegion *br = new FileBuffRegion(_bfr,_sol,_line,_offset,_length); +- if( _next ) br->_next = _next->copy(); +- return br; +-} +- +-//------------------------------merge------------------------------------------ +-// Merge another buffer region into this buffer region. Make overlapping areas +-// become a single region. Remove (delete) the input FileBuffRegion. +-// Since the buffer regions are sorted by file offset, this is a varient of a +-// "sorted-merge" running in linear time. +-FileBuffRegion *FileBuffRegion::merge( FileBuffRegion *br ) { +- if( !br ) return this; // Merging nothing +- if( !this ) return br; // Merging into nothing +- +- assert( _bfr == br->_bfr, "" ); // Check for pointer-equivalent buffers +- +- if( _offset < br->_offset ) { // "this" starts before "br" +- if( _offset+_length < br->_offset ) { // "this" ends before "br" +- if( _next ) _next->merge( br ); // Merge with remainder of list +- else _next = br; // No more in this list; just append. +- } else { // Regions overlap. +- int l = br->_offset + br->_length - _offset; +- if( l > _length ) _length = l; // Pick larger region +- FileBuffRegion *nr = br->_next; // Get rest of region +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been subsumed). +- if( nr ) merge( nr ); // Merge with rest of region +- } // End of if regions overlap or not. +- } else { // "this" starts after "br" +- if( br->_offset+br->_length < _offset ) { // "br" ends before "this" +- FileBuffRegion *nr = new FileBuffRegion(_bfr,_sol,_line,_offset,_length); +- nr->_next = _next; // Structure copy "this" guy to "nr" +- *this = *br; // Structure copy "br" over "this". +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been copied) +- merge( nr ); // Finish merging +- } else { // Regions overlap. +- int l = _offset + _length - br->_offset; +- if( l > _length ) _length = l; // Pick larger region +- _offset = br->_offset; // Start with earlier region +- _sol = br->_sol; // Also use earlier line start +- _line = br->_line; // Also use earlier line +- FileBuffRegion *nr = br->_next; // Get rest of region +- br->_next = NULL; // Remove indication of rest of region +- delete br; // Delete this region (it's been subsumed). +- if( nr ) merge( nr ); // Merge with rest of region +- } // End of if regions overlap or not. +- } +- return this; +-} +- +-//------------------------------expandtab-------------------------------------- +-static int expandtab( ostream &os, int off, char c, char fill1, char fill2 ) { +- if( c == '\t' ) { // Tab? +- do os << fill1; // Expand the tab; Output space +- while( (++off) & 7 ); // Expand to tab stop +- } else { // Normal character +- os << fill2; // Display normal character +- off++; // Increment "cursor" offset +- } +- return off; +-} +- +-//------------------------------printline-------------------------------------- +-// Print and highlite a region of a line. Return the amount of highliting left +-// to do (i.e. highlite length minus length of line). +-static int printline( ostream& os, const char *fname, int line, +- const char *_sol, int skip, int len ) { +- +- // Display the entire tab-expanded line +- os << fname << ":" << line << ": "; +- const char *t = strchr(_sol,'\n')+1; // End of line +- int off = 0; // Cursor offset for tab expansion +- const char *s = _sol; // Nice string pointer +- while( t-s ) { // Display whole line +- char c = *s++; // Get next character to display +- off = expandtab(os,off,c,' ',c); +- } +- +- // Display the tab-expanded skippings before underlining. +- os << fname << ":" << line << ": "; +- off = 0; // Cursor offset for tab expansion +- s = _sol; // Restart string pointer +- +- // Start underlining. +- if( skip != -1 ) { // The no-start-indicating flag +- const char *u = _sol+skip; // Amount to skip +- while( u-s ) // Display skipped part +- off = expandtab(os,off,*s++,' ',' '); +- os << '^'; // Start region +- off++; // Moved cursor +- len--; // 1 less char to do +- if( *s++ == '\t' ) // Starting character is a tab? +- off = expandtab(os,off,'\t','-','^'); +- } +- +- // Long region doesn't end on this line +- int llen = (int)(t-s); // Length of line, minus what's already done +- if( len > llen ) { // Doing entire rest of line? +- while( t-s ) // Display rest of line +- off = expandtab(os,off,*s++,'-','-'); +- os << '\n'; // EOL +- return len-llen; // Return what's not yet done. +- } +- +- // Region does end on this line. This code fails subtly if the region ends +- // in a tab character. +- int i; +- for( i=1; iprint(os); // Print region +- brp = brp->_next; // Chain to next +- } +- return os; // Return final stream +-} +- +-//------------------------------print------------------------------------------ +-// Print the FileBuffRegion to a stream. FileBuffRegions are printed with the +-// filename and line number to the left, and complete text lines to the right. +-// Selected portions (portions of a line actually in the FileBuffRegion are +-// underlined. Ellipses are used for long multi-line regions. +-//void FileBuffRegion::print( std::ostream& os ) { +-void FileBuffRegion::print( ostream& os ) { +- if( !this ) return; // Nothing to print +- char *s = _bfr->get_line(); +- int skip = (int)(_offset - _sol); // Amount to skip to start of data +- int len = printline( os, _bfr->_fp->_name, _line, s, skip, _length ); +- +- if( !len ) return; // All done; exit +- +- // Here we require at least 2 lines +- int off1 = _length - len + skip; // Length of line 1 +- int off2 = off1 + _sol; // Offset to start of line 2 +- char *s2 = _bfr->get_line(); // Start of line 2 +- char *s3 = strchr( s2, '\n' )+1; // Start of line 3 (unread) +- if( len <= (s3-s2) ) { // It all fits on the next line +- printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Print&underline +- return; +- } +- +- // Here we require at least 3 lines +- int off3 = off2 + (int)(s3-s2); // Offset to start of line 3 +- s3 = _bfr->get_line(); // Start of line 3 (read) +- const char *s4 = strchr( s3, '\n' )+1;// Start of line 4 (unread) +- if( len < (s4-s3) ) { // It all fits on the next 2 lines +- s2 = _bfr->get_line(); +- len = printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Line 2 +- s3 = _bfr->get_line(); +- printline( os, _bfr->_fp->_name, _line+2, s3, -1, len ); // Line 3 +- return; +- } +- +- // Here we require at least 4 lines. +- // Print only the 1st and last line, with ellipses in middle. +- os << "...\n"; // The ellipses +- int cline = _line+1; // Skipped 2 lines +- do { // Do until find last line +- len -= (int)(s3-s2); // Remove length of line +- cline++; // Next line +- s2 = _bfr->get_line(); // Get next line from end of this line +- s3 = strchr( s2, '\n' ) + 1;// Get end of next line +- } while( len > (s3-s2) ); // Repeat until last line +- printline( os, _bfr->_fp->_name, cline, s2, -1, len ); // Print & underline +-} +- + //------------------------------file_error------------------------------------- + void FileBuff::file_error(int flag, int linenum, const char *fmt, ...) + { +diff -r e7a6a3354c84 -r 21130eb5768d src/share/vm/adlc/filebuff.hpp +--- hotspot/src/share/vm/adlc/filebuff.hpp Tue May 06 08:59:57 2014 -0400 ++++ hotspot/src/share/vm/adlc/filebuff.hpp Tue May 06 09:56:55 2014 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -46,7 +46,6 @@ + // This class defines a nicely behaved buffer of text. Entire file of text + // is read into buffer at creation, with sentinels at start and end. + class FileBuff { +- friend class FileBuffRegion; + private: + long _bufferSize; // Size of text holding buffer. + long _offset; // Expected filepointer offset. +@@ -82,29 +81,4 @@ + // when the pointer is valid (i.e. just obtained from getline()). + long getoff(const char* s) { return _bufoff + (long)(s - _buf); } + }; +- +-//------------------------------FileBuffRegion--------------------------------- +-// A buffer region is really a region of some file, specified as a linked list +-// of offsets and lengths. These regions can be merged; overlapping regions +-// will coalesce. +-class FileBuffRegion { +- public: // Workaround dev-studio friend/private bug +- FileBuffRegion *_next; // Linked list of regions sorted by offset. +- private: +- FileBuff *_bfr; // The Buffer of the file +- int _offset, _length; // The file area +- int _sol; // Start of line where the file area starts +- int _line; // First line of region +- +- public: +- FileBuffRegion(FileBuff*, int sol, int line, int offset, int len); +- ~FileBuffRegion(); +- +- FileBuffRegion *copy(); // Deep copy +- FileBuffRegion *merge(FileBuffRegion*); // Merge 2 regions; delete input +- +- void print(ostream&); +- friend ostream& operator<< (ostream&, FileBuffRegion&); +-}; +- + #endif // SHARE_VM_ADLC_FILEBUFF_HPP +