/hg/release/icedtea7-forest-2.3/hotspot: 5 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Tue Oct 16 13:38:04 PDT 2012


changeset d1d78d586dca in /hg/release/icedtea7-forest-2.3/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot?cmd=changeset;node=d1d78d586dca
author: kvn
date: Wed May 23 12:11:25 2012 -0700

	7158801: Improve VM CompileOnly option
	Summary: Fixed buffer overflow during parsing flags -XX:CompileCommand=, -XX:CompileOnly= and command lines in .hotspot_compiler file.
	Reviewed-by: never


changeset ece7163f52f0 in /hg/release/icedtea7-forest-2.3/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot?cmd=changeset;node=ece7163f52f0
author: kamg
date: Fri Jun 08 12:49:52 2012 -0400

	7158804: Improve config file parsing
	Summary: Check buffer length when reading
	Reviewed-by: dholmes, dcubed


changeset ae2d26a44633 in /hg/release/icedtea7-forest-2.3/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot?cmd=changeset;node=ae2d26a44633
author: kvn
date: Mon Jun 18 09:50:43 2012 -0700

	7158807: Revise stack management with volatile call sites
	Summary: Add missing stack banging into method handle assebly code and throw a StackOverflowError.
	Reviewed-by: jrose, twisti


changeset 0885feeea95c in /hg/release/icedtea7-forest-2.3/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot?cmd=changeset;node=0885feeea95c
author: kvn
date: Wed Sep 19 21:14:10 2012 -0700

	7198606: Improve VM optimization
	Reviewed-by: roland, twisti


changeset d2d0a106917c in /hg/release/icedtea7-forest-2.3/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot?cmd=changeset;node=d2d0a106917c
author: andrew
date: Tue Oct 16 21:36:40 2012 +0100

	Added tag icedtea-2.3.3 for changeset 0885feeea95c


diffstat:

 .hgtags                                  |   1 +
 src/cpu/sparc/vm/methodHandles_sparc.cpp |  31 ++++++++++++++++++++++++++
 src/cpu/x86/vm/methodHandles_x86.cpp     |  38 +++++++++++++++++++++++++++++--
 src/share/vm/compiler/compilerOracle.cpp |   4 +-
 src/share/vm/opto/loopTransform.cpp      |   3 ++
 src/share/vm/runtime/arguments.cpp       |   2 +-
 6 files changed, 73 insertions(+), 6 deletions(-)

diffs (194 lines):

diff -r ea39d76b3bde -r d2d0a106917c .hgtags
--- a/.hgtags	Thu Aug 30 20:29:26 2012 +0100
+++ b/.hgtags	Tue Oct 16 21:36:40 2012 +0100
@@ -330,3 +330,4 @@
 eede732f62dd73953dce03e003415729c6c335b2 icedtea-2.3
 c798442fa4c00ad251f6cbe989d32485845bf247 icedtea-2.3.1
 2a413d946cb1acdcbe1110098f79b7a1f267bf75 icedtea-2.3.2
+0885feeea95caa8b92f46234872f0c3839d8850b icedtea-2.3.3
diff -r ea39d76b3bde -r d2d0a106917c src/cpu/sparc/vm/methodHandles_sparc.cpp
--- a/src/cpu/sparc/vm/methodHandles_sparc.cpp	Thu Aug 30 20:29:26 2012 +0100
+++ b/src/cpu/sparc/vm/methodHandles_sparc.cpp	Tue Oct 16 21:36:40 2012 +0100
@@ -698,6 +698,17 @@
   if (arg_slots.is_constant() && arg_slots.as_constant() == 0)
     return;
 
+  // We have to insert at least one word, so bang the stack.
+  if (UseStackBanging) {
+    // Save G3_method_handle since bang_stack_with_offset uses it as a temp register
+    __ mov(G3_method_handle, temp_reg);
+    int frame_size = (arg_slots.is_constant() ? -1 * arg_slots.as_constant() * wordSize : 0);
+    if (frame_size <= 0)
+      frame_size = 256 * Interpreter::stackElementSize;  // conservative
+    __ generate_stack_overflow_check(frame_size);
+    __ mov(temp_reg, G3_method_handle);
+  }
+
   assert_different_registers(argslot_reg, temp_reg, temp2_reg, temp3_reg,
                              (!arg_slots.is_register() ? Gargs : arg_slots.as_register()));
 
