# HG changeset patch # User Andrew Haley # Date 1230125597 0 # Node ID a139f3afcef391dba766050317e3cbc48f8898c5 # Parent cf5fe433e7398aa6e714769bfa0c88861aaf5eb8 2008-12-24 Andrew Haley * ports/hotspot/src/share/vm/shark/sharkFunction.cpp (SharkFunction::initialize): Work around bug in ciTypeFlow::Block::pre_order_at(). * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp (SharkCompiler::compile_method): Allow "*" as a wildcard. * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp (llvm::IRBuilder): type2aelembytes now a mamber function. * ports/hotspot/src/share/vm/shark/sharkBlock.hpp (class SharkBlock): is_private_copy renamed is_backedge_copy. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp (SharkBlock::parse): force_bci if there's a trap. * ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp: Delete everything. diff -r cf5fe433e739 -r a139f3afcef3 ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp Wed Dec 24 08:25:40 2008 -0500 +++ b/ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp Wed Dec 24 13:33:17 2008 +0000 @@ -26,25 +26,3 @@ #include "incls/_precompiled.incl" #include "incls/_disassembler_zero.cpp.incl" -#ifndef PRODUCT -void Disassembler::decode(CodeBlob *cb, outputStream *st) -{ - Unimplemented(); -} - -void Disassembler::decode(nmethod *nm, outputStream *st) -{ -#ifdef SHARK - assert(st == NULL, "it's all going to stderr anyway"); - ((SharkEntry *) nm->instructions_begin())->llvm_function()->dump(); -#else - Unimplemented(); -#endif // SHARK -} - -void Disassembler::decode(u_char *begin, u_char *end, outputStream *st) -{ - Unimplemented(); -} -#endif // PRODUCT - diff -r cf5fe433e739 -r a139f3afcef3 ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Wed Dec 24 08:25:40 2008 -0500 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Wed Dec 24 13:33:17 2008 +0000 @@ -105,6 +105,8 @@ builder()->SetInsertPoint(entry_block()); if (has_trap()) { + iter()->force_bci(start()); + current_state()->decache_for_trap(); builder()->CreateCall2( SharkRuntime::uncommon_trap(), diff -r cf5fe433e739 -r a139f3afcef3 ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Wed Dec 24 08:25:40 2008 -0500 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Wed Dec 24 13:33:17 2008 +0000 @@ -78,7 +78,7 @@ } bool is_private_copy() const { - return ciblock()->is_private_copy(); + return ciblock()->is_backedge_copy(); } int max_locals() const { diff -r cf5fe433e739 -r a139f3afcef3 ports/hotspot/src/share/vm/shark/sharkBuilder.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp Wed Dec 24 08:25:40 2008 -0500 +++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp Wed Dec 24 13:33:17 2008 +0000 @@ -104,7 +104,7 @@ return CreateArrayAddress( arrayoop, SharkType::to_arrayType(basic_type), - type2aelembytes[basic_type], + type2aelembytes(basic_type), base_offset, index, name); } diff -r cf5fe433e739 -r a139f3afcef3 ports/hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Dec 24 08:25:40 2008 -0500 +++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Dec 24 13:33:17 2008 +0000 @@ -76,7 +76,8 @@ if (env->failing()) return; if (SharkPrintTypeflowOf != NULL) { - if (!strcmp(SharkPrintTypeflowOf, name)) + if (!strcmp(SharkPrintTypeflowOf, name) || + !strcmp(SharkPrintTypeflowOf, "*")) flow->print_on(tty); } diff -r cf5fe433e739 -r a139f3afcef3 ports/hotspot/src/share/vm/shark/sharkFunction.cpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Wed Dec 24 08:25:40 2008 -0500 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Wed Dec 24 13:33:17 2008 +0000 @@ -42,8 +42,14 @@ set_block_insertion_point(NULL); _blocks = NEW_RESOURCE_ARRAY(SharkBlock*, flow()->block_count()); for (int i = 0; i < block_count(); i++) - _blocks[i] = new SharkBlock(this, flow()->pre_order_at(i)); - + { + ciTypeFlow::Block *b = flow()->pre_order_at(i); + // Work around a bug in pre_order_at() that does not return the + // correct pre-ordering. If pre_order_at() were correct this + // line could simply be: + // _blocks[i] = new SharkBlock(this, b); + _blocks[b->pre_order()] = new SharkBlock(this, b); + } // Walk the tree from the start block to determine which // blocks are entered and which blocks require phis SharkBlock *start_block = block(0);