changeset 2251:86213d4d475a

Use new stack overflow code in Shark. 2010-05-07 Gary Benson <gbenson@redhat.com> * ports/hotspot/src/share/vm/shark/sharkRuntime.cpp (SharkRuntime::uncommon_trap): Use new stack overflow code. (FakeStubFrame::build): Likewise. * ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp: Updated. * ports/hotspot/src/share/vm/includeDB_shark: Likewise. * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp (SharkDecacher::end_frame): Updated for newer HotSpot.
author Gary Benson <gbenson@redhat.com>
date Fri, 07 May 2010 10:49:34 +0100
parents 1852744c5c16
children 254a1f83b7da
files ChangeLog ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp ports/hotspot/src/share/vm/includeDB_shark ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp ports/hotspot/src/share/vm/shark/sharkRuntime.cpp
diffstat 5 files changed, 32 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jun 09 17:44:09 2010 +0100
+++ b/ChangeLog	Fri May 07 10:49:34 2010 +0100
@@ -74,6 +74,16 @@
 	(inTrustedCallChain): New method. Returns if given class/method is
 	in the call chain, and everything upto there is trusted.
 
+2010-05-07  Gary Benson  <gbenson@redhat.com>
+
+	* ports/hotspot/src/share/vm/shark/sharkRuntime.cpp
+	(SharkRuntime::uncommon_trap): Use new stack overflow code.
+	(FakeStubFrame::build): Likewise.
+	* ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp: Updated.
+	* ports/hotspot/src/share/vm/includeDB_shark: Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp
+	(SharkDecacher::end_frame): Updated for newer HotSpot.
+
 2010-05-05  Gary Benson  <gbenson@redhat.com>
 
 	PR icedtea/481
--- a/ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp	Wed Jun 09 17:44:09 2010 +0100
+++ b/ports/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp	Fri May 07 10:49:34 2010 +0100
@@ -47,6 +47,7 @@
 
 define_pd_global(intx,     OnStackReplacePercentage,     933  );
 define_pd_global(intx,     FreqInlineSize,               325  );
+define_pd_global(intx,     InlineSmallCode,              1000 );
 define_pd_global(intx,     NewRatio,                     12   );
 define_pd_global(intx,     NewSizeThreadIncrease,        4*K  );
 define_pd_global(intx,     InitialCodeCacheSize,         160*K);
--- a/ports/hotspot/src/share/vm/includeDB_shark	Wed Jun 09 17:44:09 2010 +0100
+++ b/ports/hotspot/src/share/vm/includeDB_shark	Fri May 07 10:49:34 2010 +0100
@@ -1,6 +1,6 @@
 //
 // Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
-// Copyright 2008, 2009 Red Hat, Inc.
+// Copyright 2008, 2009, 2010 Red Hat, Inc.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
@@ -273,6 +273,7 @@
 sharkRuntime.cpp                        llvmHeaders.hpp
 sharkRuntime.cpp                        klassOop.hpp
 sharkRuntime.cpp                        sharkRuntime.hpp
+sharkRuntime.cpp                        stack_<arch>.inline.hpp
 sharkRuntime.cpp                        thread.hpp
 
 sharkRuntime.hpp                        allocation.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp	Wed Jun 09 17:44:09 2010 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp	Fri May 07 10:49:34 2010 +0100
@@ -149,6 +149,7 @@
     pc_offset(),
     target(),
     bci(),
+    true,
     debug_info()->create_scope_values(locarray()),
     debug_info()->create_scope_values(exparray()),
     debug_info()->create_monitor_values(monarray()));
--- a/ports/hotspot/src/share/vm/shark/sharkRuntime.cpp	Wed Jun 09 17:44:09 2010 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkRuntime.cpp	Fri May 07 10:49:34 2010 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
+ * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -195,10 +195,12 @@
 void SharkRuntime::uncommon_trap(JavaThread* thread, int trap_request) {
   // In C2, uncommon_trap_blob creates a frame, so all the various
   // deoptimization functions expect to find the frame of the method
-  // being deopted one frame down on the stack.  Create a dummy frame
-  // to mirror this.
-  ZeroStack *stack = thread->zero_stack();
-  thread->push_zero_frame(FakeStubFrame::build(stack));
+  // being deopted one frame down on the stack.  We create a dummy
+  // frame to mirror this.
+  FakeStubFrame *stubframe = FakeStubFrame::build(thread);
+  if (thread->has_pending_exception())
+    return;
+  thread->push_zero_frame(stubframe);
 
   // Initiate the trap
   thread->set_last_Java_frame();
@@ -214,11 +216,17 @@
   int number_of_frames = urb->number_of_frames();
   for (int i = 0; i < number_of_frames; i++) {
     intptr_t size = urb->frame_sizes()[i];
-    thread->push_zero_frame(InterpreterFrame::build(stack, size));
+    InterpreterFrame *frame = InterpreterFrame::build(size, thread);
+    if (thread->has_pending_exception())
+      return;
+    thread->push_zero_frame(frame);
   }
 
   // Push another dummy frame
-  thread->push_zero_frame(FakeStubFrame::build(stack));
+  stubframe = FakeStubFrame::build(thread);
+  if (thread->has_pending_exception())
+    return;
+  thread->push_zero_frame(stubframe);
 
   // Fill in the skeleton frames
   thread->set_last_Java_frame();
@@ -236,10 +244,9 @@
 #endif // CC_INTERP
 }
 
-FakeStubFrame* FakeStubFrame::build(ZeroStack* stack) {
-  if (header_words > stack->available_words()) {
-    Unimplemented();
-  }
+FakeStubFrame* FakeStubFrame::build(TRAPS) {
+  ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack();
+  stack->overflow_check(header_words, CHECK_NULL);
 
   stack->push(0); // next_frame, filled in later
   intptr_t *fp = stack->sp();