@@ -1702,6 +1713,14 @@
                         "copied argument(s) must fall within current frame");
       }
 
+      if (UseStackBanging) {
+        // Save G3_method_handle since bang_stack_with_offset uses it as a temp register
+        __ mov(G3_method_handle, O3_scratch);
+         // Bang the stack before pushing args.
+        int frame_size = 256 * Interpreter::stackElementSize;  // conservative
+        __ generate_stack_overflow_check(frame_size + sizeof(RicochetFrame));
+        __ mov(O3_scratch, G3_method_handle);
+      }
       // insert location is always the bottom of the argument list:
       __ neg(O1_stack_move);
       push_arg_slots(_masm, O0_argslot, O1_stack_move, O2_scratch, O3_scratch);
@@ -2118,6 +2137,18 @@
       // The return handler will further cut back the stack when it takes
       // down the RF.  Perhaps there is a way to streamline this further.
 
+      if (UseStackBanging) {
+        // Save G3_method_handle since bang_stack_with_offset uses it as a temp register
+        __ mov(G3_method_handle, O4_scratch);
+        // Bang the stack before recursive call.
+        // Even if slots == 0, we are inside a RicochetFrame.
+        int frame_size = collect_count.is_constant() ? collect_count.as_constant() * wordSize : -1;
+        if (frame_size < 0) {
+          frame_size = 256 * Interpreter::stackElementSize;  // conservative
+        }
+        __ generate_stack_overflow_check(frame_size + sizeof(RicochetFrame));
+        __ mov(O4_scratch, G3_method_handle);
+      }
       // State during recursive call:
       // ... keep1 | dest | dest=42 | keep3 | RF... | collect | bounce_pc |
       __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
diff -r ea39d76b3bde -r d2d0a106917c src/cpu/x86/vm/methodHandles_x86.cpp
--- a/src/cpu/x86/vm/methodHandles_x86.cpp	Thu Aug 30 20:29:26 2012 +0100
+++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Tue Oct 16 21:36:40 2012 +0100
@@ -691,6 +691,14 @@
   if (VerifyMethodHandles)
     verify_stack_move(_masm, arg_slots, -1);
 
+  // We have to insert at least one word, so bang the stack.
+  if (UseStackBanging) {
+    int frame_size = (arg_slots.is_constant() ? -1 * arg_slots.as_constant() * wordSize : 0);
+    if (frame_size <= 0)
+      frame_size = 256 * Interpreter::stackElementSize;  // conservative
+    __ generate_stack_overflow_check(frame_size);
+  }
+
   // Make space on the stack for the inserted argument(s).
   // Then pull down everything shallower than rax_argslot.
   // The stacked return address gets pulled down with everything else.
@@ -1769,6 +1777,11 @@
                         "copied argument(s) must fall within current frame");
       }
 
+      if (UseStackBanging) {
+        // Bang the stack before pushing args.
+        int frame_size = 256 * Interpreter::stackElementSize;  // conservative
+        __ generate_stack_overflow_check(frame_size + sizeof(RicochetFrame));
+      }
       // insert location is always the bottom of the argument list:
       Address insert_location = __ argument_address(constant(0));
       int pre_arg_words = insert_location.disp() / wordSize;   // return PC is pushed
@@ -2206,6 +2219,15 @@
       // The return handler will further cut back the stack when it takes
       // down the RF.  Perhaps there is a way to streamline this further.
 
+      if (UseStackBanging) {
+        // Bang the stack before recursive call.
+        // Even if slots == 0, we are inside a RicochetFrame.
+        int frame_size = collect_count.is_constant() ? collect_count.as_constant() * wordSize : -1;
+        if (frame_size < 0) {
+          frame_size = 256 * Interpreter::stackElementSize;  // conservative
+        }
+        __ generate_stack_overflow_check(frame_size + sizeof(RicochetFrame));
+      }
       // State during recursive call:
       // ... keep1 | dest | dest=42 | keep3 | RF... | collect | bounce_pc |
       __ jump_to_method_handle_entry(rcx_recv, rdx_temp);
