mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8207049: Minor improvements of compiler code
Reviewed-by: kvn, mdoerr
This commit is contained in:
parent
f508eb1370
commit
2e682fa3cd
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2011, 2018, 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
|
||||
@ -1444,6 +1444,7 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen) {
|
||||
case Op_CMoveVF:
|
||||
if (vlen != 8)
|
||||
ret_value = false;
|
||||
break;
|
||||
case Op_CMoveVD:
|
||||
if (vlen != 4)
|
||||
ret_value = false;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 1997, 2018, 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
|
||||
@ -543,14 +543,18 @@ void ArchDesc::buildMList(MatchNode *node, const char *rootOp,
|
||||
}
|
||||
|
||||
// Identify index position among ideal operands
|
||||
intptr_t index = _last_opcode;
|
||||
const char *indexStr = node ? node->_opType : (char *) " ";
|
||||
index = (intptr_t)_idealIndex[indexStr];
|
||||
intptr_t index = _last_opcode;
|
||||
const char *indexStr = node ? node->_opType : (char *) " ";
|
||||
index = (intptr_t)_idealIndex[indexStr];
|
||||
if (index == 0) {
|
||||
fprintf(stderr, "error: operand \"%s\" not found\n", indexStr);
|
||||
assert(0, "fatal error");
|
||||
}
|
||||
|
||||
if (node == NULL) {
|
||||
fprintf(stderr, "error: node is NULL\n");
|
||||
assert(0, "fatal error");
|
||||
}
|
||||
// Build MatchLists for children
|
||||
// Check each child for an internal operand name, and use that name
|
||||
// for the parent's matchlist entry if it exists
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2018, 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
|
||||
@ -43,7 +43,7 @@ void Chunk::chop() {
|
||||
while( k ) {
|
||||
Chunk *tmp = k->_next;
|
||||
// clear out this chunk (to detect allocation bugs)
|
||||
memset(k, 0xBAADBABE, k->_len);
|
||||
memset(k, 0xBE, k->_len);
|
||||
free(k); // Free chunk (was malloc'd)
|
||||
k = tmp;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, 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
|
||||
@ -502,9 +502,11 @@ class dfa_shared_preds {
|
||||
case '"': // such as: #line 10 "myfile.ad"\n mypredicate
|
||||
return true;
|
||||
case '|':
|
||||
if( prev != pred && *(prev-1) == '|' ) return true;
|
||||
if (prev != pred && *(prev-1) == '|') return true;
|
||||
break;
|
||||
case '&':
|
||||
if( prev != pred && *(prev-1) == '&' ) return true;
|
||||
if (prev != pred && *(prev-1) == '&') return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -717,21 +719,21 @@ const char *Expr::compute_external(const Expr *c1, const Expr *c2) {
|
||||
|
||||
// Preserve use of external name which has a zero value
|
||||
if( c1->_external_name != NULL ) {
|
||||
sprintf( string_buffer, "%s", c1->as_string());
|
||||
sprintf(string_buffer, "%s", c1->as_string());
|
||||
if( !c2->is_zero() ) {
|
||||
strcat( string_buffer, "+");
|
||||
strcat( string_buffer, c2->as_string());
|
||||
strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
|
||||
strncat(string_buffer, c2->as_string(), STRING_BUFFER_LENGTH);
|
||||
}
|
||||
result = strdup(string_buffer);
|
||||
}
|
||||
else if( c2->_external_name != NULL ) {
|
||||
if( !c1->is_zero() ) {
|
||||
sprintf( string_buffer, "%s", c1->as_string());
|
||||
strcat( string_buffer, " + ");
|
||||
sprintf(string_buffer, "%s", c1->as_string());
|
||||
strncat(string_buffer, " + ", STRING_BUFFER_LENGTH);
|
||||
} else {
|
||||
string_buffer[0] = '\0';
|
||||
}
|
||||
strcat( string_buffer, c2->_external_name );
|
||||
strncat(string_buffer, c2->_external_name, STRING_BUFFER_LENGTH);
|
||||
result = strdup(string_buffer);
|
||||
}
|
||||
return result;
|
||||
@ -741,8 +743,8 @@ const char *Expr::compute_expr(const Expr *c1, const Expr *c2) {
|
||||
if( !c1->is_zero() ) {
|
||||
sprintf( string_buffer, "%s", c1->_expr);
|
||||
if( !c2->is_zero() ) {
|
||||
strcat( string_buffer, "+");
|
||||
strcat( string_buffer, c2->_expr);
|
||||
strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
|
||||
strncat(string_buffer, c2->_expr, STRING_BUFFER_LENGTH);
|
||||
}
|
||||
}
|
||||
else if( !c2->is_zero() ) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, 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
|
||||
@ -95,8 +95,11 @@ void FileBuff::file_error(int flag, int linenum, const char *fmt, ...)
|
||||
va_start(args, fmt);
|
||||
switch (flag) {
|
||||
case 0: _AD._warnings += _AD.emit_msg(0, flag, linenum, fmt, args);
|
||||
break;
|
||||
case 1: _AD._syntax_errs += _AD.emit_msg(0, flag, linenum, fmt, args);
|
||||
break;
|
||||
case 2: _AD._semantic_errs += _AD.emit_msg(0, flag, linenum, fmt, args);
|
||||
break;
|
||||
default: assert(0, ""); break;
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2018, 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
|
||||
@ -3634,7 +3634,7 @@ int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, Matc
|
||||
&& (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory)
|
||||
&& (name_left != NULL) // NOT (load)
|
||||
&& (name_right == NULL) ) { // NOT (load memory foo)
|
||||
const Form *form2_left = name_left ? globals[name_left] : NULL;
|
||||
const Form *form2_left = globals[name_left];
|
||||
if( form2_left && form2_left->is_cisc_mem(globals) ) {
|
||||
cisc_spillable = Is_cisc_spillable;
|
||||
operand = _name;
|
||||
@ -3645,7 +3645,7 @@ int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, Matc
|
||||
}
|
||||
}
|
||||
// Detect reg vs memory
|
||||
else if( form->is_cisc_reg(globals) && form2->is_cisc_mem(globals) ) {
|
||||
else if (form->is_cisc_reg(globals) && form2 != NULL && form2->is_cisc_mem(globals)) {
|
||||
cisc_spillable = Is_cisc_spillable;
|
||||
operand = _name;
|
||||
reg_type = _result;
|
||||
@ -3710,8 +3710,12 @@ int MatchRule::matchrule_cisc_spill_match(FormDict& globals, RegisterForm* regi
|
||||
}
|
||||
|
||||
// Check right operands: recursive walk to identify reg->mem operand
|
||||
if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) {
|
||||
right_spillable = Maybe_cisc_spillable;
|
||||
if (_rChild == NULL) {
|
||||
if (mRule2->_rChild == NULL) {
|
||||
right_spillable = Maybe_cisc_spillable;
|
||||
} else {
|
||||
assert(0, "_rChild should not be NULL");
|
||||
}
|
||||
} else {
|
||||
right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, 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
|
||||
@ -142,7 +142,7 @@ int main(int argc, char *argv[])
|
||||
const char *base = strip_ext(strdup(argv[i]));
|
||||
char *temp = base_plus_suffix("dfa_",base);
|
||||
AD._DFA_file._name = base_plus_suffix(temp,".cpp");
|
||||
delete temp;
|
||||
delete[] temp;
|
||||
temp = base_plus_suffix("ad_",base);
|
||||
AD._CPP_file._name = base_plus_suffix(temp,".cpp");
|
||||
AD._CPP_CLONE_file._name = base_plus_suffix(temp,"_clone.cpp");
|
||||
@ -153,13 +153,13 @@ int main(int argc, char *argv[])
|
||||
AD._CPP_PEEPHOLE_file._name = base_plus_suffix(temp,"_peephole.cpp");
|
||||
AD._CPP_PIPELINE_file._name = base_plus_suffix(temp,"_pipeline.cpp");
|
||||
AD._HPP_file._name = base_plus_suffix(temp,".hpp");
|
||||
delete temp;
|
||||
delete[] temp;
|
||||
temp = base_plus_suffix("adGlobals_",base);
|
||||
AD._VM_file._name = base_plus_suffix(temp,".hpp");
|
||||
delete temp;
|
||||
delete[] temp;
|
||||
temp = base_plus_suffix("bugs_",base);
|
||||
AD._bug_file._name = base_plus_suffix(temp,".out");
|
||||
delete temp;
|
||||
delete[] temp;
|
||||
} // End of files vs options...
|
||||
} // End of while have command line arguments
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2018, 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
|
||||
@ -1936,6 +1936,7 @@ public:
|
||||
_AD.syntax_err( _ins_encode._linenum,
|
||||
"Parameter %s not passed to enc_class %s from instruct %s.\n",
|
||||
rep_var, _encoding._name, _inst._ident);
|
||||
assert(false, "inst_rep_var == NULL, cannot continue.");
|
||||
}
|
||||
|
||||
// Check if instruction's actual parameter is a local name in the instruction
|
||||
@ -1976,8 +1977,8 @@ public:
|
||||
}
|
||||
else {
|
||||
// Check for unimplemented functionality before hard failure
|
||||
assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label");
|
||||
assert( false, "ShouldNotReachHere()");
|
||||
assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label");
|
||||
assert(false, "ShouldNotReachHere()");
|
||||
}
|
||||
} // done checking which operand this is.
|
||||
} else {
|
||||
@ -2450,8 +2451,8 @@ private:
|
||||
}
|
||||
else {
|
||||
// Check for unimplemented functionality before hard failure
|
||||
assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label");
|
||||
assert( false, "ShouldNotReachHere()");
|
||||
assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label");
|
||||
assert(false, "ShouldNotReachHere()");
|
||||
}
|
||||
// all done
|
||||
}
|
||||
@ -3305,9 +3306,11 @@ void ArchDesc::defineClasses(FILE *fp) {
|
||||
// Output the definitions for machine node specific pipeline data
|
||||
_machnodes.reset();
|
||||
|
||||
for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) {
|
||||
fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
|
||||
machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num);
|
||||
if (_pipeline != NULL) {
|
||||
for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) {
|
||||
fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
|
||||
machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(_CPP_PIPELINE_file._fp, "\n");
|
||||
@ -3315,13 +3318,15 @@ void ArchDesc::defineClasses(FILE *fp) {
|
||||
// Output the definitions for instruction pipeline static data references
|
||||
_instructions.reset();
|
||||
|
||||
for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) {
|
||||
if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) {
|
||||
fprintf(_CPP_PIPELINE_file._fp, "\n");
|
||||
fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n",
|
||||
max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
|
||||
fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
|
||||
max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
|
||||
if (_pipeline != NULL) {
|
||||
for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) {
|
||||
if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) {
|
||||
fprintf(_CPP_PIPELINE_file._fp, "\n");
|
||||
fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n",
|
||||
max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
|
||||
fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
|
||||
max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, 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
|
||||
@ -187,7 +187,7 @@ void CodeBuffer::freeze_section(CodeSection* cs) {
|
||||
cs->_limit = new_limit;
|
||||
cs->_locs_limit = new_locs_limit;
|
||||
cs->_frozen = true;
|
||||
if (!next_cs->is_allocated() && !next_cs->is_frozen()) {
|
||||
if (next_cs != NULL && !next_cs->is_allocated() && !next_cs->is_frozen()) {
|
||||
// Give remaining buffer space to the following section.
|
||||
next_cs->initialize(new_limit, old_limit - new_limit);
|
||||
next_cs->initialize_shared_locs(new_locs_limit,
|
||||
@ -494,10 +494,13 @@ void CodeBuffer::compute_final_layout(CodeBuffer* dest) const {
|
||||
// Compute initial padding; assign it to the previous non-empty guy.
|
||||
// Cf. figure_expanded_capacities.
|
||||
csize_t padding = cs->align_at_start(buf_offset) - buf_offset;
|
||||
if (padding != 0) {
|
||||
buf_offset += padding;
|
||||
assert(prev_dest_cs != NULL, "sanity");
|
||||
prev_dest_cs->_limit += padding;
|
||||
if (prev_dest_cs != NULL) {
|
||||
if (padding != 0) {
|
||||
buf_offset += padding;
|
||||
prev_dest_cs->_limit += padding;
|
||||
}
|
||||
} else {
|
||||
guarantee(padding == 0, "In first iteration no padding should be needed.");
|
||||
}
|
||||
#ifdef ASSERT
|
||||
if (prev_cs != NULL && prev_cs->is_frozen() && n < (SECT_LIMIT - 1)) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, 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
|
||||
@ -1386,7 +1386,7 @@ void SubstitutionResolver::block_do(BlockBegin* block) {
|
||||
n->values_do(this);
|
||||
// need to remove this instruction from the instruction stream
|
||||
if (n->subst() != n) {
|
||||
assert(last != NULL, "must have last");
|
||||
guarantee(last != NULL, "must have last");
|
||||
last->set_next(n->next());
|
||||
} else {
|
||||
last = n;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2018, 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
|
||||
@ -3954,7 +3954,7 @@ void MoveResolver::resolve_mappings() {
|
||||
if (!processed_interval) {
|
||||
// no move could be processed because there is a cycle in the move list
|
||||
// (e.g. r1 -> r2, r2 -> r1), so one interval must be spilled to memory
|
||||
assert(spill_candidate != -1, "no interval in register for spilling found");
|
||||
guarantee(spill_candidate != -1, "no interval in register for spilling found");
|
||||
|
||||
// create a new spill interval and assign a stack slot to it
|
||||
Interval* from_interval = _mapping_from.at(spill_candidate);
|
||||
@ -6301,7 +6301,8 @@ void ControlFlowOptimizer::delete_unnecessary_jumps(BlockList* code) {
|
||||
assert(prev_branch->cond() == prev_cmp->condition(), "should be the same");
|
||||
}
|
||||
}
|
||||
assert(prev_cmp != NULL, "should have found comp instruction for branch");
|
||||
// Guarantee because it is dereferenced below.
|
||||
guarantee(prev_cmp != NULL, "should have found comp instruction for branch");
|
||||
if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) {
|
||||
|
||||
TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id()));
|
||||
|
||||
@ -1363,22 +1363,22 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) {
|
||||
const char *msg1 = msg1_stream.as_string();
|
||||
const char *msg2 = msg2_stream.as_string();
|
||||
|
||||
log_warning(codecache)(msg1);
|
||||
log_warning(codecache)(msg2);
|
||||
warning(msg1);
|
||||
warning(msg2);
|
||||
log_warning(codecache)("%s", msg1);
|
||||
log_warning(codecache)("%s", msg2);
|
||||
warning("%s", msg1);
|
||||
warning("%s", msg2);
|
||||
} else {
|
||||
const char *msg1 = "CodeCache is full. Compiler has been disabled.";
|
||||
const char *msg2 = "Try increasing the code cache size using -XX:ReservedCodeCacheSize=";
|
||||
|
||||
log_warning(codecache)(msg1);
|
||||
log_warning(codecache)(msg2);
|
||||
warning(msg1);
|
||||
warning(msg2);
|
||||
log_warning(codecache)("%s", msg1);
|
||||
log_warning(codecache)("%s", msg2);
|
||||
warning("%s", msg1);
|
||||
warning("%s", msg2);
|
||||
}
|
||||
ResourceMark rm;
|
||||
stringStream s;
|
||||
// Dump code cache into a buffer before locking the tty,
|
||||
// Dump code cache into a buffer before locking the tty.
|
||||
{
|
||||
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
print_summary(&s);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2018, 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
|
||||
@ -217,14 +217,17 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen)
|
||||
file->print_raw_cr("'>");
|
||||
|
||||
size_t nr; // number read into buf from partial log
|
||||
// In case of unsuccessful completion, read returns -1.
|
||||
ssize_t bytes_read;
|
||||
// Copy data up to the end of the last <event> element:
|
||||
julong to_read = log->_file_end;
|
||||
while (to_read > 0) {
|
||||
if (to_read < (julong)buflen)
|
||||
nr = (size_t)to_read;
|
||||
else nr = buflen;
|
||||
nr = read(partial_fd, buf, (int)nr);
|
||||
if (nr <= 0) break;
|
||||
bytes_read = read(partial_fd, buf, (int)nr);
|
||||
if (bytes_read <= 0) break;
|
||||
nr = bytes_read;
|
||||
to_read -= (julong)nr;
|
||||
file->write(buf, nr);
|
||||
}
|
||||
@ -232,7 +235,8 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen)
|
||||
// Copy any remaining data inside a quote:
|
||||
bool saw_slop = false;
|
||||
int end_cdata = 0; // state machine [0..2] watching for too many "]]"
|
||||
while ((nr = read(partial_fd, buf, buflen-1)) > 0) {
|
||||
while ((bytes_read = read(partial_fd, buf, buflen-1)) > 0) {
|
||||
nr = bytes_read;
|
||||
buf[buflen-1] = '\0';
|
||||
if (!saw_slop) {
|
||||
file->print_raw_cr("<fragment>");
|
||||
|
||||
@ -122,7 +122,7 @@ bool Disassembler::load_library() {
|
||||
_decode_instructions_virtual = CAST_TO_FN_PTR(Disassembler::decode_func_virtual,
|
||||
os::dll_lookup(_library, decode_instructions_virtual_name));
|
||||
}
|
||||
if (_decode_instructions_virtual == NULL) {
|
||||
if (_decode_instructions_virtual == NULL && _library != NULL) {
|
||||
// could not spot in new version, try old version
|
||||
_decode_instructions = CAST_TO_FN_PTR(Disassembler::decode_func,
|
||||
os::dll_lookup(_library, decode_instructions_name));
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2018, 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
|
||||
@ -484,7 +484,7 @@ MethodLivenessResult MethodLiveness::get_liveness_at(int entry_bci) {
|
||||
while (block == NULL && t > 0) {
|
||||
block = _block_map->at(--t);
|
||||
}
|
||||
assert( block != NULL, "invalid bytecode index; must be instruction index" );
|
||||
guarantee(block != NULL, "invalid bytecode index; must be instruction index");
|
||||
assert(bci >= block->start_bci() && bci < block->limit_bci(), "block must contain bci.");
|
||||
|
||||
answer = block->get_liveness_at(method(), bci);
|
||||
|
||||
@ -571,14 +571,14 @@ bool OopMap::equals(const OopMap* other) const {
|
||||
|
||||
const ImmutableOopMap* ImmutableOopMapSet::find_map_at_offset(int pc_offset) const {
|
||||
ImmutableOopMapPair* pairs = get_pairs();
|
||||
ImmutableOopMapPair* last = NULL;
|
||||
|
||||
for (int i = 0; i < _count; ++i) {
|
||||
int i;
|
||||
for (i = 0; i < _count; ++i) {
|
||||
if (pairs[i].pc_offset() >= pc_offset) {
|
||||
last = &pairs[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
ImmutableOopMapPair* last = &pairs[i];
|
||||
|
||||
assert(last->pc_offset() == pc_offset, "oopmap not found");
|
||||
return last->get_from(this);
|
||||
|
||||
@ -236,6 +236,8 @@ int AOTOopRecorder::find_index(Metadata* h) {
|
||||
|
||||
JVMCIKlassHandle klass(THREAD);
|
||||
oop result = NULL;
|
||||
guarantee(h != NULL,
|
||||
"If DebugInformationRecorder::describe_scope passes NULL oldCount == newCount must hold.");
|
||||
if (h->is_klass()) {
|
||||
klass = (Klass*) h;
|
||||
result = CompilerToVM::get_jvmci_type(klass, CATCH);
|
||||
|
||||
@ -349,7 +349,9 @@ C2V_VMENTRY(jobject, getResolvedJavaType, (JNIEnv *, jobject, jobject base, jlon
|
||||
klass = *((Klass**) (intptr_t) (base_address + offset));
|
||||
} else {
|
||||
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
|
||||
err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", base_object->klass()->external_name(), offset, compressed ? "true" : "false"));
|
||||
err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s",
|
||||
base_object != NULL ? base_object->klass()->external_name() : "null",
|
||||
offset, compressed ? "true" : "false"));
|
||||
}
|
||||
assert (klass == NULL || klass->is_klass(), "invalid read");
|
||||
oop result = CompilerToVM::get_jvmci_type(klass, CHECK_NULL);
|
||||
|
||||
@ -659,7 +659,8 @@ bool ArrayCopyNode::may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTra
|
||||
c = bs->step_over_gc_barrier(c);
|
||||
|
||||
CallNode* call = NULL;
|
||||
if (c != NULL && c->is_Region()) {
|
||||
guarantee(c != NULL, "step_over_gc_barrier failed, there must be something to step to.");
|
||||
if (c->is_Region()) {
|
||||
for (uint i = 1; i < c->req(); i++) {
|
||||
if (c->in(i) != NULL) {
|
||||
Node* n = c->in(i)->in(0);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2018, 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
|
||||
@ -520,10 +520,10 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
|
||||
caller_bci, inline_msg);
|
||||
if (C->print_inlining()) {
|
||||
C->print_inlining(callee_method, inline_level(), caller_bci, inline_msg);
|
||||
if (callee_method == NULL) tty->print(" callee not monotonic or profiled");
|
||||
if (Verbose && callee_method) {
|
||||
guarantee(callee_method != NULL, "would crash in post_inlining_event");
|
||||
if (Verbose) {
|
||||
const InlineTree *top = this;
|
||||
while( top->caller_tree() != NULL ) { top = top->caller_tree(); }
|
||||
while (top->caller_tree() != NULL) { top = top->caller_tree(); }
|
||||
//tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count());
|
||||
}
|
||||
}
|
||||
|
||||
@ -759,6 +759,7 @@ bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
|
||||
}
|
||||
}
|
||||
}
|
||||
guarantee(dest != NULL, "Call had only one ptr in, broken IR!");
|
||||
if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4049,9 +4049,9 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) {
|
||||
|
||||
int Compile::ConstantTable::find_offset(Constant& con) const {
|
||||
int idx = _constants.find(con);
|
||||
assert(idx != -1, "constant must be in constant table");
|
||||
guarantee(idx != -1, "constant must be in constant table");
|
||||
int offset = _constants.at(idx).offset();
|
||||
assert(offset != -1, "constant table not emitted yet?");
|
||||
guarantee(offset != -1, "constant table not emitted yet?");
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
@ -1263,6 +1263,7 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_Stack &stack) {
|
||||
Node* use = self->fast_out(i);
|
||||
LCA = raise_LCA_above_use(LCA, use, self, this);
|
||||
}
|
||||
guarantee(LCA != NULL, "There must be a LCA");
|
||||
} // (Hide defs of imax, i from rest of block.)
|
||||
|
||||
// Place temps in the block of their use. This isn't a
|
||||
|
||||
@ -387,6 +387,7 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
|
||||
} else {
|
||||
assert( 0, "do not know how to handle this guy" );
|
||||
}
|
||||
guarantee(proj != NULL, "sanity");
|
||||
|
||||
Node *proj_path_data, *proj_path_ctrl;
|
||||
if( proj->Opcode() == Op_IfTrue ) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2018, 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
|
||||
@ -319,7 +319,7 @@ void IndexSet::initialize(uint max_elements) {
|
||||
if (_max_blocks <= preallocated_block_list_size) {
|
||||
_blocks = _preallocated_block_list;
|
||||
} else {
|
||||
_blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks);
|
||||
_blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks);
|
||||
}
|
||||
for (uint i = 0; i < _max_blocks; i++) {
|
||||
set_block(i, &_empty_block);
|
||||
@ -343,7 +343,7 @@ void IndexSet::initialize(uint max_elements, Arena *arena) {
|
||||
if (_max_blocks <= preallocated_block_list_size) {
|
||||
_blocks = _preallocated_block_list;
|
||||
} else {
|
||||
_blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks);
|
||||
_blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks);
|
||||
}
|
||||
for (uint i = 0; i < _max_blocks; i++) {
|
||||
set_block(i, &_empty_block);
|
||||
|
||||
@ -646,7 +646,7 @@ Node* PhaseCFG::select(
|
||||
}
|
||||
} // End of for all ready nodes in worklist
|
||||
|
||||
assert(idx >= 0, "index should be set");
|
||||
guarantee(idx >= 0, "index should be set");
|
||||
Node *n = worklist[(uint)idx]; // Get the winner
|
||||
|
||||
worklist.map((uint)idx, worklist.pop()); // Compress worklist
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2018, 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
|
||||
@ -684,6 +684,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(IdealLoopTree *loop, Node* ctrl,
|
||||
Node* max_idx_expr = NULL;
|
||||
const TypeInt* idx_type = TypeInt::INT;
|
||||
if ((stride > 0) == (scale > 0) == upper) {
|
||||
guarantee(limit != NULL, "sanity");
|
||||
if (TraceLoopPredicate) {
|
||||
if (limit->is_Con()) {
|
||||
predString->print("(%d ", con_limit);
|
||||
|
||||
@ -768,11 +768,12 @@ bool IdealLoopTree::policy_unroll(PhaseIdealLoop *phase) {
|
||||
Node *init_n = cl->init_trip();
|
||||
Node *limit_n = cl->limit();
|
||||
int stride_con = cl->stride_con();
|
||||
if (limit_n == NULL) return false; // We will dereference it below.
|
||||
|
||||
// Non-constant bounds.
|
||||
// Protect against over-unrolling when init or/and limit are not constant
|
||||
// (so that trip_count's init value is maxint) but iv range is known.
|
||||
if (init_n == NULL || !init_n->is_Con() ||
|
||||
limit_n == NULL || !limit_n->is_Con()) {
|
||||
if (init_n == NULL || !init_n->is_Con() || !limit_n->is_Con()) {
|
||||
Node* phi = cl->phi();
|
||||
if (phi != NULL) {
|
||||
assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi.");
|
||||
|
||||
@ -2154,6 +2154,7 @@ bool PhaseMacroExpand::eliminate_locking_node(AbstractLockNode *alock) {
|
||||
|
||||
Node* mem = alock->in(TypeFunc::Memory);
|
||||
Node* ctrl = alock->in(TypeFunc::Control);
|
||||
guarantee(ctrl != NULL, "missing control projection, cannot replace_node() with NULL");
|
||||
|
||||
extract_call_projections(alock);
|
||||
// There are 2 projections from the lock. The lock node will
|
||||
@ -2188,8 +2189,7 @@ bool PhaseMacroExpand::eliminate_locking_node(AbstractLockNode *alock) {
|
||||
}
|
||||
|
||||
// Seach for MemBarReleaseLock node and delete it also.
|
||||
if (alock->is_Unlock() && ctrl != NULL && ctrl->is_Proj() &&
|
||||
ctrl->in(0)->is_MemBar()) {
|
||||
if (alock->is_Unlock() && ctrl->is_Proj() && ctrl->in(0)->is_MemBar()) {
|
||||
MemBarNode* membar = ctrl->in(0)->as_MemBar();
|
||||
assert(membar->Opcode() == Op_MemBarReleaseLock &&
|
||||
mem->is_Proj() && membar == mem->in(0), "");
|
||||
|
||||
@ -370,10 +370,10 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
|
||||
|
||||
if (mem != old_mem) {
|
||||
set_req(MemNode::Memory, mem);
|
||||
if (can_reshape && old_mem->outcnt() == 0) {
|
||||
igvn->_worklist.push(old_mem);
|
||||
if (can_reshape && old_mem->outcnt() == 0 && igvn != NULL) {
|
||||
igvn->_worklist.push(old_mem);
|
||||
}
|
||||
if (phase->type( mem ) == Type::TOP) return NodeSentinel;
|
||||
if (phase->type(mem) == Type::TOP) return NodeSentinel;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -825,7 +825,7 @@ Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypeP
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// ShouldNotReachHere(); ???
|
||||
ShouldNotReachHere();
|
||||
break;
|
||||
}
|
||||
assert(load != NULL, "LoadNode should have been created");
|
||||
|
||||
@ -1689,9 +1689,10 @@ Compile::locate_node_notes(GrowableArray<Node_Notes*>* arr,
|
||||
int block_idx = (idx >> _log2_node_notes_block_size);
|
||||
int grow_by = (block_idx - (arr == NULL? 0: arr->length()));
|
||||
if (grow_by >= 0) {
|
||||
if (!can_grow) return NULL;
|
||||
if (!can_grow) return NULL;
|
||||
grow_node_notes(arr, grow_by + 1);
|
||||
}
|
||||
if (arr == NULL) return NULL;
|
||||
// (Every element of arr is a sub-array of length _node_notes_block_size.)
|
||||
return arr->at(block_idx) + (idx & (_node_notes_block_size-1));
|
||||
}
|
||||
|
||||
@ -1424,7 +1424,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
|
||||
|
||||
// See if this instruction has a delay slot
|
||||
if (valid_bundle_info(n) && node_bundling(n)->use_unconditional_delay()) {
|
||||
assert(delay_slot != NULL, "expecting delay slot node");
|
||||
guarantee(delay_slot != NULL, "expecting delay slot node");
|
||||
|
||||
// Back up 1 instruction
|
||||
cb->set_insts_end(cb->insts_end() - Pipeline::instr_unit_size());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, 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
|
||||
@ -1823,7 +1823,7 @@ void Parse::merge_memory_edges(MergeMemNode* n, int pnum, bool nophi) {
|
||||
// Instead, wire the new split into a MergeMem on the backedge.
|
||||
// The optimizer will sort it out, slicing the phi.
|
||||
if (remerge == NULL) {
|
||||
assert(base != NULL, "");
|
||||
guarantee(base != NULL, "");
|
||||
assert(base->in(0) != NULL, "should not be xformed away");
|
||||
remerge = MergeMemNode::make(base->in(pnum));
|
||||
gvn().set_type(remerge, Type::MEMORY);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2018, 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
|
||||
@ -683,7 +683,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
|
||||
if( needs_phi ) {
|
||||
// create a new phi node and insert it into the block
|
||||
// type is taken from left over pointer to a predecessor
|
||||
assert(n3,"No non-NULL reaching DEF for a Phi");
|
||||
guarantee(n3, "No non-NULL reaching DEF for a Phi");
|
||||
phi = new PhiNode(b->head(), n3->bottom_type());
|
||||
// initialize the Reaches entry for this LRG
|
||||
Reachblock[slidx] = phi;
|
||||
|
||||
@ -1608,7 +1608,12 @@ NamedCounter* OptoRuntime::new_named_counter(JVMState* youngest_jvms, NamedCount
|
||||
}
|
||||
int bci = jvms->bci();
|
||||
if (bci < 0) bci = 0;
|
||||
st.print("%s.%s@%d", m->holder()->name()->as_utf8(), m->name()->as_utf8(), bci);
|
||||
if (m != NULL) {
|
||||
st.print("%s.%s", m->holder()->name()->as_utf8(), m->name()->as_utf8());
|
||||
} else {
|
||||
st.print("no method");
|
||||
}
|
||||
st.print("@%d", bci);
|
||||
// To print linenumbers instead of bci use: m->line_number_from_bci(bci)
|
||||
}
|
||||
NamedCounter* c;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, 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
|
||||
@ -252,17 +252,16 @@ const Type* Type::make_from_constant(ciConstant constant, bool require_constant,
|
||||
ciObject* oop_constant = constant.as_object();
|
||||
if (oop_constant->is_null_object()) {
|
||||
con_type = Type::get_zero_type(T_OBJECT);
|
||||
} else if (require_constant || oop_constant->should_be_constant()) {
|
||||
} else {
|
||||
guarantee(require_constant || oop_constant->should_be_constant(), "con_type must get computed");
|
||||
con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant);
|
||||
if (con_type != NULL) {
|
||||
if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
|
||||
con_type = con_type->is_aryptr()->cast_to_autobox_cache(true);
|
||||
}
|
||||
if (stable_dimension > 0) {
|
||||
assert(FoldStableValues, "sanity");
|
||||
assert(!con_type->is_zero_type(), "default value for stable field");
|
||||
con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension);
|
||||
}
|
||||
if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
|
||||
con_type = con_type->is_aryptr()->cast_to_autobox_cache(true);
|
||||
}
|
||||
if (stable_dimension > 0) {
|
||||
assert(FoldStableValues, "sanity");
|
||||
assert(!con_type->is_zero_type(), "default value for stable field");
|
||||
con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension);
|
||||
}
|
||||
}
|
||||
if (is_narrow_oop) {
|
||||
|
||||
@ -266,8 +266,9 @@ CompileTask* SimpleThresholdPolicy::select_task(CompileQueue* compile_queue) {
|
||||
max_method = max_task->method();
|
||||
}
|
||||
|
||||
if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile
|
||||
&& is_method_profiled(max_method)) {
|
||||
if (max_task != NULL && max_task->comp_level() == CompLevel_full_profile &&
|
||||
TieredStopAtLevel > CompLevel_full_profile &&
|
||||
max_method != NULL && is_method_profiled(max_method)) {
|
||||
max_task->set_comp_level(CompLevel_limited_profile);
|
||||
if (PrintTieredEvents) {
|
||||
print_event(UPDATE_IN_QUEUE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user