changeset in /hg/icedtea6: 2009-05-29 Gary Benson <gbenson at red...
Gary Benson
gbenson at redhat.com
Fri May 29 04:37:39 PDT 2009
changeset e3339b19c3d9 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=e3339b19c3d9
description:
2009-05-29 Gary Benson <gbenson at redhat.com>
* ports/hotspot/src/share/vm/shark/sharkBlock.hpp
(SharkBlock::maybe_add_safepoint): Replaced with...
(SharkBlock::maybe_add_backedge_safepoint): New method.
* ports/hotspot/src/share/vm/shark/sharkBlock.cpp
(SharkBlock::maybe_add_safepoint): Replaced with...
(SharkBlock::maybe_add_backedge_safepoint): New method.
(SharkBlock::parse_bytecode): Updated for above.
* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
(SharkBlock::maybe_add_backedge_safepoint): New method.
(SharkBlock::_can_reach_visited): New field.
(SharkBlock::can_reach): New method.
(SharkBlock::can_reach_helper): Likewise.
* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
(SharkBlock::maybe_add_backedge_safepoint): New method.
(SharkBlock::can_reach): Likewise.
(SharkBlock::can_reach_helper): Likewise.
diffstat:
5 files changed, 79 insertions(+), 6 deletions(-)
ChangeLog | 20 ++++++
ports/hotspot/src/share/vm/shark/sharkBlock.cpp | 10 +--
ports/hotspot/src/share/vm/shark/sharkBlock.hpp | 2
ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 45 +++++++++++++++
ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 8 ++
diffs (153 lines):
diff -r 1c47ca6df830 -r e3339b19c3d9 ChangeLog
--- a/ChangeLog Fri May 29 10:12:01 2009 +0100
+++ b/ChangeLog Fri May 29 12:38:51 2009 +0100
@@ -1,3 +1,23 @@ 2009-05-29 Gary Benson <gbenson at redhat
+2009-05-29 Gary Benson <gbenson at redhat.com>
+
+ * ports/hotspot/src/share/vm/shark/sharkBlock.hpp
+ (SharkBlock::maybe_add_safepoint): Replaced with...
+ (SharkBlock::maybe_add_backedge_safepoint): New method.
+ * ports/hotspot/src/share/vm/shark/sharkBlock.cpp
+ (SharkBlock::maybe_add_safepoint): Replaced with...
+ (SharkBlock::maybe_add_backedge_safepoint): New method.
+ (SharkBlock::parse_bytecode): Updated for above.
+
+ * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
+ (SharkBlock::maybe_add_backedge_safepoint): New method.
+ (SharkBlock::_can_reach_visited): New field.
+ (SharkBlock::can_reach): New method.
+ (SharkBlock::can_reach_helper): Likewise.
+ * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
+ (SharkBlock::maybe_add_backedge_safepoint): New method.
+ (SharkBlock::can_reach): Likewise.
+ (SharkBlock::can_reach_helper): Likewise.
+
2009-05-29 Gary Benson <gbenson at redhat.com>
* ports/hotspot/src/share/vm/shark/sharkState.hpp
diff -r 1c47ca6df830 -r e3339b19c3d9 ports/hotspot/src/share/vm/shark/sharkBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri May 29 10:12:01 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri May 29 12:38:51 2009 +0100
@@ -74,24 +74,24 @@ void SharkBlock::parse_bytecode(int star
case Bytecodes::_if_icmpgt:
case Bytecodes::_if_icmpge:
if (iter()->get_dest() <= bci())
- maybe_add_safepoint();
+ maybe_add_backedge_safepoint();
break;
case Bytecodes::_goto_w:
if (iter()->get_far_dest() <= bci())
- maybe_add_safepoint();
+ maybe_add_backedge_safepoint();
break;
case Bytecodes::_tableswitch:
case Bytecodes::_lookupswitch:
if (switch_default_dest() <= bci()) {
- maybe_add_safepoint();
+ maybe_add_backedge_safepoint();
break;
}
int len = switch_table_length();
for (int i = 0; i < len; i++) {
if (switch_dest(i) <= bci()) {
- maybe_add_safepoint();
+ maybe_add_backedge_safepoint();
break;
}
}
@@ -1138,7 +1138,7 @@ void SharkBlock::do_zero_check(SharkValu
ShouldNotCallThis();
}
-void SharkBlock::maybe_add_safepoint()
+void SharkBlock::maybe_add_backedge_safepoint()
{
ShouldNotCallThis();
}
diff -r 1c47ca6df830 -r e3339b19c3d9 ports/hotspot/src/share/vm/shark/sharkBlock.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri May 29 10:12:01 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri May 29 12:38:51 2009 +0100
@@ -231,7 +231,7 @@ class SharkBlock : public ResourceObj {
// Safepoints
protected:
- virtual void maybe_add_safepoint();
+ virtual void maybe_add_backedge_safepoint();
// Traps
protected:
diff -r 1c47ca6df830 -r e3339b19c3d9 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri May 29 10:12:01 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri May 29 12:38:51 2009 +0100
@@ -469,6 +469,51 @@ void SharkTopLevelBlock::maybe_add_safep
current_state()->set_has_safepointed(true);
}
+void SharkTopLevelBlock::maybe_add_backedge_safepoint()
+{
+ if (current_state()->has_safepointed())
+ return;
+
+ for (int i = 0; i < num_successors(); i++) {
+ if (successor(i)->can_reach(this)) {
+ maybe_add_safepoint();
+ break;
+ }
+ }
+}
+
+bool SharkTopLevelBlock::can_reach(SharkTopLevelBlock* other)
+{
+ for (int i = 0; i < function()->block_count(); i++)
+ function()->block(i)->_can_reach_visited = false;
+
+ return can_reach_helper(other);
+}
+
+bool SharkTopLevelBlock::can_reach_helper(SharkTopLevelBlock* other)
+{
+ if (this == other)
+ return true;
+
+ if (_can_reach_visited)
+ return false;
+ _can_reach_visited = true;
+
+ if (!has_trap()) {
+ for (int i = 0; i < num_successors(); i++) {
+ if (successor(i)->can_reach_helper(other))
+ return true;
+ }
+ }
+
+ for (int i = 0; i < num_exceptions(); i++) {
+ if (exception(i)->can_reach_helper(other))
+ return true;
+ }
+
+ return false;
+}
+
void SharkTopLevelBlock::do_trap(int trap_request)
{
current_state()->decache_for_trap();
diff -r 1c47ca6df830 -r e3339b19c3d9 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri May 29 10:12:01 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri May 29 12:38:51 2009 +0100
@@ -311,6 +311,14 @@ class SharkTopLevelBlock : public SharkB
// Safepoints
private:
void maybe_add_safepoint();
+ void maybe_add_backedge_safepoint();
+
+ // Loop safepoint removal
+ private:
+ bool _can_reach_visited;
+
+ bool can_reach(SharkTopLevelBlock* other);
+ bool can_reach_helper(SharkTopLevelBlock* other);
// Traps
private:
More information about the distro-pkg-dev
mailing list