@@ -2366,10 +2388,15 @@
         // case in a 32-bit version of the VM) we have to save 'rsi'
         // on the stack because later on (at 'L_array_is_empty') 'rsi'
         // will be overwritten.
-        { if (rsi_temp == saved_last_sp)  __ push(saved_last_sp); }
+        if (rsi_temp == saved_last_sp) {
+          __ push(saved_last_sp);
+          // Need to re-push return PC to keep it on stack top.
+          __ lea(saved_last_sp, ExternalAddress(SharedRuntime::ricochet_blob()->bounce_addr()).addr());
+          __ push(saved_last_sp);
+        }
         // Also prepare a handy macro which restores 'rsi' if required.
 #define UNPUSH_RSI                                                      \
-        { if (rsi_temp == saved_last_sp)  __ pop(saved_last_sp); }
+        { if (rsi_temp == saved_last_sp) { __ pop(saved_last_sp); __ pop(saved_last_sp); } }
 
         __ jmp(L_array_is_empty);
         __ bind(L_skip);
@@ -2382,7 +2409,12 @@
       // called in the case of a null pointer exception will not be
       // confused by the extra value on the stack (it expects the
       // return pointer on top of the stack)
-      { if (rsi_temp == saved_last_sp)  __ push(saved_last_sp); }
+      if (rsi_temp == saved_last_sp) {
+        __ push(saved_last_sp);
+        // Need to re-push return PC to keep it on stack top.
+        __ lea(saved_last_sp, ExternalAddress(SharedRuntime::ricochet_blob()->bounce_addr()).addr());
+        __ push(saved_last_sp);
+      }
 
       // Check the array type.
       Register rbx_klass = rbx_temp;
diff -r ea39d76b3bde -r d2d0a106917c src/share/vm/compiler/compilerOracle.cpp
--- a/src/share/vm/compiler/compilerOracle.cpp	Thu Aug 30 20:29:26 2012 +0100
+++ b/src/share/vm/compiler/compilerOracle.cpp	Tue Oct 16 21:36:40 2012 +0100
@@ -575,7 +575,7 @@
   char token[1024];
   int  pos = 0;
   int  c = getc(stream);
-  while(c != EOF) {
+  while(c != EOF && pos < (int)(sizeof(token)-1)) {
     if (c == '\n') {
       token[pos++] = '\0';
       parse_from_line(token);
@@ -596,7 +596,7 @@
   int  pos = 0;
   const char* sp = str;
   int  c = *sp++;
-  while (c != '\0') {
+  while (c != '\0' && pos < (int)(sizeof(token)-1)) {
     if (c == '\n') {
       token[pos++] = '\0';
       parse_line(token);
diff -r ea39d76b3bde -r d2d0a106917c src/share/vm/opto/loopTransform.cpp
--- a/src/share/vm/opto/loopTransform.cpp	Thu Aug 30 20:29:26 2012 +0100
+++ b/src/share/vm/opto/loopTransform.cpp	Tue Oct 16 21:36:40 2012 +0100
@@ -2733,6 +2733,8 @@
   result_mem = new (C, 1) ProjNode(call,TypeFunc::Memory);
   _igvn.register_new_node_with_optimizer(result_mem);
 
+/* Disable following optimization until proper fix (add missing checks).
+
   // If this fill is tightly coupled to an allocation and overwrites
   // the whole body, allow it to take over the zeroing.
   AllocateNode* alloc = AllocateNode::Ideal_allocation(base, this);
@@ -2756,6 +2758,7 @@
 #endif
     }
   }
+*/
 
   // Redirect the old control and memory edges that are outside the loop.
   Node* exit = head->loopexit()->proj_out(0);
diff -r ea39d76b3bde -r d2d0a106917c src/share/vm/runtime/arguments.cpp
--- a/src/share/vm/runtime/arguments.cpp	Thu Aug 30 20:29:26 2012 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Tue Oct 16 21:36:40 2012 +0100
@@ -856,7 +856,7 @@
   bool result         = true;
 
   int c = getc(stream);
-  while(c != EOF) {
+  while(c != EOF && pos < (int)(sizeof(token)-1)) {
     if (in_white_space) {
       if (in_comment) {
         if (c == '\n') in_comment = false;



More information about the distro-pkg-dev mailing list