changeset 13039:42790b7e4d48

Merge
author mgronlun
date Fri, 01 Nov 2013 15:56:06 +0100
parents c8fc12209830 (diff) 0836a3c28c6a (current diff)
children f8b56489e455
files src/cpu/x86/vm/templateTable_x86_32.cpp src/cpu/x86/vm/templateTable_x86_64.cpp
diffstat 6 files changed, 25 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/interp_masm_x86_32.cpp	Thu Oct 31 15:04:43 2013 -0700
+++ b/src/cpu/x86/vm/interp_masm_x86_32.cpp	Fri Nov 01 15:56:06 2013 +0100
@@ -196,7 +196,7 @@
 
 void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) {
   assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
-  movl(reg, Address(rsi, bcp_offset));
+  load_unsigned_short(reg, Address(rsi, bcp_offset));
   bswapl(reg);
   shrl(reg, 16);
 }
--- a/src/cpu/x86/vm/interp_masm_x86_64.cpp	Thu Oct 31 15:04:43 2013 -0700
+++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp	Fri Nov 01 15:56:06 2013 +0100
@@ -192,7 +192,7 @@
   Register reg,
   int bcp_offset) {
   assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
-  movl(reg, Address(r13, bcp_offset));
+  load_unsigned_short(reg, Address(r13, bcp_offset));
   bswapl(reg);
   shrl(reg, 16);
 }
--- a/src/cpu/x86/vm/templateTable_x86_32.cpp	Thu Oct 31 15:04:43 2013 -0700
+++ b/src/cpu/x86/vm/templateTable_x86_32.cpp	Fri Nov 01 15:56:06 2013 +0100
@@ -558,7 +558,7 @@
 
 
 void TemplateTable::locals_index_wide(Register reg) {
-  __ movl(reg, at_bcp(2));
+  __ load_unsigned_short(reg, at_bcp(2));
   __ bswapl(reg);
   __ shrl(reg, 16);
   __ negptr(reg);
@@ -1552,7 +1552,11 @@
                               InvocationCounter::counter_offset();
 
   // Load up EDX with the branch displacement
-  __ movl(rdx, at_bcp(1));
+  if (is_wide) {
+    __ movl(rdx, at_bcp(1));
+  } else {
+    __ load_signed_short(rdx, at_bcp(1));
+  }
   __ bswapl(rdx);
   if (!is_wide) __ sarl(rdx, 16);
   LP64_ONLY(__ movslq(rdx, rdx));
--- a/src/cpu/x86/vm/templateTable_x86_64.cpp	Thu Oct 31 15:04:43 2013 -0700
+++ b/src/cpu/x86/vm/templateTable_x86_64.cpp	Fri Nov 01 15:56:06 2013 +0100
@@ -568,7 +568,7 @@
 }
 
 void TemplateTable::locals_index_wide(Register reg) {
-  __ movl(reg, at_bcp(2));
+  __ load_unsigned_short(reg, at_bcp(2));
   __ bswapl(reg);
   __ shrl(reg, 16);
   __ negptr(reg);
@@ -1575,7 +1575,11 @@
                               InvocationCounter::counter_offset();
 
   // Load up edx with the branch displacement
-  __ movl(rdx, at_bcp(1));
+  if (is_wide) {
+    __ movl(rdx, at_bcp(1));
+  } else {
+    __ load_signed_short(rdx, at_bcp(1));
+  }
   __ bswapl(rdx);
 
   if (!is_wide) {
--- a/src/share/vm/classfile/defaultMethods.cpp	Thu Oct 31 15:04:43 2013 -0700
+++ b/src/share/vm/classfile/defaultMethods.cpp	Fri Nov 01 15:56:06 2013 +0100
@@ -392,10 +392,16 @@
     }
 
     GrowableArray<Method*> qualified_methods;
+    int num_defaults = 0;
+    int default_index = -1;
     for (int i = 0; i < _members.length(); ++i) {
       Pair<Method*,QualifiedState> entry = _members.at(i);
       if (entry.second == QUALIFIED) {
         qualified_methods.append(entry.first);
+        default_index++;
+        if (entry.first->is_default_method()) {
+          num_defaults++;
+        }
       }
     }
 
@@ -408,6 +414,9 @@
       if (!method->is_abstract()) {
         _selected_target = qualified_methods.at(0);
       }
+      // If only one qualified method is default, select that
+    } else if (num_defaults == 1) {
+        _selected_target = qualified_methods.at(default_index);
     } else {
       _exception_message = generate_conflicts_message(&qualified_methods,CHECK);
       _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
--- a/src/share/vm/memory/metaspace.cpp	Thu Oct 31 15:04:43 2013 -0700
+++ b/src/share/vm/memory/metaspace.cpp	Fri Nov 01 15:56:06 2013 +0100
@@ -2869,7 +2869,7 @@
 
   Universe::set_narrow_klass_base(lower_base);
 
-  if ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax) {
+  if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) {
     Universe::set_narrow_klass_shift(0);
   } else {
     assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces");
@@ -2885,7 +2885,7 @@
   address lower_base = MIN2((address)metaspace_base, cds_base);
   address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()),
                                 (address)(metaspace_base + compressed_class_space_size()));
-  return ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax);
+  return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax);
 }
 
 // Try to allocate the metaspace at the requested addr.