changeset in /hg/icedtea: 2009-05-29 Gary Benson <gbenson at redh...
Gary Benson
gbenson at redhat.com
Wed Jun 10 13:45:33 PDT 2009
changeset 8172797b7706 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=8172797b7706
description:
2009-05-29 Gary Benson <gbenson at redhat.com>
* ports/hotspot/src/share/vm/shark/sharkState.hpp
(SharkState::_has_safepointed): New field.
(SharkState::has_safepointed): New method.
(SharkState::set_has_safepointed): Likewise.
* ports/hotspot/src/share/vm/shark/sharkState.cpp
(SharkState::SharkState): Initialize the above.
(SharkState::equal_to): Compare the above.
(SharkState::merge): Merge the above.
* ports/hotspot/src/share/vm/shark/sharkBlock.hpp
(SharkBlock::add_safepoint): Replaced with...
(SharkBlock::maybe_add_safepoint): New method.
* ports/hotspot/src/share/vm/shark/sharkBlock.cpp
(SharkBlock::add_safepoint): Replaced with...
(SharkBlock::maybe_add_safepoint): New method.
(SharkBlock::parse_bytecode): Updated for above.
* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
(SharkTopLevelBlock::add_safepoint): Replaced with...
(SharkTopLevelBlock::maybe_add_safepoint): New method.
(SharkTopLevelBlock::call_vm): Mark that a safepoint check
has occurred if a full VM call is made.
* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
(SharkTopLevelBlock::add_safepoint): Replaced with...
(SharkTopLevelBlock::maybe_add_safepoint): New method.
(SharkTopLevelBlock::do_return): Updated for above.
(SharkTopLevelBlock::do_call): Mark that a safepoint check
has occurred if a non-inlined Java call is made.
diffstat:
7 files changed, 74 insertions(+), 13 deletions(-)
ChangeLog | 31 +++++++++++++++
ports/hotspot/src/share/vm/shark/sharkBlock.cpp | 10 ++--
ports/hotspot/src/share/vm/shark/sharkBlock.hpp | 2
ports/hotspot/src/share/vm/shark/sharkState.cpp | 12 ++++-
ports/hotspot/src/share/vm/shark/sharkState.hpp | 12 +++++
ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 14 +++++-
ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 6 +-
diffs (232 lines):
diff -r 6e7eb4f8bc66 -r 8172797b7706 ChangeLog
--- a/ChangeLog Thu May 28 16:56:19 2009 +0100
+++ b/ChangeLog Fri May 29 10:12:01 2009 +0100
@@ -1,3 +1,34 @@ 2009-05-28 Gary Benson <gbenson at redhat
+2009-05-29 Gary Benson <gbenson at redhat.com>
+
+ * ports/hotspot/src/share/vm/shark/sharkState.hpp
+ (SharkState::_has_safepointed): New field.
+ (SharkState::has_safepointed): New method.
+ (SharkState::set_has_safepointed): Likewise.
+ * ports/hotspot/src/share/vm/shark/sharkState.cpp
+ (SharkState::SharkState): Initialize the above.
+ (SharkState::equal_to): Compare the above.
+ (SharkState::merge): Merge the above.
+
+ * ports/hotspot/src/share/vm/shark/sharkBlock.hpp
+ (SharkBlock::add_safepoint): Replaced with...
+ (SharkBlock::maybe_add_safepoint): New method.
+ * ports/hotspot/src/share/vm/shark/sharkBlock.cpp
+ (SharkBlock::add_safepoint): Replaced with...
+ (SharkBlock::maybe_add_safepoint): New method.
+ (SharkBlock::parse_bytecode): Updated for above.
+
+ * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
+ (SharkTopLevelBlock::add_safepoint): Replaced with...
+ (SharkTopLevelBlock::maybe_add_safepoint): New method.
+ (SharkTopLevelBlock::call_vm): Mark that a safepoint check
+ has occurred if a full VM call is made.
+ * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
+ (SharkTopLevelBlock::add_safepoint): Replaced with...
+ (SharkTopLevelBlock::maybe_add_safepoint): New method.
+ (SharkTopLevelBlock::do_return): Updated for above.
+ (SharkTopLevelBlock::do_call): Mark that a safepoint check
+ has occurred if a non-inlined Java call is made.
+
2009-05-28 Gary Benson <gbenson at redhat.com>
* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
diff -r 6e7eb4f8bc66 -r 8172797b7706 ports/hotspot/src/share/vm/shark/sharkBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Thu May 28 16:56:19 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri May 29 10:12:01 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())
- add_safepoint();
+ maybe_add_safepoint();
break;
case Bytecodes::_goto_w:
if (iter()->get_far_dest() <= bci())
- add_safepoint();
+ maybe_add_safepoint();
break;
case Bytecodes::_tableswitch:
case Bytecodes::_lookupswitch:
if (switch_default_dest() <= bci()) {
- add_safepoint();
+ maybe_add_safepoint();
break;
}
int len = switch_table_length();
for (int i = 0; i < len; i++) {
if (switch_dest(i) <= bci()) {
- add_safepoint();
+ maybe_add_safepoint();
break;
}
}
@@ -1138,7 +1138,7 @@ void SharkBlock::do_zero_check(SharkValu
ShouldNotCallThis();
}
-void SharkBlock::add_safepoint()
+void SharkBlock::maybe_add_safepoint()
{
ShouldNotCallThis();
}
diff -r 6e7eb4f8bc66 -r 8172797b7706 ports/hotspot/src/share/vm/shark/sharkBlock.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Thu May 28 16:56:19 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri May 29 10:12:01 2009 +0100
@@ -231,7 +231,7 @@ class SharkBlock : public ResourceObj {
// Safepoints
protected:
- virtual void add_safepoint();
+ virtual void maybe_add_safepoint();
// Traps
protected:
diff -r 6e7eb4f8bc66 -r 8172797b7706 ports/hotspot/src/share/vm/shark/sharkState.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkState.cpp Thu May 28 16:56:19 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri May 29 10:12:01 2009 +0100
@@ -33,7 +33,8 @@ SharkState::SharkState(SharkBlock* block
_function(function),
_method(NULL),
_oop_tmp(NULL),
- _frame_cache(NULL)
+ _frame_cache(NULL),
+ _has_safepointed(false)
{
initialize(NULL);
}
@@ -43,7 +44,8 @@ SharkState::SharkState(SharkBlock* block
_function(state->function()),
_method(state->method()),
_oop_tmp(state->oop_tmp()),
- _frame_cache(NULL)
+ _frame_cache(NULL),
+ _has_safepointed(state->has_safepointed())
{
initialize(state);
}
@@ -103,6 +105,9 @@ bool SharkState::equal_to(SharkState *ot
return false;
if (num_monitors() != other->num_monitors())
+ return false;
+
+ if (has_safepointed() != other->has_safepointed())
return false;
// Local variables
@@ -215,6 +220,9 @@ void SharkState::merge(SharkState* other
// Frame cache
frame_cache()->merge(other->frame_cache());
+
+ // Safepointed status
+ set_has_safepointed(this->has_safepointed() && other->has_safepointed());
}
void SharkState::decache_for_Java_call(ciMethod* callee)
diff -r 6e7eb4f8bc66 -r 8172797b7706 ports/hotspot/src/share/vm/shark/sharkState.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkState.hpp Thu May 28 16:56:19 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkState.hpp Fri May 29 10:12:01 2009 +0100
@@ -45,6 +45,7 @@ class SharkState : public ResourceObj {
SharkValue** _sp;
int _num_monitors;
llvm::Value* _oop_tmp;
+ bool _has_safepointed;
public:
SharkBlock *block() const
@@ -159,6 +160,17 @@ class SharkState : public ResourceObj {
void set_oop_tmp(llvm::Value* oop_tmp)
{
_oop_tmp = oop_tmp;
+ }
+
+ // Safepointed status
+ public:
+ bool has_safepointed() const
+ {
+ return _has_safepointed;
+ }
+ void set_has_safepointed(bool has_safepointed)
+ {
+ _has_safepointed = has_safepointed;
}
// Comparison
diff -r 6e7eb4f8bc66 -r 8172797b7706 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu May 28 16:56:19 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri May 29 10:12:01 2009 +0100
@@ -435,8 +435,11 @@ void SharkTopLevelBlock::handle_exceptio
handle_return(T_VOID, exception);
}
-void SharkTopLevelBlock::add_safepoint()
-{
+void SharkTopLevelBlock::maybe_add_safepoint()
+{
+ if (current_state()->has_safepointed())
+ return;
+
BasicBlock *orig_block = builder()->GetInsertBlock();
SharkState *orig_state = current_state()->copy();
@@ -462,6 +465,8 @@ void SharkTopLevelBlock::add_safepoint()
builder()->SetInsertPoint(safepointed);
current_state()->merge(orig_state, orig_block, safepointed_block);
+
+ current_state()->set_has_safepointed(true);
}
void SharkTopLevelBlock::do_trap(int trap_request)
@@ -720,7 +725,7 @@ void SharkTopLevelBlock::do_return(Basic
{
if (target()->intrinsic_id() == vmIntrinsics::_Object_init)
call_register_finalizer(local(0)->jobject_value());
- add_safepoint();
+ maybe_add_safepoint();
handle_return(type, NULL);
}
@@ -1142,6 +1147,9 @@ void SharkTopLevelBlock::do_call()
// Check for pending exceptions
check_pending_exception(EX_CHECK_FULL);
+
+ // Mark that a safepoint check has occurred
+ current_state()->set_has_safepointed(true);
}
void SharkTopLevelBlock::do_instance_check()
diff -r 6e7eb4f8bc66 -r 8172797b7706 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu May 28 16:56:19 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri May 29 10:12:01 2009 +0100
@@ -257,8 +257,10 @@ class SharkTopLevelBlock : public SharkB
llvm::CallInst *res = builder()->CreateCall(callee, args_start, args_end);
function()->reset_last_Java_frame();
current_state()->cache_after_VM_call();
- if (ea != EX_CHECK_NONE)
+ if (ea != EX_CHECK_NONE) {
check_pending_exception(ea);
+ current_state()->set_has_safepointed(true);
+ }
return res;
}
@@ -308,7 +310,7 @@ class SharkTopLevelBlock : public SharkB
// Safepoints
private:
- void add_safepoint();
+ void maybe_add_safepoint();
// Traps
private:
More information about the distro-pkg-dev
mailing list