--- old/src/share/vm/adlc/adlc.hpp 2014-05-05 12:28:18.722833000 -0700 +++ new/src/share/vm/adlc/adlc.hpp 2014-05-05 12:28:17.556228000 -0700 @@ -30,12 +30,13 @@ // // standard library constants -#include "stdio.h" -#include "stdlib.h" #include -#include "string.h" -#include "ctype.h" -#include "stdarg.h" + +#include +#include +#include +#include +#include #include /* Make sure that we have the intptr_t and uintptr_t definitions */ --- old/src/share/vm/adlc/adlparse.hpp 2014-05-05 12:28:23.288113000 -0700 +++ new/src/share/vm/adlc/adlparse.hpp 2014-05-05 12:28:22.269984000 -0700 @@ -64,8 +64,6 @@ class PeepConstraint; class PeepReplace; -// class ostream; // ostream is a typedef in some systems - extern char *toUpper(const char *str); //---------------------------ADLParser----------------------------------------- --- old/src/share/vm/adlc/filebuff.cpp 2014-05-05 12:28:27.609228000 -0700 +++ new/src/share/vm/adlc/filebuff.cpp 2014-05-05 12:28:26.629762000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, 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 @@ -25,8 +25,6 @@ // FILEBUFF.CPP - Routines for handling a parser file buffer #include "adlc.hpp" -using namespace std; - //------------------------------FileBuff--------------------------------------- // Create a new parsing buffer FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) : _fp(fptr), _AD(archDesc) { @@ -89,200 +87,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, ...) { --- old/src/share/vm/adlc/filebuff.hpp 2014-05-05 12:28:31.357028000 -0700 +++ new/src/share/vm/adlc/filebuff.hpp 2014-05-05 12:28:30.230708000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, 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 @@ -26,9 +26,6 @@ #define SHARE_VM_ADLC_FILEBUFF_HPP // FILEBUFF.HPP - Definitions for parser file buffering routines -#include - -using namespace std; // STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES @@ -46,7 +43,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. @@ -83,28 +79,4 @@ 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 --- old/src/share/vm/adlc/output_h.cpp 2014-05-05 12:28:36.086713000 -0700 +++ new/src/share/vm/adlc/output_h.cpp 2014-05-05 12:28:34.974962000 -0700 @@ -211,7 +211,7 @@ const char *type = oper->ideal_type(globals); if (!strcmp(type, "ConI")) { if (i > 0) fprintf(fp,", "); - fprintf(fp," int32 _c%d;\n", i); + fprintf(fp," int32_t _c%d;\n", i); } else if (!strcmp(type, "ConP")) { if (i > 0) fprintf(fp,", "); @@ -307,7 +307,7 @@ assert(num_consts == 1, "Bad component list detected.\n"); switch( constant_type ) { case Form::idealI : { - fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i); + fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32_t c%d", i); break; } case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; } @@ -326,7 +326,7 @@ while((comp = lst.iter()) != NULL) { if (!strcmp(comp->base_type(globals), "ConI")) { if (i > 0) fprintf(fp,", "); - fprintf(fp,"int32 c%d", i); + fprintf(fp,"int32_t c%d", i); i++; } else if (!strcmp(comp->base_type(globals), "ConP")) { --- old/src/share/vm/asm/assembler.cpp 2014-05-05 12:28:40.988334000 -0700 +++ new/src/share/vm/asm/assembler.cpp 2014-05-05 12:28:39.814792000 -0700 @@ -119,7 +119,7 @@ L.patch_instructions((MacroAssembler*)this); } -void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) { +void AbstractAssembler::generate_stack_overflow_check(int frame_size_in_bytes) { if (UseStackBanging) { // Each code entry causes one stack bang n pages down the stack where n // is configurable by StackShadowPages. The setting depends on the maximum @@ -134,7 +134,7 @@ // is greater than a page. const int page_size = os::vm_page_size(); - int bang_end = StackShadowPages*page_size; + int bang_end = StackShadowPages * page_size; // This is how far the previous frame's stack banging extended. const int bang_end_safe = bang_end; --- old/src/share/vm/libadt/dict.cpp 2014-05-05 12:28:44.483012000 -0700 +++ new/src/share/vm/libadt/dict.cpp 2014-05-05 12:28:43.691726000 -0700 @@ -24,29 +24,17 @@ #include "precompiled.hpp" #include "libadt/dict.hpp" -#include "memory/allocation.inline.hpp" -#include "memory/resourceArea.hpp" -#include "runtime/thread.hpp" // Dictionaries - An Abstract Data Type // %%%%% includes not needed with AVM framework - Ungar -// #include "port.hpp" -//IMPLEMENTATION -// #include "dict.hpp" - #include -// The iostream is not needed and it gets confused for gcc by the -// define of bool. -// -// #include - //------------------------------data----------------------------------------- // String hash tables #define MAXID 20 -static byte initflag = 0; // True after 1st initialization +static uint8_t initflag = 0; // True after 1st initialization static const char shft[MAXID] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6}; static short xsum[MAXID]; @@ -281,7 +269,7 @@ // CmpDict compares two dictionaries; they must have the same keys (their // keys must match using CmpKey) and they must have the same values (pointer // comparison). If so 1 is returned, if not 0 is returned. -int32 Dict::operator ==(const Dict &d2) const { +int32_t Dict::operator ==(const Dict &d2) const { if( _cnt != d2._cnt ) return 0; if( _hash != d2._hash ) return 0; if( _cmp != d2._cmp ) return 0; @@ -318,7 +306,7 @@ // C text shows excellent spreading of values for any size hash table. int hashstr(const void *t) { register char c, k = 0; - register int32 sum = 0; + register int32_t sum = 0; register const char *s = (const char *)t; while( ((c = *s++) != '\0') && (k < MAXID-1) ) { // Get characters till null or MAXID-1 @@ -332,11 +320,7 @@ // Slimey cheap hash function; no guaranteed performance. Better than the // default for pointers, especially on MS-DOS machines. int hashptr(const void *key) { -#ifdef __TURBOC__ - return ((intptr_t)key >> 16); -#else // __TURBOC__ - return ((intptr_t)key >> 2); -#endif + return ((intptr_t)key >> 2); } // Slimey cheap hash function; no guaranteed performance. @@ -345,12 +329,12 @@ } //------------------------------Key Comparator Functions--------------------- -int32 cmpstr(const void *k1, const void *k2) { +int32_t cmpstr(const void *k1, const void *k2) { return strcmp((const char *)k1,(const char *)k2); } // Cheap key comparator. -int32 cmpkey(const void *key1, const void *key2) { +int32_t cmpkey(const void *key1, const void *key2) { if (key1 == key2) return 0; intptr_t delta = (intptr_t)key1 - (intptr_t)key2; if (delta > 0) return 1; --- old/src/share/vm/libadt/dict.hpp 2014-05-05 12:28:48.874779000 -0700 +++ new/src/share/vm/libadt/dict.hpp 2014-05-05 12:28:47.756416000 -0700 @@ -25,11 +25,12 @@ #ifndef SHARE_VM_LIBADT_DICT_HPP #define SHARE_VM_LIBADT_DICT_HPP -#include "libadt/port.hpp" - // Dictionaries - An Abstract Data Type -//INTERFACE -class ostream; + +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/thread.hpp" + class Dict; // These dictionaries define a key-value mapping. They can be inserted to, @@ -38,7 +39,7 @@ // key comparison routine determines if two keys are equal or not. A hash // function can be provided; if it's not provided the key itself is used // instead. A nice string hash function is included. -typedef int32 (*CmpKey)(const void *key1, const void *key2); +typedef int32_t (*CmpKey)(const void *key1, const void *key2); typedef int (*Hash)(const void *key); typedef void (*FuncDict)(const void *key, const void *val, Dict *d); @@ -47,7 +48,7 @@ class Arena *_arena; // Where to draw storage from class bucket *_bin; // Hash table is array of buckets uint _size; // Size (# of slots) in hash table - uint32 _cnt; // Number of key-value pairs in hash table + uint32_t _cnt; // Number of key-value pairs in hash table const Hash _hash; // Hashing function const CmpKey _cmp; // Key comparison function void doubhash( void ); // Double hash table size @@ -67,7 +68,7 @@ void Clear(); // Return # of key-value pairs in dict - uint32 Size(void) const { return _cnt; } + uint32_t Size(void) const { return _cnt; } // Insert inserts the given key-value pair into the dictionary. The prior // value of the key is returned; NULL if the key was not previously defined. @@ -81,7 +82,7 @@ // == compares two dictionaries; they must have the same keys (their keys // must match using CmpKey) and they must have the same values (pointer // comparison). If so 1 is returned, if not 0 is returned. - int32 operator ==(const Dict &d) const; // Compare dictionaries for equal + int32_t operator ==(const Dict &d) const; // Compare dictionaries for equal // Print out the dictionary contents as key-value pairs void print(); @@ -96,9 +97,9 @@ int hashkey(const void *key); // Key comparators -int32 cmpstr(const void *k1, const void *k2); +int32_t cmpstr(const void *k1, const void *k2); // Slimey cheap key comparator. -int32 cmpkey(const void *key1, const void *key2); +int32_t cmpkey(const void *key1, const void *key2); //------------------------------Iteration-------------------------------------- // The class of dictionary iterators. Fails in the presences of modifications --- old/src/share/vm/libadt/set.cpp 2014-05-05 12:28:53.112943000 -0700 +++ new/src/share/vm/libadt/set.cpp 2014-05-05 12:28:51.983419000 -0700 @@ -28,20 +28,11 @@ // Sets - An Abstract Data Type -// %%%%% includes not needed with AVM framework - Ungar -// #include "port.hpp" -//IMPLEMENTATION -// #include "set.hpp" - #include #include #include #include -// Not needed and it causes terouble for gcc. -// -// #include - //-------------------------Virtual Functions----------------------------------- // These functions MUST be implemented by the inheriting class. class SparseSet; --- old/src/share/vm/libadt/set.hpp 2014-05-05 12:28:57.592927000 -0700 +++ new/src/share/vm/libadt/set.hpp 2014-05-05 12:28:56.534636000 -0700 @@ -25,13 +25,10 @@ #ifndef SHARE_VM_LIBADT_SET_HPP #define SHARE_VM_LIBADT_SET_HPP -#include "libadt/port.hpp" #include "memory/allocation.hpp" // Sets - An Abstract Data Type -//INTERFACE - class SparseSet; class VectorSet; class ListSet; --- old/src/share/vm/libadt/vectset.cpp 2014-05-05 12:29:01.040953000 -0700 +++ new/src/share/vm/libadt/vectset.cpp 2014-05-05 12:28:59.891841000 -0700 @@ -28,15 +28,10 @@ // Vector Sets - An Abstract Data Type -// %%%%% includes not needed with AVM framework - Ungar -// #include "port.hpp" -//IMPLEMENTATION -// #include "vectset.hpp" - // BitsInByte is a lookup table which tells the number of bits that // are in the looked-up number. It is very useful in VectorSet_Size. -uint8 bitsInByte[256] = { +uint8_t bitsInByte[256] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, @@ -59,7 +54,7 @@ // Create a new, empty Set. VectorSet::VectorSet(Arena *arena) : Set(arena) { size = 2; // Small initial size - data = (uint32 *)_set_arena->Amalloc(size*sizeof(uint32)); + data = (uint32_t *)_set_arena->Amalloc(size*sizeof(uint32_t)); data[0] = 0; // No elements data[1] = 0; } @@ -85,8 +80,8 @@ void VectorSet::slamin(const VectorSet& s) { size = s.size; // Use new size - data = (uint32*)s._set_arena->Amalloc(size*sizeof(uint32)); // Make array of required size - memcpy( data, s.data, size*sizeof(uint32) ); // Fill the array + data = (uint32_t*)s._set_arena->Amalloc(size*sizeof(uint32_t)); // Make array of required size + memcpy( data, s.data, size*sizeof(uint32_t) ); // Fill the array } //------------------------------grow------------------------------------------- @@ -96,8 +91,8 @@ newsize = (newsize+31) >> 5; // Convert to longwords uint x = size; while( x < newsize ) x <<= 1; - data = (uint32 *)_set_arena->Arealloc(data, size*sizeof(uint32), x*sizeof(uint32)); - memset((char *)(data + size), 0, (x - size)*sizeof(uint32)); + data = (uint32_t *)_set_arena->Arealloc(data, size*sizeof(uint32_t), x*sizeof(uint32_t)); + memset((char *)(data + size), 0, (x - size)*sizeof(uint32_t)); size = x; } @@ -106,7 +101,7 @@ Set &VectorSet::operator <<= (uint elem) { register uint word = elem >> 5; // Get the longword offset - register uint32 mask = 1L << (elem & 31); // Get bit mask + register uint32_t mask = 1L << (elem & 31); // Get bit mask if( word >= size ) // Need to grow set? grow(elem+1); // Then grow it @@ -121,7 +116,7 @@ register uint word = elem >> 5; // Get the longword offset if( word >= size ) // Beyond the last? return *this; // Then it's clear & return clear - register uint32 mask = 1L << (elem & 31); // Get bit mask + register uint32_t mask = 1L << (elem & 31); // Get bit mask data[word] &= ~mask; // Clear bit return *this; } @@ -132,8 +127,8 @@ { // NOTE: The intersection is never any larger than the smallest set. if( s.size < size ) size = s.size; // Get smaller size - register uint32 *u1 = data; // Pointer to the destination data - register uint32 *u2 = s.data; // Pointer to the source data + register uint32_t *u1 = data; // Pointer to the destination data + register uint32_t *u2 = s.data; // Pointer to the source data for( uint i=0; i> 5; // Get the longword offset if( word >= size ) // Beyond the last? return 0; // Then it's clear - register uint32 mask = 1L << (elem & 31); // Get bit mask + register uint32_t mask = 1L << (elem & 31); // Get bit mask return ((data[word] & mask))!=0; // Return the sense of the bit } @@ -305,7 +300,7 @@ for( i=0; i>=1 ); return (i<<5)+j; @@ -316,11 +311,11 @@ void VectorSet::Clear(void) { if( size > 100 ) { // Reclaim storage only if huge - FREE_RESOURCE_ARRAY(uint32,data,size); + FREE_RESOURCE_ARRAY(uint32_t,data,size); size = 2; // Small initial size - data = NEW_RESOURCE_ARRAY(uint32,size); + data = NEW_RESOURCE_ARRAY(uint32_t,size); } - memset( data, 0, size*sizeof(uint32) ); + memset( data, 0, size*sizeof(uint32_t) ); } //------------------------------Size------------------------------------------- @@ -328,8 +323,8 @@ uint VectorSet::Size(void) const { uint sum = 0; // Cumulative size so far. - uint8 *currByte = (uint8*)data; - for( uint32 i = 0; i < (size<<2); i++) // While have bytes to process + uint8_t* currByte = (uint8_t*) data; + for( uint32_t i = 0; i < (size<<2); i++) // While have bytes to process sum += bitsInByte[*currByte++]; // Add bits in current byte to size. return sum; } @@ -343,7 +338,7 @@ //------------------------------hash------------------------------------------- int VectorSet::hash() const { - uint32 _xor = 0; + uint32_t _xor = 0; uint lim = ((size<4)?size:4); for( uint i = 0; i < lim; i++ ) _xor ^= data[i]; --- old/src/share/vm/libadt/vectset.hpp 2014-05-05 12:29:05.759769000 -0700 +++ new/src/share/vm/libadt/vectset.hpp 2014-05-05 12:29:04.649607000 -0700 @@ -47,7 +47,7 @@ friend class VectorSetI; // Friendly iterator class protected: uint size; // Size of data IN LONGWORDS (32bits) - uint32 *data; // The data, bit packed + uint32_t* data; // The data, bit packed void slamin( const VectorSet& s ); // Initialize one set with another int compare(const VectorSet &s) const; // Compare set contents @@ -99,7 +99,7 @@ void Sort(void); // Sort before iterating int hash() const; // Hash function void Reset(void) { // Reset a set - memset( data, 0, size*sizeof(uint32) ); + memset( data, 0, size*sizeof(uint32_t) ); } /* Removed for MCC BUG @@ -108,7 +108,7 @@ // Expose internals for speed-critical fast iterators uint word_size() const { return size; } - uint32 *EXPOSE() const { return data; } + uint32_t* EXPOSE() const { return data; } // Fast inlined "test and set". Replaces the idiom: // if( visited[idx] ) return; @@ -120,8 +120,8 @@ uint word = elem >> 5; // Get the longword offset if( word >= size ) // Beyond the last? return test_set_grow(elem); // Then grow; set; return 0; - uint32 mask = 1L << (elem & 31); // Get bit mask - uint32 datum = data[word] & mask;// Get bit + uint32_t mask = 1L << (elem & 31); // Get bit mask + uint32_t datum = data[word] & mask;// Get bit data[word] |= mask; // Set bit return datum; // Return bit } @@ -134,7 +134,7 @@ int test( uint elem ) const { uint word = elem >> 5; // Get the longword offset if( word >= size ) return 0; // Beyond the last? - uint32 mask = 1L << (elem & 31); // Get bit mask + uint32_t mask = 1L << (elem & 31); // Get bit mask return data[word] & mask; // Get bit } @@ -144,7 +144,7 @@ if( word >= size ) { // Beyond the last? test_set_grow(elem); // Then grow and set } else { - uint32 mask = 1L << (elem & 31); // Get bit mask + uint32_t mask = 1L << (elem & 31); // Get bit mask data[word] |= mask; // Set bit } } @@ -164,7 +164,7 @@ friend class VectorSet; const VectorSet *s; uint i, j; - uint32 mask; + uint32_t mask; uint next(void); public: --- old/src/share/vm/opto/block.cpp 2014-05-05 12:29:10.750839000 -0700 +++ new/src/share/vm/opto/block.cpp 2014-05-05 12:29:09.546278000 -0700 @@ -1268,7 +1268,6 @@ } void UnionFind::reset( uint max ) { - assert( max <= max_uint, "Must fit within uint" ); // Force the Union-Find mapping to be at least this large extend(max,0); // Initialize to be the ID mapping. --- old/src/share/vm/opto/chaitin.hpp 2014-05-05 12:29:14.230302000 -0700 +++ new/src/share/vm/opto/chaitin.hpp 2014-05-05 12:29:13.422865000 -0700 @@ -26,7 +26,6 @@ #define SHARE_VM_OPTO_CHAITIN_HPP #include "code/vmreg.hpp" -#include "libadt/port.hpp" #include "memory/resourceArea.hpp" #include "opto/connode.hpp" #include "opto/live.hpp" @@ -142,7 +141,7 @@ // Number of registers this live range uses when it colors private: - uint8 _num_regs; // 2 for Longs and Doubles, 1 for all else + uint8_t _num_regs; // 2 for Longs and Doubles, 1 for all else // except _num_regs is kill count for fat_proj public: int num_regs() const { return _num_regs; } @@ -151,7 +150,7 @@ private: // Number of physical registers this live range uses when it colors // Architecture and register-set dependent - uint8 _reg_pressure; + uint8_t _reg_pressure; public: void set_reg_pressure(int i) { _reg_pressure = i; } int reg_pressure() const { return _reg_pressure; } --- old/src/share/vm/opto/compile.hpp 2014-05-05 12:29:18.662116000 -0700 +++ new/src/share/vm/opto/compile.hpp 2014-05-05 12:29:17.653115000 -0700 @@ -32,7 +32,6 @@ #include "compiler/compilerOracle.hpp" #include "compiler/compileBroker.hpp" #include "libadt/dict.hpp" -#include "libadt/port.hpp" #include "libadt/vectset.hpp" #include "memory/resourceArea.hpp" #include "opto/idealGraphPrinter.hpp" --- old/src/share/vm/opto/divnode.cpp 2014-05-05 12:29:22.866709000 -0700 +++ new/src/share/vm/opto/divnode.cpp 2014-05-05 12:29:22.050459000 -0700 @@ -514,7 +514,7 @@ int widen = MAX2(i1->_widen, i2->_widen); if( i2->is_con() && i2->get_con() != 0 ) { - int32 d = i2->get_con(); // Divisor + int32_t d = i2->get_con(); // Divisor jint lo, hi; if( d >= 0 ) { lo = i1->_lo/d; @@ -536,7 +536,7 @@ // If the dividend is a constant if( i1->is_con() ) { - int32 d = i1->get_con(); + int32_t d = i1->get_con(); if( d < 0 ) { if( d == min_jint ) { // (-min_jint) == min_jint == (min_jint / -1) --- old/src/share/vm/opto/domgraph.cpp 2014-05-05 12:29:27.206379000 -0700 +++ new/src/share/vm/opto/domgraph.cpp 2014-05-05 12:29:26.500264000 -0700 @@ -397,8 +397,9 @@ ntarjan[i]._control = NULL; // Store the DFS order for the main loop + const uint fill_value = (uint) -1; uint *dfsorder = NEW_RESOURCE_ARRAY(uint,C->unique()+1); - memset(dfsorder, max_uint, (C->unique()+1) * sizeof(uint)); + memset(dfsorder, fill_value, (C->unique()+1) * sizeof(uint)); // Tarjan's algorithm, almost verbatim: // Step 1: @@ -419,7 +420,7 @@ if( whead->in(j) == NULL || !whead->in(j)->is_CFG() ) continue; // Only process control nodes uint b = dfsorder[whead->in(j)->_idx]; - if(b == max_uint) continue; + if(b == fill_value) continue; NTarjan *vx = &ntarjan[b]; NTarjan *u = vx->EVAL(); if( u->_semi < w->_semi ) --- old/src/share/vm/opto/indexSet.cpp 2014-05-05 12:29:30.779941000 -0700 +++ new/src/share/vm/opto/indexSet.cpp 2014-05-05 12:29:29.803331000 -0700 @@ -51,7 +51,7 @@ #endif // What is the first set bit in a 5 bit integer? -const byte IndexSetIterator::_first_bit[32] = { +const uint8_t IndexSetIterator::_first_bit[32] = { 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, @@ -63,7 +63,7 @@ }; // What is the second set bit in a 5 bit integer? -const byte IndexSetIterator::_second_bit[32] = { +const uint8_t IndexSetIterator::_second_bit[32] = { 5, 5, 5, 1, 5, 2, 2, 1, 5, 3, 3, 1, @@ -298,7 +298,7 @@ set_block(i, &_empty_block); } else { BitBlock *new_block = alloc_block(); - memcpy(new_block->words(), block->words(), sizeof(uint32) * words_per_block); + memcpy(new_block->words(), block->words(), sizeof(uint32_t) * words_per_block); set_block(i, new_block); } } --- old/src/share/vm/opto/indexSet.hpp 2014-05-05 12:29:34.885948000 -0700 +++ new/src/share/vm/opto/indexSet.hpp 2014-05-05 12:29:34.066245000 -0700 @@ -106,12 +106,12 @@ // is used by IndexSet to mainting this free list. union { - uint32 _words[words_per_block]; + uint32_t _words[words_per_block]; BitBlock *_next; } _data; // accessors - uint32 *words() { return _data._words; } + uint32_t* words() { return _data._words; } void set_next(BitBlock *next) { _data._next = next; } BitBlock *next() { return _data._next; } @@ -120,22 +120,22 @@ // not assume that the block index has been masked out. void clear() { - memset(words(), 0, sizeof(uint32) * words_per_block); + memset(words(), 0, sizeof(uint32_t) * words_per_block); } bool member(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); - return ((words()[word_index] & (uint32)(0x1 << bit_index)) != 0); + return ((words()[word_index] & (uint32_t)(0x1 << bit_index)) != 0); } bool insert(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); - uint32 bit = (0x1 << bit_index); - uint32 before = words()[word_index]; + uint32_t bit = (0x1 << bit_index); + uint32_t before = words()[word_index]; words()[word_index] = before | bit; return ((before & bit) != 0); } @@ -144,8 +144,8 @@ uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); - uint32 bit = (0x1 << bit_index); - uint32 before = words()[word_index]; + uint32_t bit = (0x1 << bit_index); + uint32_t before = words()[word_index]; words()[word_index] = before & ~bit; return ((before & bit) != 0); } @@ -404,14 +404,14 @@ table_size = (1 << window_size) }; // For an integer of length window_size, what is the first set bit? - static const byte _first_bit[table_size]; + static const uint8_t _first_bit[table_size]; // For an integer of length window_size, what is the second set bit? - static const byte _second_bit[table_size]; + static const uint8_t _second_bit[table_size]; private: // The current word we are inspecting - uint32 _current; + uint32_t _current; // What element number are we currently on? uint _value; @@ -420,7 +420,7 @@ uint _next_word; // A pointer to the contents of the current block - uint32 *_words; + uint32_t *_words; // The index of the next block we will inspect uint _next_block; --- old/src/share/vm/opto/live.hpp 2014-05-05 12:29:39.500188000 -0700 +++ new/src/share/vm/opto/live.hpp 2014-05-05 12:29:38.377111000 -0700 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OPTO_LIVE_HPP #define SHARE_VM_OPTO_LIVE_HPP -#include "libadt/port.hpp" #include "libadt/vectset.hpp" #include "opto/block.hpp" #include "opto/indexSet.hpp" --- old/src/share/vm/opto/loopnode.hpp 2014-05-05 12:29:42.982804000 -0700 +++ new/src/share/vm/opto/loopnode.hpp 2014-05-05 12:29:42.121839000 -0700 @@ -339,11 +339,11 @@ Node_List _body; // Loop body for inner loops - uint8 _nest; // Nesting depth - uint8 _irreducible:1, // True if irreducible - _has_call:1, // True if has call safepoint - _has_sfpt:1, // True if has non-call safepoint - _rce_candidate:1; // True if candidate for range check elimination + uint8_t _nest; // Nesting depth + uint8_t _irreducible:1, // True if irreducible + _has_call:1, // True if has call safepoint + _has_sfpt:1, // True if has non-call safepoint + _rce_candidate:1; // True if candidate for range check elimination Node_List* _safepts; // List of safepoints in this loop Node_List* _required_safept; // A inner loop cannot delete these safepts; --- old/src/share/vm/opto/mulnode.cpp 2014-05-05 12:29:47.963405000 -0700 +++ new/src/share/vm/opto/mulnode.cpp 2014-05-05 12:29:47.084843000 -0700 @@ -235,23 +235,23 @@ const TypeInt *r1 = t1->is_int(); // Fetch endpoints of all ranges - int32 lo0 = r0->_lo; + int32_t lo0 = r0->_lo; double a = (double)lo0; - int32 hi0 = r0->_hi; + int32_t hi0 = r0->_hi; double b = (double)hi0; - int32 lo1 = r1->_lo; + int32_t lo1 = r1->_lo; double c = (double)lo1; - int32 hi1 = r1->_hi; + int32_t hi1 = r1->_hi; double d = (double)hi1; // Compute all endpoints & check for overflow - int32 A = lo0*lo1; + int32_t A = lo0*lo1; if( (double)A != a*c ) return TypeInt::INT; // Overflow? - int32 B = lo0*hi1; + int32_t B = lo0*hi1; if( (double)B != a*d ) return TypeInt::INT; // Overflow? - int32 C = hi0*lo1; + int32_t C = hi0*lo1; if( (double)C != b*c ) return TypeInt::INT; // Overflow? - int32 D = hi0*hi1; + int32_t D = hi0*hi1; if( (double)D != b*d ) return TypeInt::INT; // Overflow? if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints @@ -1228,12 +1228,12 @@ // // const TypeInstPtr *o = t1->is_instptr(); // if( t1->singleton() ) - // return TypeInt::make( ((uint32)o->const_oop() + o->_offset) >> shift ); + // return TypeInt::make( ((uint32_t)o->const_oop() + o->_offset) >> shift ); // } // else if( t1->base() == Type::KlassPtr ) { // const TypeKlassPtr *o = t1->is_klassptr(); // if( t1->singleton() ) - // return TypeInt::make( ((uint32)o->const_oop() + o->_offset) >> shift ); + // return TypeInt::make( ((uint32_t)o->const_oop() + o->_offset) >> shift ); // } return TypeInt::INT; --- old/src/share/vm/opto/node.hpp 2014-05-05 12:29:52.173864000 -0700 +++ new/src/share/vm/opto/node.hpp 2014-05-05 12:29:51.153766000 -0700 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OPTO_NODE_HPP #define SHARE_VM_OPTO_NODE_HPP -#include "libadt/port.hpp" #include "libadt/vectset.hpp" #include "opto/compile.hpp" #include "opto/type.hpp" --- old/src/share/vm/opto/output.cpp 2014-05-05 12:29:56.715650000 -0700 +++ new/src/share/vm/opto/output.cpp 2014-05-05 12:29:55.604929000 -0700 @@ -366,8 +366,8 @@ // third inserts nops where needed. // Step one, perform a pessimistic sizing pass. - uint last_call_adr = max_uint; - uint last_avoid_back_to_back_adr = max_uint; + uint last_call_adr = (uint) -1; + uint last_avoid_back_to_back_adr = (uint) -1; uint nop_size = (new (this) MachNopNode())->size(_regalloc); for (uint i = 0; i < nblocks; i++) { // For all blocks Block* block = _cfg->get_block(i); @@ -479,7 +479,7 @@ // Step two, replace eligible long jumps. bool progress = true; - uint last_may_be_short_branch_adr = max_uint; + uint last_may_be_short_branch_adr = (uint) -1; while (has_short_branch_candidate && progress) { progress = false; has_short_branch_candidate = false; --- old/src/share/vm/opto/parse2.cpp 2014-05-05 12:29:59.251323000 -0700 +++ new/src/share/vm/opto/parse2.cpp 2014-05-05 12:29:58.308182000 -0700 @@ -405,9 +405,9 @@ bool needs_guard = false; int default_dest; - int64 total_outlier_size = 0; - int64 hi_size = ((int64)hi->hi()) - ((int64)hi->lo()) + 1; - int64 lo_size = ((int64)lo->hi()) - ((int64)lo->lo()) + 1; + int64_t total_outlier_size = 0; + int64_t hi_size = ((int64_t)hi->hi()) - ((int64_t)hi->lo()) + 1; + int64_t lo_size = ((int64_t)lo->hi()) - ((int64_t)lo->lo()) + 1; if (lo->dest() == hi->dest()) { total_outlier_size = hi_size + lo_size; @@ -429,7 +429,7 @@ } // Find the total number of cases and ranges - int64 num_cases = ((int64)hi->hi()) - ((int64)lo->lo()) + 1; + int64_t num_cases = ((int64_t)hi->hi()) - ((int64_t)lo->lo()) + 1; int num_range = hi - lo + 1; // Don't create table if: too large, too small, or too sparse. @@ -473,7 +473,7 @@ // These are the switch destinations hanging off the jumpnode int i = 0; for (SwitchRange* r = lo; r <= hi; r++) { - for (int64 j = r->lo(); j <= r->hi(); j++, i++) { + for (int64_t j = r->lo(); j <= r->hi(); j++, i++) { Node* input = _gvn.transform(new (C) JumpProjNode(jtn, i, r->dest(), (int)(j - lowval))); { PreserveJVMState pjvms(this); --- old/src/share/vm/opto/phase.hpp 2014-05-05 12:30:03.707509000 -0700 +++ new/src/share/vm/opto/phase.hpp 2014-05-05 12:30:02.594692000 -0700 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OPTO_PHASE_HPP #define SHARE_VM_OPTO_PHASE_HPP -#include "libadt/port.hpp" #include "runtime/timer.hpp" class Compile; --- old/src/share/vm/opto/regmask.cpp 2014-05-05 12:30:08.543336000 -0700 +++ new/src/share/vm/opto/regmask.cpp 2014-05-05 12:30:06.974673000 -0700 @@ -51,7 +51,7 @@ //-------------Non-zero bit search methods used by RegMask--------------------- // Find lowest 1, or return 32 if empty -int find_lowest_bit( uint32 mask ) { +int find_lowest_bit( uint32_t mask ) { int n = 0; if( (mask & 0xffff) == 0 ) { mask >>= 16; @@ -80,7 +80,7 @@ } // Find highest 1, or return 32 if empty -int find_hihghest_bit( uint32 mask ) { +int find_hihghest_bit( uint32_t mask ) { int n = 0; if( mask > 0xffff ) { mask >>= 16; @@ -395,7 +395,7 @@ //------------------------------Size------------------------------------------- // Compute size of register mask in bits uint RegMask::Size() const { - extern uint8 bitsInByte[256]; + extern uint8_t bitsInByte[256]; uint sum = 0; for( int i = 0; i < RM_SIZE; i++ ) sum += --- old/src/share/vm/opto/regmask.hpp 2014-05-05 12:30:12.805977000 -0700 +++ new/src/share/vm/opto/regmask.hpp 2014-05-05 12:30:11.713995000 -0700 @@ -26,7 +26,6 @@ #define SHARE_VM_OPTO_REGMASK_HPP #include "code/vmreg.hpp" -#include "libadt/port.hpp" #include "opto/optoreg.hpp" #ifdef TARGET_ARCH_MODEL_x86_32 # include "adfiles/adGlobals_x86_32.hpp" @@ -68,9 +67,9 @@ //-------------Non-zero bit search methods used by RegMask--------------------- // Find lowest 1, or return 32 if empty -int find_lowest_bit( uint32 mask ); +int find_lowest_bit( uint32_t mask ); // Find highest 1, or return 32 if empty -int find_hihghest_bit( uint32 mask ); +int find_hihghest_bit( uint32_t mask ); //------------------------------RegMask---------------------------------------- // The ADL file describes how to print the machine-specific registers, as well --- old/src/share/vm/opto/runtime.cpp 2014-05-05 12:30:16.026597000 -0700 +++ new/src/share/vm/opto/runtime.cpp 2014-05-05 12:30:15.285650000 -0700 @@ -960,7 +960,7 @@ } else { // Receiver did not match any saved receiver and there is no empty row for it. // Increment total counter to indicate polymorphic case. - intptr_t* count_p = (intptr_t*)(((byte*)(data)) + in_bytes(CounterData::count_offset())); + intptr_t* count_p = (intptr_t*)(((uint8_t*)(data)) + in_bytes(CounterData::count_offset())); *count_p += DataLayout::counter_increment; } JRT_END --- old/src/share/vm/opto/subnode.cpp 2014-05-05 12:30:19.784267000 -0700 +++ new/src/share/vm/opto/subnode.cpp 2014-05-05 12:30:18.913807000 -0700 @@ -242,8 +242,8 @@ const Type *SubINode::sub( const Type *t1, const Type *t2 ) const { const TypeInt *r0 = t1->is_int(); // Handy access const TypeInt *r1 = t2->is_int(); - int32 lo = r0->_lo - r1->_hi; - int32 hi = r0->_hi - r1->_lo; + int32_t lo = r0->_lo - r1->_hi; + int32_t hi = r0->_hi - r1->_lo; // We next check for 32-bit overflow. // If that happens, we just assume all integers are possible. --- old/src/share/vm/opto/type.hpp 2014-05-05 12:30:24.132798000 -0700 +++ new/src/share/vm/opto/type.hpp 2014-05-05 12:30:23.047731000 -0700 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OPTO_TYPE_HPP #define SHARE_VM_OPTO_TYPE_HPP -#include "libadt/port.hpp" #include "opto/adlcVMDeps.hpp" #include "runtime/handles.hpp" --- old/src/share/vm/precompiled/precompiled.hpp 2014-05-05 12:30:28.630438000 -0700 +++ new/src/share/vm/precompiled/precompiled.hpp 2014-05-05 12:30:27.575849000 -0700 @@ -246,7 +246,6 @@ # include "utilities/yieldingWorkgroup.hpp" #ifdef COMPILER2 # include "libadt/dict.hpp" -# include "libadt/port.hpp" # include "libadt/set.hpp" # include "libadt/vectset.hpp" # include "opto/addnode.hpp" --- old/src/share/vm/libadt/port.cpp 2014-05-05 12:30:32.965259000 -0700 +++ /dev/null 2014-04-16 06:03:33.154184688 -0700 @@ -1,123 +0,0 @@ -/* - * Copyright (c) 1997, 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "libadt/port.hpp" - -// Code for portable compiling - -#ifdef __GNUC__ -#pragma implementation -#endif - -// %%%%% includes not needed with AVM framework - Ungar -// #include "port.hpp" - -// This is only used if turboc is used and it causes problems with -// gcc. -#ifdef __TURBOC__ -#include -#endif - -#include - -//------------------------------gcd-------------------------------------------- -// Greatest common divisor -uint32 gcd( register uint32 x, register uint32 y ) -{ - register uint32 tmp; - while( x ) { // While not zero - tmp = x; // Hold onto smaller x value - x = y % x; // Compute modulus; since y>=x, 0 <= mod < x - y = tmp; // y = old x - } - return y; -} - -//----------------------------------------------------------------------------- -// Find first 1, or return 32 if empty -int ff1( uint32 mask ) -{ - unsigned i, n = 0; - - for( i=1, n=0; i; i<<=1, n++) - if( mask&i ) return n; - return 32; -} - -//----------------------------------------------------------------------------- -// Find highest 1, or return 32 if empty -int fh1( uint32 mask ) -{ - unsigned i, n = 0; - - for( i=((uint32)1<<31), n=31; i; i>>=1, n--) - if( mask&i ) return n; - return 32; -} - -//------------------------------rotate32--------------------------------------- -// Rotate 32bits. Postive rotates left (bits move toward high-order bit), -// negative rotates right. -uint32 rotate32( register uint32 x, register int32 cnt ) -{ - if( cnt >= 0 ) { // Positive rotates left - cnt &= 31; // Mask off extra shift bits - } else { // Negative rotates right - cnt = (-cnt)&31; // Flip sign; mask extra shift bits - cnt = 32-cnt; // Rotate right by big left rotation - } - return (x << cnt) | (x >> (32-cnt)); -} - -/* Disabled - we have another log2 in the system. - This function doesn't work if used as substitute - for the existing log2. Keep around until we have - verified all uses of log2 do the correct thing! -//------------------------------log2------------------------------------------- -// Log base 2. Might also be called 'count leading zeros'. Log2(x) returns -// an l such that (1L<= 0 ) // While high bit is clear - sx <<= 1, l--; // Shift bits left, count down log2 - return l; -} -*/ - -//------------------------------print------------------------------------------ -// Print a pointer without modifying the contents -#ifdef __TURBOC__ -ostream &ostream::operator << (const void *ptr) -{ - return (*this) << "0x" << hex << (uint)ptr << dec; -} -#else -/*ostream &operator << (ostream &os, const void *ptr) -{ - return os << "0x" << hex << (uint)ptr << dec; -}*/ -#endif --- old/src/share/vm/libadt/port.hpp 2014-05-05 12:30:34.220608000 -0700 +++ /dev/null 2014-04-16 06:03:33.154184688 -0700 @@ -1,208 +0,0 @@ -/* - * Copyright (c) 1997, 2013, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_LIBADT_PORT_HPP -#define SHARE_VM_LIBADT_PORT_HPP - -#include "utilities/top.hpp" - -// Typedefs for portable compiling - -#if defined(__GNUC__) - -#define INTERFACE #pragma interface -#define IMPLEMENTATION #pragma implementation -//INTERFACE -#include -#include -#include - -// Access to the C++ class virtual function pointer -// Put the class in the macro -typedef void *VPTR; -// G++ puts it at the end of the base class -#define ACCESS_VPTR(class) VPTR&vptr(){return*(VPTR*)((char*)this+sizeof(class)-sizeof(void*));} - -#elif defined(__TURBOC__) - -#include -#include -extern "C" int stricmp(const char *, const char *); -inline void bcopy(const void *s, void *d, int l) { memmove(d,s,l); } -inline void bzero(void *p, int l) { memset(p,0,l); } -inline int bcmp(const void *s, const void *d, int l) { return memcmp(s,d,l); } -inline int min( int a, int b) { return a < b ? a : b; } -inline int max( int a, int b) { return a > b ? a : b; } -//strcasecmp moved to globalDefinitions_visCPP.hpp -//inline int strcasecmp(const char *s1, const char *s2) { return stricmp(s1,s2); } -inline long abs( long x ) { return x < 0 ? -x : x; } -// Access to the C++ class virtual function pointer -// Put the class in the macro -typedef void near *VPTR; -// BorlandC puts it up front -#define ACCESS_VPTR(class) VPTR&vptr(){return*(VPTR*)this;} - -#elif defined(__hpux) - -#define INTERFACE -#define IMPLEMENTATION -#define signed -#include -#include -inline long min( long a, long b) { return a < b ? a : b; } -inline long max( long a, long b) { return a > b ? a : b; } -inline int min( int a, int b) { return a < b ? a : b; } -inline int max( int a, int b) { return a > b ? a : b; } -inline long abs( long x ) { return x < 0 ? -x : x; } - -#elif defined(__MOTO__) -// Motorola's mcc -#define INTERFACE -#define IMPLEMENTATION -#include -#include -inline int min( int a, int b) { return a < b ? a : b; } -inline int max( int a, int b) { return a > b ? a : b; } - -#elif defined(_AIX) -// IBM's xlC compiler -#define INTERFACE -#define IMPLEMENTATION -#include -#include - -#elif defined(_MSC_VER) -// Microsoft Visual C++ -//#define INTERFACE -#define IMPLEMENTATION -#include -#undef small -//strcasecmp moved to globalDefinitions_visCPP.hpp -//inline int strcasecmp(const char *s1, const char *s2) { return stricmp(s1,s2); } - - -#elif defined(SPARC_WORKS) - -#define INTERFACE -#define IMPLEMENTATION - -#include -#include -#include - -#elif defined(SOLARIS) - -#define INTERFACE -#define IMPLEMENTATION - -#include -#include -#include - - -#elif defined(__TANDEM) - -// This case is for the Tandem Business Unit of Compaq Computer Corporation. -// The Tandem case must precede the AT&T case, -// because the Tandem c89 compiler also defines __cplusplus. - -#include "port_tandem.hpp" - -#elif defined(__cplusplus) -// AT&Ts cfront -#define INTERFACE -#define IMPLEMENTATION -#include -#define signed -// #include -inline int min( int a, int b) { return a < b ? a : b; } -inline int max( int a, int b) { return a > b ? a : b; } - -#else // All other machines - -#define signed -extern "C" void bcopy(void *b1, void *b2, int len); -inline int min( int a, int b) { return a < b ? a : b; } -inline int max( int a, int b) { return a > b ? a : b; } - -#endif - -//----------------------------------------------------------------------------- -// Safer memory allocations -#ifdef SAFE_MEMORY -#define malloc(size) safe_malloc(__FILE__,__LINE__,size) -#define free(ptr) safe_free(__FILE__,__LINE__,ptr) -#define realloc(ptr,size) safe_realloc(__FILE__,__LINE__,ptr,size) -#define calloc(nitems,size) safe_calloc(__FILE__,__LINE__,nitems,size) -#define strdup(ptr) safe_strdup(__FILE__,__LINE__,ptr) -extern void *safe_malloc (const char *file, unsigned line, unsigned size); -extern void safe_free (const char *file, unsigned line, void *ptr); -extern void *safe_calloc (const char *file, unsigned line, unsigned nitems, unsigned size); -extern void *safe_realloc(const char *file, unsigned line, void *ptr, unsigned size); -extern char *safe_strdup (const char *file, unsigned line, const char *src); -inline void *operator new( size_t size ) throw() { return malloc(size); } -inline void operator delete( void *ptr ) { free(ptr); } -#endif - -//----------------------------------------------------------------------------- -// And now, the bit-size-specified integer sizes -typedef signed char int8; -typedef unsigned char uint8; -typedef unsigned char byte; - -// All uses of *int16 changed to 32-bit to speed up compiler on Intel -//typedef signed short int16; // Exactly 16bits signed -//typedef unsigned short uint16; // Exactly 16bits unsigned -//const unsigned int min_uint16 = 0x0000; // smallest uint16 -//const unsigned int max_uint16 = 0xFFFF; // largest uint16 - -typedef unsigned int uint; // When you need a fast >=16bit unsigned value -/*typedef int int; */ // When you need a fast >=16bit value -const unsigned int max_uint = (uint)-1; -typedef int32_t int32; // Exactly 32bits signed -typedef uint32_t uint32; // Exactly 32bits unsigned - -// Bit-sized floating point and long thingies -#ifndef __TANDEM -// Do not define these for Tandem, because they conflict with typedefs in softieee.h. -typedef float float32; // 32-bit float -typedef double float64; // 64-bit float -#endif // __TANDEM - -typedef jlong int64; // Java long for my 64-bit type -typedef julong uint64; // Java long for my 64-bit type - -//----------------------------------------------------------------------------- -// Nice constants -uint32 gcd( uint32 x, uint32 y ); -int ff1( uint32 mask ); -int fh1( uint32 mask ); -uint32 rotate32( uint32 x, int32 cnt ); - - -//----------------------------------------------------------------------------- -extern uint32 heap_totalmem; // Current total memory allocation -extern uint32 heap_highwater; // Highwater mark to date for memory usage - -#endif // SHARE_VM_LIBADT_PORT_HPP