6778669: Patch from Red Hat -- fixes compilation errors
Some fixes which are required to build on recent GCCs. Reviewed-by: never, kvn
This commit is contained in:
parent
114da9bcfc
commit
d6cdfde9d9
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
|
# Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -61,8 +61,8 @@ CPPFLAGS = $(SYSDEFS) $(INCLUDES)
|
|||||||
CPPFLAGS += -DASSERT
|
CPPFLAGS += -DASSERT
|
||||||
|
|
||||||
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
|
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
|
||||||
# Suppress warnings (for now)
|
# Compiler warnings are treated as errors
|
||||||
CFLAGS_WARN = -w
|
CFLAGS_WARN = -Werror
|
||||||
CFLAGS += $(CFLAGS_WARN)
|
CFLAGS += $(CFLAGS_WARN)
|
||||||
|
|
||||||
OBJECTNAMES = \
|
OBJECTNAMES = \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
|
# Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -67,6 +67,8 @@ ifndef USE_GCC
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
|
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
|
||||||
|
# Compiler warnings are treated as errors
|
||||||
|
CFLAGS_WARN = +w -errwarn
|
||||||
CFLAGS += $(CFLAGS_WARN)
|
CFLAGS += $(CFLAGS_WARN)
|
||||||
|
|
||||||
ifeq ("${Platform_compiler}", "sparcWorks")
|
ifeq ("${Platform_compiler}", "sparcWorks")
|
||||||
|
@ -79,6 +79,7 @@ typedef unsigned int uintptr_t;
|
|||||||
|
|
||||||
// Macros
|
// Macros
|
||||||
// Debugging note: Put a breakpoint on "abort".
|
// Debugging note: Put a breakpoint on "abort".
|
||||||
|
#undef assert
|
||||||
#define assert(cond, msg) { if (!(cond)) { fprintf(stderr, "assert fails %s %d: %s\n", __FILE__, __LINE__, msg); abort(); }}
|
#define assert(cond, msg) { if (!(cond)) { fprintf(stderr, "assert fails %s %d: %s\n", __FILE__, __LINE__, msg); abort(); }}
|
||||||
#define max(a, b) (((a)>(b)) ? (a) : (b))
|
#define max(a, b) (((a)>(b)) ? (a) : (b))
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -298,7 +298,7 @@ void ADLParser::matchrule_clone_and_swap(MatchRule* rule, const char* instr_iden
|
|||||||
rule->count_commutative_op(count);
|
rule->count_commutative_op(count);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
// Clone match rule and swap commutative operation's operands.
|
// Clone match rule and swap commutative operation's operands.
|
||||||
rule->swap_commutative_op(instr_ident, count, match_rules_cnt);
|
rule->matchrule_swap_commutative_op(instr_ident, count, match_rules_cnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2586,7 +2586,7 @@ void ADLParser::peep_constraint_parse(Peephole &peep) {
|
|||||||
while( _curchar != ')' ) {
|
while( _curchar != ')' ) {
|
||||||
// Get information on the left instruction and its operand
|
// Get information on the left instruction and its operand
|
||||||
// left-instructions's number
|
// left-instructions's number
|
||||||
intptr_t left_inst = get_int();
|
int left_inst = get_int();
|
||||||
// Left-instruction's operand
|
// Left-instruction's operand
|
||||||
skipws();
|
skipws();
|
||||||
if( _curchar != '.' ) {
|
if( _curchar != '.' ) {
|
||||||
@ -2602,7 +2602,7 @@ void ADLParser::peep_constraint_parse(Peephole &peep) {
|
|||||||
|
|
||||||
skipws();
|
skipws();
|
||||||
// Get information on the right instruction and its operand
|
// Get information on the right instruction and its operand
|
||||||
intptr_t right_inst; // Right-instructions's number
|
int right_inst; // Right-instructions's number
|
||||||
if( isdigit(_curchar) ) {
|
if( isdigit(_curchar) ) {
|
||||||
right_inst = get_int();
|
right_inst = get_int();
|
||||||
// Right-instruction's operand
|
// Right-instruction's operand
|
||||||
@ -3497,22 +3497,24 @@ FormatRule* ADLParser::template_parse(void) {
|
|||||||
|
|
||||||
// (1)
|
// (1)
|
||||||
// Check if there is a string to pass through to output
|
// Check if there is a string to pass through to output
|
||||||
char *start = _ptr; // Record start of the next string
|
{
|
||||||
while ((_curchar != '$') && ((_curchar != '%') || (*(_ptr+1) != '}')) ) {
|
char *start = _ptr; // Record start of the next string
|
||||||
// If at the start of a comment, skip past it
|
while ((_curchar != '$') && ((_curchar != '%') || (*(_ptr+1) != '}')) ) {
|
||||||
if( (_curchar == '/') && ((*(_ptr+1) == '/') || (*(_ptr+1) == '*')) ) {
|
// If at the start of a comment, skip past it
|
||||||
skipws_no_preproc();
|
if( (_curchar == '/') && ((*(_ptr+1) == '/') || (*(_ptr+1) == '*')) ) {
|
||||||
} else {
|
skipws_no_preproc();
|
||||||
// ELSE advance to the next character, or start of the next line
|
} else {
|
||||||
next_char_or_line();
|
// ELSE advance to the next character, or start of the next line
|
||||||
|
next_char_or_line();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If a string was found, terminate it and record in EncClass
|
||||||
|
if ( start != _ptr ) {
|
||||||
|
*_ptr = '\0'; // Terminate the string
|
||||||
|
// Add flag to _strings list indicating we should check _rep_vars
|
||||||
|
format->_strings.addName(NameList::_signal2);
|
||||||
|
format->_strings.addName(start);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// If a string was found, terminate it and record in EncClass
|
|
||||||
if ( start != _ptr ) {
|
|
||||||
*_ptr = '\0'; // Terminate the string
|
|
||||||
// Add flag to _strings list indicating we should check _rep_vars
|
|
||||||
format->_strings.addName(NameList::_signal2);
|
|
||||||
format->_strings.addName(start);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// (2)
|
// (2)
|
||||||
@ -3563,10 +3565,10 @@ FormatRule* ADLParser::template_parse(void) {
|
|||||||
// copy it and record in FormatRule
|
// copy it and record in FormatRule
|
||||||
if ( _curchar == '$' ) {
|
if ( _curchar == '$' ) {
|
||||||
next_char(); // Move past the '$'
|
next_char(); // Move past the '$'
|
||||||
char* rep_var = get_ident(); // Nil terminate the variable name
|
char* next_rep_var = get_ident(); // Nil terminate the variable name
|
||||||
rep_var = strdup(rep_var);// Copy the string
|
next_rep_var = strdup(next_rep_var);// Copy the string
|
||||||
*_ptr = _curchar; // and replace Nil with original character
|
*_ptr = _curchar; // and replace Nil with original character
|
||||||
format->_rep_vars.addName(rep_var);
|
format->_rep_vars.addName(next_rep_var);
|
||||||
// Add flag to _strings list indicating we should check _rep_vars
|
// Add flag to _strings list indicating we should check _rep_vars
|
||||||
format->_strings.addName(NameList::_signal);
|
format->_strings.addName(NameList::_signal);
|
||||||
}
|
}
|
||||||
@ -3714,13 +3716,13 @@ ExpandRule* ADLParser::expand_parse(InstructForm *instr) {
|
|||||||
parse_err(SYNERR, "identifier expected at %c\n", _curchar);
|
parse_err(SYNERR, "identifier expected at %c\n", _curchar);
|
||||||
continue;
|
continue;
|
||||||
} // Check that you have a valid operand
|
} // Check that you have a valid operand
|
||||||
const Form *form = instr->_localNames[ident2];
|
const Form *form2 = instr->_localNames[ident2];
|
||||||
if (!form) {
|
if (!form2) {
|
||||||
parse_err(SYNERR, "operand name expected at %s\n", ident2);
|
parse_err(SYNERR, "operand name expected at %s\n", ident2);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
oper = form->is_operand();
|
oper = form2->is_operand();
|
||||||
if (oper == NULL && !form->is_opclass()) {
|
if (oper == NULL && !form2->is_opclass()) {
|
||||||
parse_err(SYNERR, "operand name expected at %s\n", ident2);
|
parse_err(SYNERR, "operand name expected at %s\n", ident2);
|
||||||
continue;
|
continue;
|
||||||
} // Add operand to list
|
} // Add operand to list
|
||||||
@ -4271,7 +4273,7 @@ int ADLParser::get_int(void) {
|
|||||||
int result; // Storage for integer result
|
int result; // Storage for integer result
|
||||||
|
|
||||||
if( _curline == NULL ) // Return NULL at EOF.
|
if( _curline == NULL ) // Return NULL at EOF.
|
||||||
return NULL;
|
return 0;
|
||||||
|
|
||||||
skipws(); // Skip whitespace before identifier
|
skipws(); // Skip whitespace before identifier
|
||||||
start = end = _ptr; // Start points at first character
|
start = end = _ptr; // Start points at first character
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
|
// Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
//
|
//
|
||||||
// This code is free software; you can redistribute it and/or modify it
|
// This code is free software; you can redistribute it and/or modify it
|
||||||
@ -436,10 +436,12 @@ void ArchDesc::build_chain_rule(OperandForm *oper) {
|
|||||||
if ((oper->_matrule) && (oper->_matrule->_lChild == NULL) &&
|
if ((oper->_matrule) && (oper->_matrule->_lChild == NULL) &&
|
||||||
(oper->_matrule->_rChild == NULL)) {
|
(oper->_matrule->_rChild == NULL)) {
|
||||||
|
|
||||||
const Form *form = _globalNames[oper->_matrule->_opType];
|
{
|
||||||
if ((form) && form->is_operand() &&
|
const Form *form = _globalNames[oper->_matrule->_opType];
|
||||||
(form->ideal_only() == false)) {
|
if ((form) && form->is_operand() &&
|
||||||
add_chain_rule_entry(oper->_matrule->_opType, oper->cost(), oper->_ident);
|
(form->ideal_only() == false)) {
|
||||||
|
add_chain_rule_entry(oper->_matrule->_opType, oper->cost(), oper->_ident);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Check for additional chain rules
|
// Check for additional chain rules
|
||||||
if (oper->_matrule->_next) {
|
if (oper->_matrule->_next) {
|
||||||
@ -1015,12 +1017,12 @@ void ArchDesc::initBaseOpTypes() {
|
|||||||
int idealIndex = 0;
|
int idealIndex = 0;
|
||||||
for (idealIndex = 1; idealIndex < _last_machine_leaf; ++idealIndex) {
|
for (idealIndex = 1; idealIndex < _last_machine_leaf; ++idealIndex) {
|
||||||
const char *idealName = NodeClassNames[idealIndex];
|
const char *idealName = NodeClassNames[idealIndex];
|
||||||
_idealIndex.Insert((void*)idealName, (void*)idealIndex);
|
_idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
|
||||||
}
|
}
|
||||||
for ( idealIndex = _last_machine_leaf+1;
|
for ( idealIndex = _last_machine_leaf+1;
|
||||||
idealIndex < _last_opcode; ++idealIndex) {
|
idealIndex < _last_opcode; ++idealIndex) {
|
||||||
const char *idealName = NodeClassNames[idealIndex];
|
const char *idealName = NodeClassNames[idealIndex];
|
||||||
_idealIndex.Insert((void*)idealName, (void*)idealIndex);
|
_idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -870,7 +870,7 @@ void ExprDict::print_asserts(FILE *fp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print out the dictionary contents as key-value pairs
|
// Print out the dictionary contents as key-value pairs
|
||||||
static void dumpekey(const void* key) { fprintf(stdout, "%s", key); }
|
static void dumpekey(const void* key) { fprintf(stdout, "%s", (char*) key); }
|
||||||
static void dumpexpr(const void* expr) { fflush(stdout); ((Expr*)expr)->print(); }
|
static void dumpexpr(const void* expr) { fflush(stdout); ((Expr*)expr)->print(); }
|
||||||
|
|
||||||
void ExprDict::dump() {
|
void ExprDict::dump() {
|
||||||
@ -1020,7 +1020,7 @@ void ProductionState::set_cost_bounds(const char *result, const Expr *cost, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print out the dictionary contents as key-value pairs
|
// Print out the dictionary contents as key-value pairs
|
||||||
static void print_key (const void* key) { fprintf(stdout, "%s", key); }
|
static void print_key (const void* key) { fprintf(stdout, "%s", (char*) key); }
|
||||||
static void print_production(const void* production) { fflush(stdout); ((Production*)production)->print(); }
|
static void print_production(const void* production) { fflush(stdout); ((Production*)production)->print(); }
|
||||||
|
|
||||||
void ProductionState::print() {
|
void ProductionState::print() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -25,6 +25,8 @@
|
|||||||
// FILEBUFF.CPP - Routines for handling a parser file buffer
|
// FILEBUFF.CPP - Routines for handling a parser file buffer
|
||||||
#include "adlc.hpp"
|
#include "adlc.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
//------------------------------FileBuff---------------------------------------
|
//------------------------------FileBuff---------------------------------------
|
||||||
// Create a new parsing buffer
|
// Create a new parsing buffer
|
||||||
FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) : _fp(fptr), _AD(archDesc) {
|
FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) : _fp(fptr), _AD(archDesc) {
|
||||||
@ -217,7 +219,7 @@ static int printline( ostream& os, const char *fname, int line,
|
|||||||
off = expandtab(os,off,*s++,'-','-');
|
off = expandtab(os,off,*s++,'-','-');
|
||||||
if( i == len ) os << '^'; // Mark end of region
|
if( i == len ) os << '^'; // Mark end of region
|
||||||
os << '\n'; // End of marked line
|
os << '\n'; // End of marked line
|
||||||
return 0L; // All done
|
return 0; // All done
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------print------------------------------------------
|
//------------------------------print------------------------------------------
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -26,6 +26,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
// STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES
|
// STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *_name;
|
const char *_name;
|
||||||
@ -72,7 +73,7 @@ class FileBuff {
|
|||||||
|
|
||||||
// This converts a pointer into the buffer to a file offset. It only works
|
// This converts a pointer into the buffer to a file offset. It only works
|
||||||
// when the pointer is valid (i.e. just obtained from getline()).
|
// when the pointer is valid (i.e. just obtained from getline()).
|
||||||
int getoff(const char *s) { return _bufoff+(int)(s-_buf); }
|
long getoff(const char* s) { return _bufoff + (s - _buf); }
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------FileBuffRegion---------------------------------
|
//------------------------------FileBuffRegion---------------------------------
|
||||||
@ -95,8 +96,6 @@ class FileBuffRegion {
|
|||||||
FileBuffRegion *copy(); // Deep copy
|
FileBuffRegion *copy(); // Deep copy
|
||||||
FileBuffRegion *merge(FileBuffRegion*); // Merge 2 regions; delete input
|
FileBuffRegion *merge(FileBuffRegion*); // Merge 2 regions; delete input
|
||||||
|
|
||||||
// void print(std::ostream&);
|
|
||||||
// friend std::ostream& operator<< (std::ostream&, FileBuffRegion&);
|
|
||||||
void print(ostream&);
|
void print(ostream&);
|
||||||
friend ostream& operator<< (ostream&, FileBuffRegion&);
|
friend ostream& operator<< (ostream&, FileBuffRegion&);
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -370,7 +370,7 @@ bool FormDict::operator ==(const FormDict &d) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print out the dictionary contents as key-value pairs
|
// Print out the dictionary contents as key-value pairs
|
||||||
static void dumpkey (const void* key) { fprintf(stdout, "%s", key); }
|
static void dumpkey (const void* key) { fprintf(stdout, "%s", (char*) key); }
|
||||||
static void dumpform(const void* form) { fflush(stdout); ((Form*)form)->dump(); }
|
static void dumpform(const void* form) { fflush(stdout); ((Form*)form)->dump(); }
|
||||||
|
|
||||||
void FormDict::dump() {
|
void FormDict::dump() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -124,7 +124,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
// Public Data
|
// Public Data
|
||||||
Form *_next; // Next pointer for form lists
|
Form *_next; // Next pointer for form lists
|
||||||
long _linenum; // Line number for debugging
|
int _linenum; // Line number for debugging
|
||||||
|
|
||||||
// Dynamic type check for common forms.
|
// Dynamic type check for common forms.
|
||||||
virtual OpClassForm *is_opclass() const;
|
virtual OpClassForm *is_opclass() const;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -273,13 +273,13 @@ int RegClass::regs_in_word( int wordnum, bool stack_also ) {
|
|||||||
for(_regDefs.reset(); (name = _regDefs.iter()) != NULL;) {
|
for(_regDefs.reset(); (name = _regDefs.iter()) != NULL;) {
|
||||||
int rnum = ((RegDef*)_regDef[name])->register_num();
|
int rnum = ((RegDef*)_regDef[name])->register_num();
|
||||||
if( (rnum >> 5) == wordnum )
|
if( (rnum >> 5) == wordnum )
|
||||||
word |= (1L<<(rnum&31));
|
word |= (1 << (rnum & 31));
|
||||||
}
|
}
|
||||||
if( stack_also ) {
|
if( stack_also ) {
|
||||||
// Now also collect stack bits
|
// Now also collect stack bits
|
||||||
for( int i = 0; i < 32; i++ )
|
for( int i = 0; i < 32; i++ )
|
||||||
if( wordnum*32+i >= RegisterForm::_reg_ctr )
|
if( wordnum*32+i >= RegisterForm::_reg_ctr )
|
||||||
word |= (1L<<i);
|
word |= (1 << i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return word;
|
return word;
|
||||||
@ -592,10 +592,10 @@ void PeepMatch::add_instruction(int parent, int position, const char *name,
|
|||||||
int input) {
|
int input) {
|
||||||
if( position > _max_position ) _max_position = position;
|
if( position > _max_position ) _max_position = position;
|
||||||
|
|
||||||
_parent.addName((char *)parent);
|
_parent.addName((char*) (intptr_t) parent);
|
||||||
_position.addName((char *)position);
|
_position.addName((char*) (intptr_t) position);
|
||||||
_instrs.addName(name);
|
_instrs.addName(name);
|
||||||
_input.addName((char *)input);
|
_input.addName((char*) (intptr_t) input);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Access info about instructions in the peep-match rule
|
// Access info about instructions in the peep-match rule
|
||||||
@ -603,7 +603,7 @@ int PeepMatch::max_position() {
|
|||||||
return _max_position;
|
return _max_position;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *PeepMatch::instruction_name(intptr_t position) {
|
const char *PeepMatch::instruction_name(int position) {
|
||||||
return _instrs.name(position);
|
return _instrs.name(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,11 +615,11 @@ void PeepMatch::reset() {
|
|||||||
_input.reset();
|
_input.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeepMatch::next_instruction( intptr_t &parent, intptr_t &position, const char * &name, intptr_t &input ){
|
void PeepMatch::next_instruction(int &parent, int &position, const char* &name, int &input) {
|
||||||
parent = (intptr_t)_parent.iter();
|
parent = (int) (intptr_t) _parent.iter();
|
||||||
position = (intptr_t)_position.iter();
|
position = (int) (intptr_t) _position.iter();
|
||||||
name = _instrs.iter();
|
name = _instrs.iter();
|
||||||
input = (intptr_t)_input.iter();
|
input = (int) (intptr_t) _input.iter();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'true' if current position in iteration is a placeholder, not matched.
|
// 'true' if current position in iteration is a placeholder, not matched.
|
||||||
@ -637,15 +637,15 @@ void PeepMatch::output(FILE *fp) { // Write info to output files
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------PeepConstraint---------------------------------
|
//------------------------------PeepConstraint---------------------------------
|
||||||
PeepConstraint::PeepConstraint(intptr_t left_inst, char *left_op, char *relation,
|
PeepConstraint::PeepConstraint(int left_inst, char* left_op, char* relation,
|
||||||
intptr_t right_inst, char *right_op)
|
int right_inst, char* right_op)
|
||||||
: _left_inst(left_inst), _left_op(left_op), _relation(relation),
|
: _left_inst(left_inst), _left_op(left_op), _relation(relation),
|
||||||
_right_inst(right_inst), _right_op(right_op), _next(NULL) {}
|
_right_inst(right_inst), _right_op(right_op), _next(NULL) {}
|
||||||
PeepConstraint::~PeepConstraint() {
|
PeepConstraint::~PeepConstraint() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if constraints use instruction at position
|
// Check if constraints use instruction at position
|
||||||
bool PeepConstraint::constrains_instruction(intptr_t position) {
|
bool PeepConstraint::constrains_instruction(int position) {
|
||||||
// Check local instruction constraints
|
// Check local instruction constraints
|
||||||
if( _left_inst == position ) return true;
|
if( _left_inst == position ) return true;
|
||||||
if( _right_inst == position ) return true;
|
if( _right_inst == position ) return true;
|
||||||
@ -692,7 +692,7 @@ void PeepReplace::add_instruction(char *root) {
|
|||||||
}
|
}
|
||||||
void PeepReplace::add_operand( int inst_num, char *inst_operand ) {
|
void PeepReplace::add_operand( int inst_num, char *inst_operand ) {
|
||||||
_instruction.add_signal();
|
_instruction.add_signal();
|
||||||
_operand_inst_num.addName((char*)inst_num);
|
_operand_inst_num.addName((char*) (intptr_t) inst_num);
|
||||||
_operand_op_name.addName(inst_operand);
|
_operand_op_name.addName(inst_operand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -702,15 +702,15 @@ void PeepReplace::reset() {
|
|||||||
_operand_inst_num.reset();
|
_operand_inst_num.reset();
|
||||||
_operand_op_name.reset();
|
_operand_op_name.reset();
|
||||||
}
|
}
|
||||||
void PeepReplace::next_instruction(const char * &inst){
|
void PeepReplace::next_instruction(const char* &inst){
|
||||||
inst = _instruction.iter();
|
inst = _instruction.iter();
|
||||||
intptr_t inst_num = (intptr_t)_operand_inst_num.iter();
|
int inst_num = (int) (intptr_t) _operand_inst_num.iter();
|
||||||
const char *inst_operand = _operand_op_name.iter();
|
const char* inst_operand = _operand_op_name.iter();
|
||||||
}
|
}
|
||||||
void PeepReplace::next_operand( intptr_t &inst_num, const char * &inst_operand ) {
|
void PeepReplace::next_operand(int &inst_num, const char* &inst_operand) {
|
||||||
const char *inst = _instruction.iter();
|
const char* inst = _instruction.iter();
|
||||||
inst_num = (intptr_t)_operand_inst_num.iter();
|
inst_num = (int) (intptr_t) _operand_inst_num.iter();
|
||||||
inst_operand = _operand_op_name.iter();
|
inst_operand = _operand_op_name.iter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -457,10 +457,10 @@ public:
|
|||||||
|
|
||||||
// Access info about instructions in the peep-match rule
|
// Access info about instructions in the peep-match rule
|
||||||
int max_position();
|
int max_position();
|
||||||
const char *instruction_name(intptr_t position);
|
const char *instruction_name(int position);
|
||||||
// Iterate through all info on matched instructions
|
// Iterate through all info on matched instructions
|
||||||
void reset();
|
void reset();
|
||||||
void next_instruction( intptr_t &parent, intptr_t &position, const char * &name, intptr_t &input );
|
void next_instruction(int &parent, int &position, const char* &name, int &input);
|
||||||
// 'true' if current position in iteration is a placeholder, not matched.
|
// 'true' if current position in iteration is a placeholder, not matched.
|
||||||
bool is_placeholder();
|
bool is_placeholder();
|
||||||
|
|
||||||
@ -474,20 +474,20 @@ private:
|
|||||||
PeepConstraint *_next; // Additional constraints ANDed together
|
PeepConstraint *_next; // Additional constraints ANDed together
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const intptr_t _left_inst;
|
const int _left_inst;
|
||||||
const char *_left_op;
|
const char* _left_op;
|
||||||
const char *_relation;
|
const char* _relation;
|
||||||
const intptr_t _right_inst;
|
const int _right_inst;
|
||||||
const char *_right_op;
|
const char* _right_op;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Public Methods
|
// Public Methods
|
||||||
PeepConstraint(intptr_t left_inst, char *left_op, char *relation,
|
PeepConstraint(int left_inst, char* left_op, char* relation,
|
||||||
intptr_t right_inst, char *right_op);
|
int right_inst, char* right_op);
|
||||||
~PeepConstraint();
|
~PeepConstraint();
|
||||||
|
|
||||||
// Check if constraints use instruction at position
|
// Check if constraints use instruction at position
|
||||||
bool constrains_instruction(intptr_t position);
|
bool constrains_instruction(int position);
|
||||||
|
|
||||||
// Add another constraint
|
// Add another constraint
|
||||||
void append(PeepConstraint *next_peep_constraint);
|
void append(PeepConstraint *next_peep_constraint);
|
||||||
@ -519,7 +519,7 @@ public:
|
|||||||
// Access contents of peepreplace
|
// Access contents of peepreplace
|
||||||
void reset();
|
void reset();
|
||||||
void next_instruction(const char * &root);
|
void next_instruction(const char * &root);
|
||||||
void next_operand( intptr_t &inst_num, const char * &inst_operand );
|
void next_operand(int &inst_num, const char * &inst_operand );
|
||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
void dump();
|
void dump();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -844,8 +844,12 @@ void InstructForm::build_components() {
|
|||||||
for (_parameters.reset(); (name = _parameters.iter()) != NULL;) {
|
for (_parameters.reset(); (name = _parameters.iter()) != NULL;) {
|
||||||
OperandForm *opForm = (OperandForm*)_localNames[name];
|
OperandForm *opForm = (OperandForm*)_localNames[name];
|
||||||
|
|
||||||
const Form *form = _effects[name];
|
Effect* e = NULL;
|
||||||
Effect *e = form ? form->is_effect() : NULL;
|
{
|
||||||
|
const Form* form = _effects[name];
|
||||||
|
e = form ? form->is_effect() : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (e != NULL) {
|
if (e != NULL) {
|
||||||
has_temp |= e->is(Component::TEMP);
|
has_temp |= e->is(Component::TEMP);
|
||||||
|
|
||||||
@ -1110,7 +1114,7 @@ bool InstructForm::cisc_spills_to(ArchDesc &AD, InstructForm *instr) {
|
|||||||
const char *op_name = NULL;
|
const char *op_name = NULL;
|
||||||
const char *reg_type = NULL;
|
const char *reg_type = NULL;
|
||||||
FormDict &globals = AD.globalNames();
|
FormDict &globals = AD.globalNames();
|
||||||
cisc_spill_operand = _matrule->cisc_spill_match(globals, AD.get_registers(), instr->_matrule, op_name, reg_type);
|
cisc_spill_operand = _matrule->matchrule_cisc_spill_match(globals, AD.get_registers(), instr->_matrule, op_name, reg_type);
|
||||||
if( (cisc_spill_operand != Not_cisc_spillable) && (op_name != NULL) && equivalent_predicates(this, instr) ) {
|
if( (cisc_spill_operand != Not_cisc_spillable) && (op_name != NULL) && equivalent_predicates(this, instr) ) {
|
||||||
cisc_spill_operand = operand_position(op_name, Component::USE);
|
cisc_spill_operand = operand_position(op_name, Component::USE);
|
||||||
int def_oper = operand_position(op_name, Component::DEF);
|
int def_oper = operand_position(op_name, Component::DEF);
|
||||||
@ -2194,7 +2198,7 @@ int OperandForm::operand_position(const char *name, int usedef) {
|
|||||||
// Return -1 if not in list.
|
// Return -1 if not in list.
|
||||||
int OperandForm::constant_position(FormDict &globals, const Component *last) {
|
int OperandForm::constant_position(FormDict &globals, const Component *last) {
|
||||||
// Iterate through components and count constants preceeding 'constant'
|
// Iterate through components and count constants preceeding 'constant'
|
||||||
uint position = 0;
|
int position = 0;
|
||||||
Component *comp;
|
Component *comp;
|
||||||
_components.reset();
|
_components.reset();
|
||||||
while( (comp = _components.iter()) != NULL && (comp != last) ) {
|
while( (comp = _components.iter()) != NULL && (comp != last) ) {
|
||||||
@ -2297,7 +2301,7 @@ void OperandForm::disp_is_oop(FILE *fp, FormDict &globals) {
|
|||||||
if ( op->is_base_constant(globals) == Form::idealP ) {
|
if ( op->is_base_constant(globals) == Form::idealP ) {
|
||||||
// Find the constant's index: _c0, _c1, _c2, ... , _cN
|
// Find the constant's index: _c0, _c1, _c2, ... , _cN
|
||||||
uint idx = op->constant_position( globals, rep_var);
|
uint idx = op->constant_position( globals, rep_var);
|
||||||
fprintf(fp," virtual bool disp_is_oop() const {", _ident);
|
fprintf(fp," virtual bool disp_is_oop() const {");
|
||||||
fprintf(fp, " return _c%d->isa_oop_ptr();", idx);
|
fprintf(fp, " return _c%d->isa_oop_ptr();", idx);
|
||||||
fprintf(fp, " }\n");
|
fprintf(fp, " }\n");
|
||||||
}
|
}
|
||||||
@ -3035,9 +3039,9 @@ bool MatchNode::find_type(const char *type, int &position) const {
|
|||||||
|
|
||||||
// Recursive call collecting info on top-level operands, not transitive.
|
// Recursive call collecting info on top-level operands, not transitive.
|
||||||
// Implementation does not modify state of internal structures.
|
// Implementation does not modify state of internal structures.
|
||||||
void MatchNode::append_components(FormDict &locals, ComponentList &components,
|
void MatchNode::append_components(FormDict& locals, ComponentList& components,
|
||||||
bool deflag) const {
|
bool def_flag) const {
|
||||||
int usedef = deflag ? Component::DEF : Component::USE;
|
int usedef = def_flag ? Component::DEF : Component::USE;
|
||||||
FormDict &globals = _AD.globalNames();
|
FormDict &globals = _AD.globalNames();
|
||||||
|
|
||||||
assert (_name != NULL, "MatchNode::build_components encountered empty node\n");
|
assert (_name != NULL, "MatchNode::build_components encountered empty node\n");
|
||||||
@ -3055,10 +3059,10 @@ void MatchNode::append_components(FormDict &locals, ComponentList &components,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Promote results of "Set" to DEF
|
// Promote results of "Set" to DEF
|
||||||
bool def_flag = (!strcmp(_opType, "Set")) ? true : false;
|
bool tmpdef_flag = (!strcmp(_opType, "Set")) ? true : false;
|
||||||
if (_lChild) _lChild->append_components(locals, components, def_flag);
|
if (_lChild) _lChild->append_components(locals, components, tmpdef_flag);
|
||||||
def_flag = false; // only applies to component immediately following 'Set'
|
tmpdef_flag = false; // only applies to component immediately following 'Set'
|
||||||
if (_rChild) _rChild->append_components(locals, components, def_flag);
|
if (_rChild) _rChild->append_components(locals, components, tmpdef_flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the n'th base-operand in the match node,
|
// Find the n'th base-operand in the match node,
|
||||||
@ -3404,9 +3408,9 @@ bool static root_ops_match(FormDict &globals, const char *op1, const char *op2)
|
|||||||
return (form1 == form2);
|
return (form1 == form2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------cisc_spill_match------------------------------------
|
//-------------------------cisc_spill_match_node-------------------------------
|
||||||
// Recursively check two MatchRules for legal conversion via cisc-spilling
|
// Recursively check two MatchRules for legal conversion via cisc-spilling
|
||||||
int MatchNode::cisc_spill_match(FormDict &globals, RegisterForm *registers, MatchNode *mRule2, const char * &operand, const char * ®_type) {
|
int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, MatchNode* mRule2, const char* &operand, const char* ®_type) {
|
||||||
int cisc_spillable = Maybe_cisc_spillable;
|
int cisc_spillable = Maybe_cisc_spillable;
|
||||||
int left_spillable = Maybe_cisc_spillable;
|
int left_spillable = Maybe_cisc_spillable;
|
||||||
int right_spillable = Maybe_cisc_spillable;
|
int right_spillable = Maybe_cisc_spillable;
|
||||||
@ -3480,13 +3484,13 @@ int MatchNode::cisc_spill_match(FormDict &globals, RegisterForm *registers, Mat
|
|||||||
return cisc_spillable;
|
return cisc_spillable;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------cisc_spill_match----------------------------------
|
//---------------------------cisc_spill_match_rule------------------------------
|
||||||
// Recursively check two MatchRules for legal conversion via cisc-spilling
|
// Recursively check two MatchRules for legal conversion via cisc-spilling
|
||||||
// This method handles the root of Match tree,
|
// This method handles the root of Match tree,
|
||||||
// general recursive checks done in MatchNode
|
// general recursive checks done in MatchNode
|
||||||
int MatchRule::cisc_spill_match(FormDict &globals, RegisterForm *registers,
|
int MatchRule::matchrule_cisc_spill_match(FormDict& globals, RegisterForm* registers,
|
||||||
MatchRule *mRule2, const char * &operand,
|
MatchRule* mRule2, const char* &operand,
|
||||||
const char * ®_type) {
|
const char* ®_type) {
|
||||||
int cisc_spillable = Maybe_cisc_spillable;
|
int cisc_spillable = Maybe_cisc_spillable;
|
||||||
int left_spillable = Maybe_cisc_spillable;
|
int left_spillable = Maybe_cisc_spillable;
|
||||||
int right_spillable = Maybe_cisc_spillable;
|
int right_spillable = Maybe_cisc_spillable;
|
||||||
@ -3524,7 +3528,7 @@ int MatchRule::cisc_spill_match(FormDict &globals, RegisterForm *registers,
|
|||||||
//----------------------------- equivalent ------------------------------------
|
//----------------------------- equivalent ------------------------------------
|
||||||
// Recursively check to see if two match rules are equivalent.
|
// Recursively check to see if two match rules are equivalent.
|
||||||
// This rule handles the root.
|
// This rule handles the root.
|
||||||
bool MatchRule::equivalent(FormDict &globals, MatchRule *mRule2) {
|
bool MatchRule::equivalent(FormDict &globals, MatchNode *mRule2) {
|
||||||
// Check that each sets a result
|
// Check that each sets a result
|
||||||
if (sets_result() != mRule2->sets_result()) {
|
if (sets_result() != mRule2->sets_result()) {
|
||||||
return false;
|
return false;
|
||||||
@ -3640,7 +3644,7 @@ void MatchNode::swap_commutative_op(bool atroot, int id) {
|
|||||||
|
|
||||||
//-------------------------- swap_commutative_op ------------------------------
|
//-------------------------- swap_commutative_op ------------------------------
|
||||||
// Recursively swap specified commutative operation with subtree operands.
|
// Recursively swap specified commutative operation with subtree operands.
|
||||||
void MatchRule::swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt) {
|
void MatchRule::matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt) {
|
||||||
assert(match_rules_cnt < 100," too many match rule clones");
|
assert(match_rules_cnt < 100," too many match rule clones");
|
||||||
// Clone
|
// Clone
|
||||||
MatchRule* clone = new MatchRule(_AD, this);
|
MatchRule* clone = new MatchRule(_AD, this);
|
||||||
@ -3653,8 +3657,8 @@ void MatchRule::swap_commutative_op(const char* instr_ident, int count, int& mat
|
|||||||
clone->_next = this->_next;
|
clone->_next = this->_next;
|
||||||
this-> _next = clone;
|
this-> _next = clone;
|
||||||
if( (--count) > 0 ) {
|
if( (--count) > 0 ) {
|
||||||
this-> swap_commutative_op(instr_ident, count, match_rules_cnt);
|
this-> matchrule_swap_commutative_op(instr_ident, count, match_rules_cnt);
|
||||||
clone->swap_commutative_op(instr_ident, count, match_rules_cnt);
|
clone->matchrule_swap_commutative_op(instr_ident, count, match_rules_cnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3686,7 +3690,7 @@ MatchRule::~MatchRule() {
|
|||||||
|
|
||||||
// Recursive call collecting info on top-level operands, not transitive.
|
// Recursive call collecting info on top-level operands, not transitive.
|
||||||
// Implementation does not modify state of internal structures.
|
// Implementation does not modify state of internal structures.
|
||||||
void MatchRule::append_components(FormDict &locals, ComponentList &components) const {
|
void MatchRule::append_components(FormDict& locals, ComponentList& components, bool def_flag) const {
|
||||||
assert (_name != NULL, "MatchNode::build_components encountered empty node\n");
|
assert (_name != NULL, "MatchNode::build_components encountered empty node\n");
|
||||||
|
|
||||||
MatchNode::append_components(locals, components,
|
MatchNode::append_components(locals, components,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -920,8 +920,8 @@ public:
|
|||||||
// return 1 if found and position is incremented by operand offset in rule
|
// return 1 if found and position is incremented by operand offset in rule
|
||||||
bool find_name(const char *str, int &position) const;
|
bool find_name(const char *str, int &position) const;
|
||||||
bool find_type(const char *str, int &position) const;
|
bool find_type(const char *str, int &position) const;
|
||||||
void append_components(FormDict &locals, ComponentList &components,
|
virtual void append_components(FormDict& locals, ComponentList& components,
|
||||||
bool def_flag) const;
|
bool def_flag = false) const;
|
||||||
bool base_operand(uint &position, FormDict &globals,
|
bool base_operand(uint &position, FormDict &globals,
|
||||||
const char * &result, const char * &name,
|
const char * &result, const char * &name,
|
||||||
const char * &opType) const;
|
const char * &opType) const;
|
||||||
@ -947,12 +947,12 @@ public:
|
|||||||
const char *reduce_left (FormDict &globals) const;
|
const char *reduce_left (FormDict &globals) const;
|
||||||
|
|
||||||
// Recursive version of check in MatchRule
|
// Recursive version of check in MatchRule
|
||||||
int cisc_spill_match(FormDict &globals, RegisterForm *registers,
|
int cisc_spill_match(FormDict& globals, RegisterForm* registers,
|
||||||
MatchNode *mRule2, const char * &operand,
|
MatchNode* mRule2, const char* &operand,
|
||||||
const char * ®_type);
|
const char* ®_type);
|
||||||
int cisc_spill_merge(int left_result, int right_result);
|
int cisc_spill_merge(int left_result, int right_result);
|
||||||
|
|
||||||
bool equivalent(FormDict &globals, MatchNode *mNode2);
|
virtual bool equivalent(FormDict& globals, MatchNode* mNode2);
|
||||||
|
|
||||||
void count_commutative_op(int& count);
|
void count_commutative_op(int& count);
|
||||||
void swap_commutative_op(bool atroot, int count);
|
void swap_commutative_op(bool atroot, int count);
|
||||||
@ -979,7 +979,7 @@ public:
|
|||||||
MatchRule(ArchDesc &ad, MatchNode* mroot, int depth, char* construct, int numleaves);
|
MatchRule(ArchDesc &ad, MatchNode* mroot, int depth, char* construct, int numleaves);
|
||||||
~MatchRule();
|
~MatchRule();
|
||||||
|
|
||||||
void append_components(FormDict &locals, ComponentList &components) const;
|
virtual void append_components(FormDict& locals, ComponentList& components, bool def_flag = false) const;
|
||||||
// Recursive call on all operands' match rules in my match rule.
|
// Recursive call on all operands' match rules in my match rule.
|
||||||
bool base_operand(uint &position, FormDict &globals,
|
bool base_operand(uint &position, FormDict &globals,
|
||||||
const char * &result, const char * &name,
|
const char * &result, const char * &name,
|
||||||
@ -1006,14 +1006,14 @@ public:
|
|||||||
Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode'
|
Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode'
|
||||||
|
|
||||||
// Check if 'mRule2' is a cisc-spill variant of this MatchRule
|
// Check if 'mRule2' is a cisc-spill variant of this MatchRule
|
||||||
int cisc_spill_match(FormDict &globals, RegisterForm *registers,
|
int matchrule_cisc_spill_match(FormDict &globals, RegisterForm* registers,
|
||||||
MatchRule *mRule2, const char * &operand,
|
MatchRule* mRule2, const char* &operand,
|
||||||
const char * ®_type);
|
const char* ®_type);
|
||||||
|
|
||||||
// Check if 'mRule2' is equivalent to this MatchRule
|
// Check if 'mRule2' is equivalent to this MatchRule
|
||||||
bool equivalent(FormDict &globals, MatchRule *mRule2);
|
virtual bool equivalent(FormDict& globals, MatchNode* mRule2);
|
||||||
|
|
||||||
void swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt);
|
void matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt);
|
||||||
|
|
||||||
void dump();
|
void dump();
|
||||||
void output(FILE *fp);
|
void output(FILE *fp);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -349,7 +349,7 @@ void ArchDesc::close_files(int delete_out)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (_ADL_file._name) printf("%s --> ", _ADL_file._name);
|
if (_ADL_file._name) printf("%s --> ", _ADL_file._name);
|
||||||
printf("%s, %s, %s, %s, %s, %s, %s, %s, %s",
|
printf("%s, %s, %s, %s, %s, %s, %s, %s, %s, %s",
|
||||||
_CPP_file._name,
|
_CPP_file._name,
|
||||||
_CPP_CLONE_file._name,
|
_CPP_CLONE_file._name,
|
||||||
_CPP_EXPAND_file._name,
|
_CPP_EXPAND_file._name,
|
||||||
@ -358,7 +358,8 @@ void ArchDesc::close_files(int delete_out)
|
|||||||
_CPP_MISC_file._name,
|
_CPP_MISC_file._name,
|
||||||
_CPP_PEEPHOLE_file._name,
|
_CPP_PEEPHOLE_file._name,
|
||||||
_CPP_PIPELINE_file._name,
|
_CPP_PIPELINE_file._name,
|
||||||
_HPP_file._name, _DFA_file._name);
|
_HPP_file._name,
|
||||||
|
_DFA_file._name);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
@ -431,7 +432,7 @@ int get_legal_text(FileBuff &fbuf, char **legal_text)
|
|||||||
legal_end = fbuf.get_line();
|
legal_end = fbuf.get_line();
|
||||||
}
|
}
|
||||||
*legal_text = legal_start;
|
*legal_text = legal_start;
|
||||||
return (legal_end - legal_start);
|
return (int) (legal_end - legal_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
// VS2005 has its own definition, identical to this one.
|
// VS2005 has its own definition, identical to this one.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -225,11 +225,11 @@ static int pipeline_reads_initializer(FILE *fp_cpp, NameList &pipeline_reads, Pi
|
|||||||
pipeclass->_parameters.reset();
|
pipeclass->_parameters.reset();
|
||||||
|
|
||||||
while ( (paramname = pipeclass->_parameters.iter()) != NULL ) {
|
while ( (paramname = pipeclass->_parameters.iter()) != NULL ) {
|
||||||
const PipeClassOperandForm *pipeopnd =
|
const PipeClassOperandForm *tmppipeopnd =
|
||||||
(const PipeClassOperandForm *)pipeclass->_localUsage[paramname];
|
(const PipeClassOperandForm *)pipeclass->_localUsage[paramname];
|
||||||
|
|
||||||
if (pipeopnd)
|
if (tmppipeopnd)
|
||||||
templen += 10 + (int)strlen(pipeopnd->_stage);
|
templen += 10 + (int)strlen(tmppipeopnd->_stage);
|
||||||
else
|
else
|
||||||
templen += 19;
|
templen += 19;
|
||||||
|
|
||||||
@ -253,10 +253,10 @@ static int pipeline_reads_initializer(FILE *fp_cpp, NameList &pipeline_reads, Pi
|
|||||||
pipeclass->_parameters.reset();
|
pipeclass->_parameters.reset();
|
||||||
|
|
||||||
while ( (paramname = pipeclass->_parameters.iter()) != NULL ) {
|
while ( (paramname = pipeclass->_parameters.iter()) != NULL ) {
|
||||||
const PipeClassOperandForm *pipeopnd =
|
const PipeClassOperandForm *tmppipeopnd =
|
||||||
(const PipeClassOperandForm *)pipeclass->_localUsage[paramname];
|
(const PipeClassOperandForm *)pipeclass->_localUsage[paramname];
|
||||||
templen += sprintf(&operand_stages[templen], " stage_%s%c\n",
|
templen += sprintf(&operand_stages[templen], " stage_%s%c\n",
|
||||||
pipeopnd ? pipeopnd->_stage : "undefined",
|
tmppipeopnd ? tmppipeopnd->_stage : "undefined",
|
||||||
(++i < paramcount ? ',' : ' ') );
|
(++i < paramcount ? ',' : ' ') );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1042,10 +1042,10 @@ static void defineOut_RegMask(FILE *fp, const char *node, const char *regMask) {
|
|||||||
|
|
||||||
// Scan the peepmatch and output a test for each instruction
|
// Scan the peepmatch and output a test for each instruction
|
||||||
static void check_peepmatch_instruction_tree(FILE *fp, PeepMatch *pmatch, PeepConstraint *pconstraint) {
|
static void check_peepmatch_instruction_tree(FILE *fp, PeepMatch *pmatch, PeepConstraint *pconstraint) {
|
||||||
intptr_t parent = -1;
|
int parent = -1;
|
||||||
intptr_t inst_position = 0;
|
int inst_position = 0;
|
||||||
const char *inst_name = NULL;
|
const char* inst_name = NULL;
|
||||||
intptr_t input = 0;
|
int input = 0;
|
||||||
fprintf(fp, " // Check instruction sub-tree\n");
|
fprintf(fp, " // Check instruction sub-tree\n");
|
||||||
pmatch->reset();
|
pmatch->reset();
|
||||||
for( pmatch->next_instruction( parent, inst_position, inst_name, input );
|
for( pmatch->next_instruction( parent, inst_position, inst_name, input );
|
||||||
@ -1055,14 +1055,14 @@ static void check_peepmatch_instruction_tree(FILE *fp, PeepMatch *pmatch, PeepCo
|
|||||||
if( ! pmatch->is_placeholder() ) {
|
if( ! pmatch->is_placeholder() ) {
|
||||||
// Define temporaries 'inst#', based on parent and parent's input index
|
// Define temporaries 'inst#', based on parent and parent's input index
|
||||||
if( parent != -1 ) { // root was initialized
|
if( parent != -1 ) { // root was initialized
|
||||||
fprintf(fp, " inst%ld = inst%ld->in(%ld);\n",
|
fprintf(fp, " inst%d = inst%d->in(%d);\n",
|
||||||
inst_position, parent, input);
|
inst_position, parent, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
// When not the root
|
// When not the root
|
||||||
// Test we have the correct instruction by comparing the rule
|
// Test we have the correct instruction by comparing the rule
|
||||||
if( parent != -1 ) {
|
if( parent != -1 ) {
|
||||||
fprintf(fp, " matches = matches && ( inst%ld->rule() == %s_rule );",
|
fprintf(fp, " matches = matches && ( inst%d->rule() == %s_rule );",
|
||||||
inst_position, inst_name);
|
inst_position, inst_name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1073,20 +1073,20 @@ static void check_peepmatch_instruction_tree(FILE *fp, PeepMatch *pmatch, PeepCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_block_index(FILE *fp, intptr_t inst_position) {
|
static void print_block_index(FILE *fp, int inst_position) {
|
||||||
assert( inst_position >= 0, "Instruction number less than zero");
|
assert( inst_position >= 0, "Instruction number less than zero");
|
||||||
fprintf(fp, "block_index");
|
fprintf(fp, "block_index");
|
||||||
if( inst_position != 0 ) {
|
if( inst_position != 0 ) {
|
||||||
fprintf(fp, " - %ld", inst_position);
|
fprintf(fp, " - %d", inst_position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan the peepmatch and output a test for each instruction
|
// Scan the peepmatch and output a test for each instruction
|
||||||
static void check_peepmatch_instruction_sequence(FILE *fp, PeepMatch *pmatch, PeepConstraint *pconstraint) {
|
static void check_peepmatch_instruction_sequence(FILE *fp, PeepMatch *pmatch, PeepConstraint *pconstraint) {
|
||||||
intptr_t parent = -1;
|
int parent = -1;
|
||||||
intptr_t inst_position = 0;
|
int inst_position = 0;
|
||||||
const char *inst_name = NULL;
|
const char* inst_name = NULL;
|
||||||
intptr_t input = 0;
|
int input = 0;
|
||||||
fprintf(fp, " // Check instruction sub-tree\n");
|
fprintf(fp, " // Check instruction sub-tree\n");
|
||||||
pmatch->reset();
|
pmatch->reset();
|
||||||
for( pmatch->next_instruction( parent, inst_position, inst_name, input );
|
for( pmatch->next_instruction( parent, inst_position, inst_name, input );
|
||||||
@ -1101,14 +1101,14 @@ static void check_peepmatch_instruction_sequence(FILE *fp, PeepMatch *pmatch, Pe
|
|||||||
print_block_index(fp, inst_position);
|
print_block_index(fp, inst_position);
|
||||||
fprintf(fp, " > 0 ) {\n Node *n = block->_nodes.at(");
|
fprintf(fp, " > 0 ) {\n Node *n = block->_nodes.at(");
|
||||||
print_block_index(fp, inst_position);
|
print_block_index(fp, inst_position);
|
||||||
fprintf(fp, ");\n inst%ld = (n->is_Mach()) ? ", inst_position);
|
fprintf(fp, ");\n inst%d = (n->is_Mach()) ? ", inst_position);
|
||||||
fprintf(fp, "n->as_Mach() : NULL;\n }\n");
|
fprintf(fp, "n->as_Mach() : NULL;\n }\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// When not the root
|
// When not the root
|
||||||
// Test we have the correct instruction by comparing the rule.
|
// Test we have the correct instruction by comparing the rule.
|
||||||
if( parent != -1 ) {
|
if( parent != -1 ) {
|
||||||
fprintf(fp, " matches = matches && (inst%ld != NULL) && (inst%ld->rule() == %s_rule);\n",
|
fprintf(fp, " matches = matches && (inst%d != NULL) && (inst%d->rule() == %s_rule);\n",
|
||||||
inst_position, inst_position, inst_name);
|
inst_position, inst_position, inst_name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1121,10 +1121,10 @@ static void check_peepmatch_instruction_sequence(FILE *fp, PeepMatch *pmatch, Pe
|
|||||||
|
|
||||||
// Build mapping for register indices, num_edges to input
|
// Build mapping for register indices, num_edges to input
|
||||||
static void build_instruction_index_mapping( FILE *fp, FormDict &globals, PeepMatch *pmatch ) {
|
static void build_instruction_index_mapping( FILE *fp, FormDict &globals, PeepMatch *pmatch ) {
|
||||||
intptr_t parent = -1;
|
int parent = -1;
|
||||||
intptr_t inst_position = 0;
|
int inst_position = 0;
|
||||||
const char *inst_name = NULL;
|
const char* inst_name = NULL;
|
||||||
intptr_t input = 0;
|
int input = 0;
|
||||||
fprintf(fp, " // Build map to register info\n");
|
fprintf(fp, " // Build map to register info\n");
|
||||||
pmatch->reset();
|
pmatch->reset();
|
||||||
for( pmatch->next_instruction( parent, inst_position, inst_name, input );
|
for( pmatch->next_instruction( parent, inst_position, inst_name, input );
|
||||||
@ -1136,9 +1136,9 @@ static void build_instruction_index_mapping( FILE *fp, FormDict &globals, PeepMa
|
|||||||
InstructForm *inst = globals[inst_name]->is_instruction();
|
InstructForm *inst = globals[inst_name]->is_instruction();
|
||||||
if( inst != NULL ) {
|
if( inst != NULL ) {
|
||||||
char inst_prefix[] = "instXXXX_";
|
char inst_prefix[] = "instXXXX_";
|
||||||
sprintf(inst_prefix, "inst%ld_", inst_position);
|
sprintf(inst_prefix, "inst%d_", inst_position);
|
||||||
char receiver[] = "instXXXX->";
|
char receiver[] = "instXXXX->";
|
||||||
sprintf(receiver, "inst%ld->", inst_position);
|
sprintf(receiver, "inst%d->", inst_position);
|
||||||
inst->index_temps( fp, globals, inst_prefix, receiver );
|
inst->index_temps( fp, globals, inst_prefix, receiver );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1168,7 +1168,7 @@ static void check_peepconstraints(FILE *fp, FormDict &globals, PeepMatch *pmatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LEFT
|
// LEFT
|
||||||
intptr_t left_index = pconstraint->_left_inst;
|
int left_index = pconstraint->_left_inst;
|
||||||
const char *left_op = pconstraint->_left_op;
|
const char *left_op = pconstraint->_left_op;
|
||||||
// Access info on the instructions whose operands are compared
|
// Access info on the instructions whose operands are compared
|
||||||
InstructForm *inst_left = globals[pmatch->instruction_name(left_index)]->is_instruction();
|
InstructForm *inst_left = globals[pmatch->instruction_name(left_index)]->is_instruction();
|
||||||
@ -1191,7 +1191,7 @@ static void check_peepconstraints(FILE *fp, FormDict &globals, PeepMatch *pmatch
|
|||||||
|
|
||||||
// RIGHT
|
// RIGHT
|
||||||
int right_op_index = -1;
|
int right_op_index = -1;
|
||||||
intptr_t right_index = pconstraint->_right_inst;
|
int right_index = pconstraint->_right_inst;
|
||||||
const char *right_op = pconstraint->_right_op;
|
const char *right_op = pconstraint->_right_op;
|
||||||
if( right_index != -1 ) { // Match operand
|
if( right_index != -1 ) { // Match operand
|
||||||
// Access info on the instructions whose operands are compared
|
// Access info on the instructions whose operands are compared
|
||||||
@ -1351,7 +1351,7 @@ static void generate_peepreplace( FILE *fp, FormDict &globals, PeepMatch *pmatch
|
|||||||
assert( root_form != NULL, "Replacement instruction was not previously defined");
|
assert( root_form != NULL, "Replacement instruction was not previously defined");
|
||||||
fprintf(fp, " %sNode *root = new (C) %sNode();\n", root_inst, root_inst);
|
fprintf(fp, " %sNode *root = new (C) %sNode();\n", root_inst, root_inst);
|
||||||
|
|
||||||
intptr_t inst_num;
|
int inst_num;
|
||||||
const char *op_name;
|
const char *op_name;
|
||||||
int opnds_index = 0; // define result operand
|
int opnds_index = 0; // define result operand
|
||||||
// Then install the use-operands for the new sub-tree
|
// Then install the use-operands for the new sub-tree
|
||||||
@ -1362,7 +1362,6 @@ static void generate_peepreplace( FILE *fp, FormDict &globals, PeepMatch *pmatch
|
|||||||
InstructForm *inst_form;
|
InstructForm *inst_form;
|
||||||
inst_form = globals[pmatch->instruction_name(inst_num)]->is_instruction();
|
inst_form = globals[pmatch->instruction_name(inst_num)]->is_instruction();
|
||||||
assert( inst_form, "Parser should guaranty this is an instruction");
|
assert( inst_form, "Parser should guaranty this is an instruction");
|
||||||
int op_base = inst_form->oper_input_base(globals);
|
|
||||||
int inst_op_num = inst_form->operand_position(op_name, Component::USE);
|
int inst_op_num = inst_form->operand_position(op_name, Component::USE);
|
||||||
if( inst_op_num == NameList::Not_in_list )
|
if( inst_op_num == NameList::Not_in_list )
|
||||||
inst_op_num = inst_form->operand_position(op_name, Component::USE_DEF);
|
inst_op_num = inst_form->operand_position(op_name, Component::USE_DEF);
|
||||||
@ -1379,32 +1378,32 @@ static void generate_peepreplace( FILE *fp, FormDict &globals, PeepMatch *pmatch
|
|||||||
// Add unmatched edges from root of match tree
|
// Add unmatched edges from root of match tree
|
||||||
int op_base = root_form->oper_input_base(globals);
|
int op_base = root_form->oper_input_base(globals);
|
||||||
for( int unmatched_edge = 1; unmatched_edge < op_base; ++unmatched_edge ) {
|
for( int unmatched_edge = 1; unmatched_edge < op_base; ++unmatched_edge ) {
|
||||||
fprintf(fp, " root->add_req(inst%ld->in(%d)); // unmatched ideal edge\n",
|
fprintf(fp, " root->add_req(inst%d->in(%d)); // unmatched ideal edge\n",
|
||||||
inst_num, unmatched_edge);
|
inst_num, unmatched_edge);
|
||||||
}
|
}
|
||||||
// If new instruction captures bottom type
|
// If new instruction captures bottom type
|
||||||
if( root_form->captures_bottom_type() ) {
|
if( root_form->captures_bottom_type() ) {
|
||||||
// Get bottom type from instruction whose result we are replacing
|
// Get bottom type from instruction whose result we are replacing
|
||||||
fprintf(fp, " root->_bottom_type = inst%ld->bottom_type();\n", inst_num);
|
fprintf(fp, " root->_bottom_type = inst%d->bottom_type();\n", inst_num);
|
||||||
}
|
}
|
||||||
// Define result register and result operand
|
// Define result register and result operand
|
||||||
fprintf(fp, " ra_->add_reference(root, inst%ld);\n", inst_num);
|
fprintf(fp, " ra_->add_reference(root, inst%d);\n", inst_num);
|
||||||
fprintf(fp, " ra_->set_oop (root, ra_->is_oop(inst%ld));\n", inst_num);
|
fprintf(fp, " ra_->set_oop (root, ra_->is_oop(inst%d));\n", inst_num);
|
||||||
fprintf(fp, " ra_->set_pair(root->_idx, ra_->get_reg_second(inst%ld), ra_->get_reg_first(inst%ld));\n", inst_num, inst_num);
|
fprintf(fp, " ra_->set_pair(root->_idx, ra_->get_reg_second(inst%d), ra_->get_reg_first(inst%d));\n", inst_num, inst_num);
|
||||||
fprintf(fp, " root->_opnds[0] = inst%ld->_opnds[0]->clone(C); // result\n", inst_num);
|
fprintf(fp, " root->_opnds[0] = inst%d->_opnds[0]->clone(C); // result\n", inst_num);
|
||||||
fprintf(fp, " // ----- Done with initial setup -----\n");
|
fprintf(fp, " // ----- Done with initial setup -----\n");
|
||||||
} else {
|
} else {
|
||||||
if( (op_form == NULL) || (op_form->is_base_constant(globals) == Form::none) ) {
|
if( (op_form == NULL) || (op_form->is_base_constant(globals) == Form::none) ) {
|
||||||
// Do not have ideal edges for constants after matching
|
// Do not have ideal edges for constants after matching
|
||||||
fprintf(fp, " for( unsigned x%d = inst%ld_idx%d; x%d < inst%ld_idx%d; x%d++ )\n",
|
fprintf(fp, " for( unsigned x%d = inst%d_idx%d; x%d < inst%d_idx%d; x%d++ )\n",
|
||||||
inst_op_num, inst_num, inst_op_num,
|
inst_op_num, inst_num, inst_op_num,
|
||||||
inst_op_num, inst_num, inst_op_num+1, inst_op_num );
|
inst_op_num, inst_num, inst_op_num+1, inst_op_num );
|
||||||
fprintf(fp, " root->add_req( inst%ld->in(x%d) );\n",
|
fprintf(fp, " root->add_req( inst%d->in(x%d) );\n",
|
||||||
inst_num, inst_op_num );
|
inst_num, inst_op_num );
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, " // no ideal edge for constants after matching\n");
|
fprintf(fp, " // no ideal edge for constants after matching\n");
|
||||||
}
|
}
|
||||||
fprintf(fp, " root->_opnds[%d] = inst%ld->_opnds[%d]->clone(C);\n",
|
fprintf(fp, " root->_opnds[%d] = inst%d->_opnds[%d]->clone(C);\n",
|
||||||
opnds_index, inst_num, inst_op_num );
|
opnds_index, inst_num, inst_op_num );
|
||||||
}
|
}
|
||||||
++opnds_index;
|
++opnds_index;
|
||||||
@ -1443,7 +1442,7 @@ void ArchDesc::definePeephole(FILE *fp, InstructForm *node) {
|
|||||||
}
|
}
|
||||||
for( int i = 0; i <= max_position; ++i ) {
|
for( int i = 0; i <= max_position; ++i ) {
|
||||||
if( i == 0 ) {
|
if( i == 0 ) {
|
||||||
fprintf(fp, " MachNode *inst0 = this;\n", i);
|
fprintf(fp, " MachNode *inst0 = this;\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, " MachNode *inst%d = NULL;\n", i);
|
fprintf(fp, " MachNode *inst%d = NULL;\n", i);
|
||||||
}
|
}
|
||||||
@ -1743,7 +1742,7 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
|
|||||||
}
|
}
|
||||||
// delete the rest of edges
|
// delete the rest of edges
|
||||||
fprintf(fp," for(int i = idx%d - 1; i >= (int)idx%d; i--) {\n", cur_num_opnds, new_num_opnds);
|
fprintf(fp," for(int i = idx%d - 1; i >= (int)idx%d; i--) {\n", cur_num_opnds, new_num_opnds);
|
||||||
fprintf(fp," del_req(i);\n", i);
|
fprintf(fp," del_req(i);\n");
|
||||||
fprintf(fp," }\n");
|
fprintf(fp," }\n");
|
||||||
fprintf(fp," _num_opnds = %d;\n", new_num_opnds);
|
fprintf(fp," _num_opnds = %d;\n", new_num_opnds);
|
||||||
}
|
}
|
||||||
@ -1817,7 +1816,7 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
|
|||||||
|
|
||||||
fprintf(fp,"\n");
|
fprintf(fp,"\n");
|
||||||
if( node->expands() ) {
|
if( node->expands() ) {
|
||||||
fprintf(fp," return result;\n",cnt-1);
|
fprintf(fp," return result;\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp," return this;\n");
|
fprintf(fp," return this;\n");
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -1832,7 +1832,7 @@ void ArchDesc::declareClasses(FILE *fp) {
|
|||||||
break;
|
break;
|
||||||
case Form::idealP:
|
case Form::idealP:
|
||||||
case Form::idealN:
|
case Form::idealN:
|
||||||
fprintf(fp," return opnd_array(1)->type();\n",result);
|
fprintf(fp," return opnd_array(1)->type();\n");
|
||||||
break;
|
break;
|
||||||
case Form::idealD:
|
case Form::idealD:
|
||||||
fprintf(fp," return TypeD::make(opnd_array(1)->constantD());\n");
|
fprintf(fp," return TypeD::make(opnd_array(1)->constantD());\n");
|
||||||
|
@ -474,6 +474,7 @@ cardTableModRefBS.cpp java.hpp
|
|||||||
cardTableModRefBS.cpp mutexLocker.hpp
|
cardTableModRefBS.cpp mutexLocker.hpp
|
||||||
cardTableModRefBS.cpp sharedHeap.hpp
|
cardTableModRefBS.cpp sharedHeap.hpp
|
||||||
cardTableModRefBS.cpp space.hpp
|
cardTableModRefBS.cpp space.hpp
|
||||||
|
cardTableModRefBS.cpp space.inline.hpp
|
||||||
cardTableModRefBS.cpp universe.hpp
|
cardTableModRefBS.cpp universe.hpp
|
||||||
cardTableModRefBS.cpp virtualspace.hpp
|
cardTableModRefBS.cpp virtualspace.hpp
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -306,7 +306,7 @@ void VMError::report(outputStream* st) {
|
|||||||
|
|
||||||
strncpy(buf, file, buflen);
|
strncpy(buf, file, buflen);
|
||||||
if (len + 10 < buflen) {
|
if (len + 10 < buflen) {
|
||||||
sprintf(buf + len, ":" SIZE_FORMAT, _lineno);
|
sprintf(buf + len, ":%d", _lineno);
|
||||||
}
|
}
|
||||||
st->print(" (%s)", buf);
|
st->print(" (%s)", buf);
|
||||||
} else {
|
} else {
|
||||||
@ -420,7 +420,7 @@ void VMError::report(outputStream* st) {
|
|||||||
|
|
||||||
if (fr.sp()) {
|
if (fr.sp()) {
|
||||||
st->print(", sp=" PTR_FORMAT, fr.sp());
|
st->print(", sp=" PTR_FORMAT, fr.sp());
|
||||||
st->print(", free space=%dk",
|
st->print(", free space=%" INTPTR_FORMAT "k",
|
||||||
((intptr_t)fr.sp() - (intptr_t)stack_bottom) >> 10);
|
((intptr_t)fr.sp() - (intptr_t)stack_bottom) >> 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -50,7 +50,7 @@ class VMError : public StackObj {
|
|||||||
|
|
||||||
// additional info for VM internal errors
|
// additional info for VM internal errors
|
||||||
const char * _filename;
|
const char * _filename;
|
||||||
size_t _lineno;
|
int _lineno;
|
||||||
|
|
||||||
// used by fatal error handler
|
// used by fatal error handler
|
||||||
int _current_step;
|
int _current_step;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user