# HG changeset patch # User Gary Benson # Date 1236262470 18000 # Node ID f51dcb5de1a9abe8f6ada04de2b73659bb1abf35 # Parent c5a65faa56e25214fb227cdf2eeaf5b195426052 2009-03-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkEntry.hpp (SharkEntry::_code_start): Renamed from start. (SharkEntry::_code_limit): Renamed from limit. (SharkEntry::set_bounds): Renamed from setBounds. (SharkEntry::print_pd_statistics): Removed. * ports/hotspot/src/share/vm/shark/sharkEntry.cpp (SharkEntry::print_pd_statistics): Likewise. (SharkEntry::print_statistics): Don't call the above. * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp (SharkBuilder::MyJITMemoryManager::endFunctionBody): Fix for setBounds rename. diff -r c5a65faa56e2 -r f51dcb5de1a9 ChangeLog --- a/ChangeLog Thu Mar 05 13:44:56 2009 +0000 +++ b/ChangeLog Thu Mar 05 09:14:30 2009 -0500 @@ -1,3 +1,17 @@ +2009-03-05 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkEntry.hpp + (SharkEntry::_code_start): Renamed from start. + (SharkEntry::_code_limit): Renamed from limit. + (SharkEntry::set_bounds): Renamed from setBounds. + (SharkEntry::print_pd_statistics): Removed. + * ports/hotspot/src/share/vm/shark/sharkEntry.cpp + (SharkEntry::print_pd_statistics): Likewise. + (SharkEntry::print_statistics): Don't call the above. + * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp + (SharkBuilder::MyJITMemoryManager::endFunctionBody): + Fix for setBounds rename. + 2009-03-05 Gary Benson * patches/hotspot/default/icedtea-shark.patch diff -r c5a65faa56e2 -r f51dcb5de1a9 ports/hotspot/src/share/vm/shark/sharkBuilder.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp Thu Mar 05 13:44:56 2009 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp Thu Mar 05 09:14:30 2009 -0500 @@ -184,8 +184,8 @@ { mm->endFunctionBody(F, FunctionStart, FunctionEnd); - SharkEntry *e = sharkEntry[F]; - if (e) - e->setBounds(FunctionStart, FunctionEnd); + SharkEntry *entry = sharkEntry[F]; + if (entry) + entry->set_bounds((address) FunctionStart, (address) FunctionEnd); } diff -r c5a65faa56e2 -r f51dcb5de1a9 ports/hotspot/src/share/vm/shark/sharkEntry.cpp --- a/ports/hotspot/src/share/vm/shark/sharkEntry.cpp Thu Mar 05 13:44:56 2009 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkEntry.cpp Thu Mar 05 09:14:30 2009 -0500 @@ -32,92 +32,7 @@ address start = code_start(); address limit = code_limit(); - ttyLocker ttyl; - tty->print(" [%p-%p): %s (%d bytes code", start, limit, name, limit - start); - print_pd_statistics(start, limit); - tty->print_cr(")"); -} - -// Lots of the stuff down here is machine- and LLVM-specific. -// It's only debug stuff though, and none of it's critical. - -void SharkEntry::print_pd_statistics(address start, address limit) const -{ -#ifdef PPC - uint32_t *pc = (uint32_t *) start; - uint32_t instr; - - // Walk over the bit that allocates the frame - instr = *(pc++); - assert (instr == 0x7c0802a6, "expecting 'mflr r0'"); - - instr = *(pc++); - bool has_locals = (instr == NOT_LP64(0x93e1fffc) LP64_ONLY(0xf9e1fffc)); - if (has_locals) { - // 0xd04f3a60: mflr r0 - // 0xd04f3a64: stw r31,-4(r1) - // 0xd04f3a68: stw r0,4(r1) - // 0xd04f3a6c: stwu r1,-112(r1) - // 0xd04f3a70: mr r31,r1 - // 0xd04f3a74: stw r14,104(r31) - // ... - // 0xd04f3ab4: stw r30,40(r31) - return; - } - - assert (instr == NOT_LP64(0x90010004) LP64_ONLY(0xf8010004), - "expecting st" NOT_LP64("w") LP64_ONLY("d") " r0,4(r1)"); - - instr = *(pc++); - assert ((instr & 0xffff8001) == NOT_LP64(0x94218000) LP64_ONLY(0xf8218001), - "expecting st" NOT_LP64("w") LP64_ONLY("d") "u r1,-X(r1)"); - int frame_size = -((instr | 0xffff0000) LP64_ONLY(& 0xfffffffc)); - tty->print(", %d bytes stack", frame_size); - - // Walk over the bit that stores the non-volatile registers - int first_reg = -1; - int next_slot = frame_size - wordSize; - int last_reg = -1; - while (pc < (uint32_t *) limit) { - instr = *(pc++); - - // The opcode should be stw/std - int opcode = instr >> 26; - if (opcode != NOT_LP64(36) LP64_ONLY(62)) - break; - - // The destination should be next_slot(r1) - int ra = (instr & 0x001f0000) >> 16; - if (ra != 1) - break; - - int ds = instr & 0x0000ffff; - if (ds != next_slot) - break; - next_slot -= wordSize; - - // The source should be the next register after last_reg - int rs = (instr & 0x03e00000) >> 21; - if (first_reg == -1) { - assert(rs >= 13, "storing a non-volatile register?"); - first_reg = last_reg = rs; - } - else { - assert(rs == last_reg + 1, "register stores out of order?"); - last_reg = rs; - } - } - - if (first_reg == -1) { - tty->print(", 0 registers"); - } - else { - int num_registers = last_reg - first_reg + 1; - if (num_registers == 1) - tty->print(", 1 register"); - else - tty->print(", %d registers", num_registers); - } -#endif // PPC + tty->print_cr( + " [%p-%p): %s (%d bytes code)", start, limit, name, limit - start); } #endif // !PRODUCT diff -r c5a65faa56e2 -r f51dcb5de1a9 ports/hotspot/src/share/vm/shark/sharkEntry.hpp --- a/ports/hotspot/src/share/vm/shark/sharkEntry.hpp Thu Mar 05 13:44:56 2009 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkEntry.hpp Thu Mar 05 09:14:30 2009 -0500 @@ -26,6 +26,8 @@ class SharkEntry : public ZeroEntry { private: llvm::Function* _llvm_function; + address _code_start; + address _code_limit; public: llvm::Function* llvm_function() const @@ -38,6 +40,21 @@ } public: + address code_start() const + { + return _code_start; + } + address code_limit() const + { + return _code_limit; + } + void set_bounds(address code_start, address code_limit) + { + _code_start = code_start; + _code_limit = code_limit; + } + + public: static ByteSize llvm_function_offset() { return byte_offset_of(SharkEntry, _llvm_function); @@ -45,23 +62,4 @@ public: void print_statistics(const char* name) const PRODUCT_RETURN; - - address code_start() const - { - return start; - } - address code_limit() const - { - return limit; - } - void print_pd_statistics(address start, address limit) const; - - address start, limit; - -public: - void setBounds(unsigned char *FunctionStart, unsigned char *FunctionEnd) - { - start = (address)FunctionStart; - limit = (address)FunctionEnd; - } };