Merge

Fri, 09 Aug 2013 13:19:00 -0700

author
dcubed
date
Fri, 09 Aug 2013 13:19:00 -0700
changeset 5505
ed7c17e7d45b
parent 5495
39127bb12d32
parent 5503
6222a021d582
child 5506
7b03590c334b

Merge

     1.1 --- a/make/solaris/makefiles/dtrace.make	Fri Aug 09 01:39:11 2013 -0700
     1.2 +++ b/make/solaris/makefiles/dtrace.make	Fri Aug 09 13:19:00 2013 -0700
     1.3 @@ -283,9 +283,9 @@
     1.4  	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
     1.5       $(DTraced_Files) ||\
     1.6    STATUS=$$?;\
     1.7 -	if [ x"$$STATUS" = x"1" -a \
     1.8 -       x`uname -r` = x"5.10" -a \
     1.9 -       x`uname -p` = x"sparc" ]; then\
    1.10 +  if [ x"$$STATUS" = x"1" ]; then \
    1.11 +      if [ x`uname -r` = x"5.10" -a \
    1.12 +           x`uname -p` = x"sparc" ]; then\
    1.13      echo "*****************************************************************";\
    1.14      echo "* If you are building server compiler, and the error message is ";\
    1.15      echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
    1.16 @@ -294,6 +294,20 @@
    1.17      echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
    1.18      echo "* dtrace probes for this build.";\
    1.19      echo "*****************************************************************";\
    1.20 +      elif [ x`uname -r` = x"5.10" ]; then\
    1.21 +    echo "*****************************************************************";\
    1.22 +    echo "* If you are seeing 'syntax error near \"umpiconninfo_t\"' on Solaris";\
    1.23 +    echo "* 10, try doing 'cd /usr/lib/dtrace && gzip mpi.d' as root, ";\
    1.24 +    echo "* or set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
    1.25 +    echo "* to disable dtrace probes for this build.";\
    1.26 +    echo "*****************************************************************";\
    1.27 +      else \
    1.28 +    echo "*****************************************************************";\
    1.29 +    echo "* If you cannot fix dtrace build issues, try to ";\
    1.30 +    echo "* set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
    1.31 +    echo "* to disable dtrace probes for this build.";\
    1.32 +    echo "*****************************************************************";\
    1.33 +      fi; \
    1.34    fi;\
    1.35    exit $$STATUS
    1.36    # Since some DTraced_Files are in LIBJVM.o and they are touched by this
     2.1 --- a/make/windows/create.bat	Fri Aug 09 01:39:11 2013 -0700
     2.2 +++ b/make/windows/create.bat	Fri Aug 09 13:19:00 2013 -0700
     2.3 @@ -1,6 +1,6 @@
     2.4  @echo off
     2.5  REM
     2.6 -REM Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
     2.7 +REM Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     2.8  REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.9  REM
    2.10  REM This code is free software; you can redistribute it and/or modify it
    2.11 @@ -148,7 +148,7 @@
    2.12  
    2.13  REM This is now safe to do.
    2.14  :copyfiles
    2.15 -for /D %%i in (compiler1, compiler2, tiered, core) do (
    2.16 +for /D %%i in (compiler1, compiler2, tiered ) do (
    2.17  if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
    2.18  copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
    2.19  )
    2.20 @@ -156,7 +156,7 @@
    2.21  REM force regneration of ProjectFile
    2.22  if exist %ProjectFile% del %ProjectFile%
    2.23  
    2.24 -for /D %%i in (compiler1, compiler2, tiered, core) do (
    2.25 +for /D %%i in (compiler1, compiler2, tiered ) do (
    2.26  echo -- %%i --
    2.27  echo # Generated file!                                                        >    %HotSpotBuildSpace%\%%i\local.make
    2.28  echo # Changing a variable below and then deleting %ProjectFile% will cause  >>    %HotSpotBuildSpace%\%%i\local.make
     3.1 --- a/make/windows/create_obj_files.sh	Fri Aug 09 01:39:11 2013 -0700
     3.2 +++ b/make/windows/create_obj_files.sh	Fri Aug 09 13:19:00 2013 -0700
     3.3 @@ -73,19 +73,17 @@
     3.4  
     3.5  BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles ${GENERATED}/tracefiles"
     3.6  
     3.7 -if [ -d "${ALTSRC}/share/vm/jfr" ]; then
     3.8 -  BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr"
     3.9 +if [ -d "${ALTSRC}/share/vm/jfr/buffers" ]; then
    3.10    BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/buffers"
    3.11  fi
    3.12  
    3.13  BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/prims/wbtestmethods"
    3.14  
    3.15 -CORE_PATHS="${BASE_PATHS}"
    3.16  # shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
    3.17  if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then
    3.18 -  CORE_PATHS="${CORE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
    3.19 +  BASE_PATHS="${BASE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
    3.20  fi
    3.21 -CORE_PATHS="${CORE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
    3.22 +BASE_PATHS="${BASE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
    3.23  
    3.24  if [ -d "${ALTSRC}/share/vm/c1" ]; then
    3.25    COMPILER1_PATHS="${ALTSRC}/share/vm/c1"
    3.26 @@ -104,12 +102,11 @@
    3.27  
    3.28  # Include dirs per type.
    3.29  case "${TYPE}" in
    3.30 -    "core")      Src_Dirs="${CORE_PATHS}" ;;
    3.31 -    "compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;;
    3.32 -    "compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;;
    3.33 -    "tiered")    Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
    3.34 -    "zero")      Src_Dirs="${CORE_PATHS}" ;;
    3.35 -    "shark")     Src_Dirs="${CORE_PATHS}" ;;
    3.36 +    "compiler1") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;
    3.37 +    "compiler2") Src_Dirs="${BASE_PATHS} ${COMPILER2_PATHS}" ;;
    3.38 +    "tiered")    Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
    3.39 +    "zero")      Src_Dirs="${BASE_PATHS}" ;;
    3.40 +    "shark")     Src_Dirs="${BASE_PATHS}" ;;
    3.41  esac
    3.42  
    3.43  COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*"
    3.44 @@ -122,7 +119,6 @@
    3.45  
    3.46  # Exclude per type.
    3.47  case "${TYPE}" in
    3.48 -    "core")      Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
    3.49      "compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
    3.50      "compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
    3.51      "tiered")    Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
    3.52 @@ -149,9 +145,17 @@
    3.53     Src_Files="${Src_Files}`findsrc ${e}` "
    3.54  done 
    3.55  
    3.56 -Obj_Files=
    3.57 +Obj_Files=" "
    3.58  for e in ${Src_Files}; do
    3.59 -	Obj_Files="${Obj_Files}${e%\.[!.]*}.obj "
    3.60 +        o="${e%\.[!.]*}.obj"
    3.61 +        set +e
    3.62 +        chk=`expr "${Obj_Files}" : ".* $o"`
    3.63 +        set -e
    3.64 +        if [ "$chk" != 0 ]; then
    3.65 +             echo "# INFO: skipping duplicate $o"
    3.66 +             continue
    3.67 +        fi
    3.68 +	Obj_Files="${Obj_Files}$o "
    3.69  done
    3.70  
    3.71  echo Obj_Files=${Obj_Files}
     4.1 --- a/make/windows/makefiles/projectcreator.make	Fri Aug 09 01:39:11 2013 -0700
     4.2 +++ b/make/windows/makefiles/projectcreator.make	Fri Aug 09 13:19:00 2013 -0700
     4.3 @@ -44,10 +44,11 @@
     4.4  
     4.5  # This is only used internally
     4.6  ProjectCreatorIncludesPRIVATE=\
     4.7 -        -relativeInclude src\closed\share\vm \
     4.8 -        -relativeInclude src\closed\os\windows\vm \
     4.9 -        -relativeInclude src\closed\os_cpu\windows_$(Platform_arch)\vm \
    4.10 -        -relativeInclude src\closed\cpu\$(Platform_arch)\vm \
    4.11 +        -relativeAltSrcInclude src\closed \
    4.12 +        -altRelativeInclude share\vm \
    4.13 +        -altRelativeInclude os\windows\vm \
    4.14 +        -altRelativeInclude os_cpu\windows_$(Platform_arch)\vm \
    4.15 +        -altRelativeInclude cpu\$(Platform_arch)\vm \
    4.16          -relativeInclude src\share\vm \
    4.17          -relativeInclude src\share\vm\precompiled \
    4.18          -relativeInclude src\share\vm\prims\wbtestmethods \
    4.19 @@ -91,7 +92,7 @@
    4.20          -disablePch        getThread_windows_$(Platform_arch).cpp \
    4.21          -disablePch_compiler2     opcodes.cpp
    4.22  
    4.23 -# Common options for the IDE builds for core, c1, and c2
    4.24 +# Common options for the IDE builds for c1, and c2
    4.25  ProjectCreatorIDEOptions=\
    4.26          $(ProjectCreatorIDEOptions) \
    4.27          -sourceBase $(HOTSPOTWORKSPACE) \
    4.28 @@ -158,18 +159,10 @@
    4.29   -ignoreFile_TARGET $(Platform_arch_model).ad
    4.30  
    4.31  ##################################################
    4.32 -# Without compiler(core) specific options
    4.33 -##################################################
    4.34 -ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
    4.35 -$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=core) \
    4.36 -$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core)
    4.37 -
    4.38 -##################################################
    4.39  # Client(C1) compiler specific options
    4.40  ##################################################
    4.41  ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
    4.42   -define_compiler1 COMPILER1 \
    4.43 - -ignorePath_compiler1 core \
    4.44  $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
    4.45  
    4.46  ##################################################
    4.47 @@ -178,7 +171,6 @@
    4.48  #NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
    4.49  ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
    4.50   -define_compiler2 COMPILER2 \
    4.51 - -ignorePath_compiler2 core \
    4.52   -additionalFile_compiler2 $(Platform_arch_model).ad \
    4.53   -additionalFile_compiler2 ad_$(Platform_arch_model).cpp \
    4.54   -additionalFile_compiler2 ad_$(Platform_arch_model).hpp \
     5.1 --- a/make/windows/makefiles/trace.make	Fri Aug 09 01:39:11 2013 -0700
     5.2 +++ b/make/windows/makefiles/trace.make	Fri Aug 09 13:19:00 2013 -0700
     5.3 @@ -90,25 +90,25 @@
     5.4  !if "$(OPENJDK)" == "true"
     5.5  
     5.6  $(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventClasses.xsl $(XML_DEPS)
     5.7 -	@echo Generating $@
     5.8 +	@echo Generating OpenJDK $@
     5.9  	@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
    5.10  
    5.11  !else
    5.12  
    5.13  $(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventClasses.xsl $(XML_DEPS)
    5.14 -	@echo Generating $@
    5.15 +	@echo Generating AltSrc $@
    5.16  	@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
    5.17  
    5.18  $(TraceOutDir)/traceProducer.cpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceProducer.xsl $(XML_DEPS)
    5.19 -	@echo Generating $@
    5.20 +	@echo Generating AltSrc $@
    5.21  	@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceProducer.xsl -OUT $(TraceOutDir)/traceProducer.cpp
    5.22  
    5.23  $(TraceOutDir)/traceRequestables.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceRequestables.xsl $(XML_DEPS)
    5.24 -	@echo Generating $@
    5.25 +	@echo Generating AltSrc $@
    5.26  	@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceRequestables.xsl -OUT $(TraceOutDir)/traceRequestables.hpp
    5.27  
    5.28  $(TraceOutDir)/traceEventControl.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventControl.xsl $(XML_DEPS)
    5.29 -	@echo Generating $@
    5.30 +	@echo Generating AltSrc $@
    5.31  	@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventControl.xsl -OUT $(TraceOutDir)/traceEventControl.hpp
    5.32  
    5.33  !endif
     6.1 --- a/make/windows/makefiles/vm.make	Fri Aug 09 01:39:11 2013 -0700
     6.2 +++ b/make/windows/makefiles/vm.make	Fri Aug 09 13:19:00 2013 -0700
     6.3 @@ -36,10 +36,6 @@
     6.4  CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT"
     6.5  !endif
     6.6  
     6.7 -!if "$(Variant)" == "core"
     6.8 -# No need to define anything, CORE is defined as !COMPILER1 && !COMPILER2
     6.9 -!endif
    6.10 -
    6.11  !if "$(Variant)" == "compiler1"
    6.12  CXX_FLAGS=$(CXX_FLAGS) /D "COMPILER1"
    6.13  !endif
     7.1 --- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Fri Aug 09 01:39:11 2013 -0700
     7.2 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Fri Aug 09 13:19:00 2013 -0700
     7.3 @@ -1887,6 +1887,27 @@
     7.4    if (ProfileInterpreter) {
     7.5      __ set_method_data_pointer_for_bcp();
     7.6    }
     7.7 +
     7.8 +#if INCLUDE_JVMTI
     7.9 +  if (EnableInvokeDynamic) {
    7.10 +    Label L_done;
    7.11 +
    7.12 +    __ ldub(Address(Lbcp, 0), G1_scratch);  // Load current bytecode
    7.13 +    __ cmp_and_br_short(G1_scratch, Bytecodes::_invokestatic, Assembler::notEqual, Assembler::pn, L_done);
    7.14 +
    7.15 +    // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
    7.16 +    // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
    7.17 +
    7.18 +    __ call_VM(G1_scratch, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), I0, Lmethod, Lbcp);
    7.19 +
    7.20 +    __ br_null(G1_scratch, false, Assembler::pn, L_done);
    7.21 +    __ delayed()->nop();
    7.22 +
    7.23 +    __ st_ptr(G1_scratch, Lesp, wordSize);
    7.24 +    __ bind(L_done);
    7.25 +  }
    7.26 +#endif // INCLUDE_JVMTI
    7.27 +
    7.28    // Resume bytecode interpretation at the current bcp
    7.29    __ dispatch_next(vtos);
    7.30    // end of JVMTI PopFrame support
     8.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Fri Aug 09 01:39:11 2013 -0700
     8.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Fri Aug 09 13:19:00 2013 -0700
     8.3 @@ -1920,6 +1920,29 @@
     8.4    __ get_thread(thread);
     8.5    __ movl(Address(thread, JavaThread::popframe_condition_offset()), JavaThread::popframe_inactive);
     8.6  
     8.7 +#if INCLUDE_JVMTI
     8.8 +  if (EnableInvokeDynamic) {
     8.9 +    Label L_done;
    8.10 +    const Register local0 = rdi;
    8.11 +
    8.12 +    __ cmpb(Address(rsi, 0), Bytecodes::_invokestatic);
    8.13 +    __ jcc(Assembler::notEqual, L_done);
    8.14 +
    8.15 +    // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
    8.16 +    // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
    8.17 +
    8.18 +    __ get_method(rdx);
    8.19 +    __ movptr(rax, Address(local0, 0));
    8.20 +    __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), rax, rdx, rsi);
    8.21 +
    8.22 +    __ testptr(rax, rax);
    8.23 +    __ jcc(Assembler::zero, L_done);
    8.24 +
    8.25 +    __ movptr(Address(rbx, 0), rax);
    8.26 +    __ bind(L_done);
    8.27 +  }
    8.28 +#endif // INCLUDE_JVMTI
    8.29 +
    8.30    __ dispatch_next(vtos);
    8.31    // end of PopFrame support
    8.32  
     9.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Fri Aug 09 01:39:11 2013 -0700
     9.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Fri Aug 09 13:19:00 2013 -0700
     9.3 @@ -1929,6 +1929,29 @@
     9.4    __ movl(Address(r15_thread, JavaThread::popframe_condition_offset()),
     9.5            JavaThread::popframe_inactive);
     9.6  
     9.7 +#if INCLUDE_JVMTI
     9.8 +  if (EnableInvokeDynamic) {
     9.9 +    Label L_done;
    9.10 +    const Register local0 = r14;
    9.11 +
    9.12 +    __ cmpb(Address(r13, 0), Bytecodes::_invokestatic);
    9.13 +    __ jcc(Assembler::notEqual, L_done);
    9.14 +
    9.15 +    // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
    9.16 +    // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
    9.17 +
    9.18 +    __ get_method(rdx);
    9.19 +    __ movptr(rax, Address(local0, 0));
    9.20 +    __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), rax, rdx, r13);
    9.21 +
    9.22 +    __ testptr(rax, rax);
    9.23 +    __ jcc(Assembler::zero, L_done);
    9.24 +
    9.25 +    __ movptr(Address(rbx, 0), rax);
    9.26 +    __ bind(L_done);
    9.27 +  }
    9.28 +#endif // INCLUDE_JVMTI
    9.29 +
    9.30    __ dispatch_next(vtos);
    9.31    // end of PopFrame support
    9.32  
    10.1 --- a/src/cpu/zero/vm/entryFrame_zero.hpp	Fri Aug 09 01:39:11 2013 -0700
    10.2 +++ b/src/cpu/zero/vm/entryFrame_zero.hpp	Fri Aug 09 13:19:00 2013 -0700
    10.3 @@ -58,8 +58,8 @@
    10.4                             JavaCallWrapper* call_wrapper,
    10.5                             TRAPS);
    10.6   public:
    10.7 -  JavaCallWrapper *call_wrapper() const {
    10.8 -    return (JavaCallWrapper *) value_of_word(call_wrapper_off);
    10.9 +  JavaCallWrapper **call_wrapper() const {
   10.10 +    return (JavaCallWrapper **) addr_of_word(call_wrapper_off);
   10.11    }
   10.12  
   10.13   public:
    11.1 --- a/src/cpu/zero/vm/frame_zero.inline.hpp	Fri Aug 09 01:39:11 2013 -0700
    11.2 +++ b/src/cpu/zero/vm/frame_zero.inline.hpp	Fri Aug 09 13:19:00 2013 -0700
    11.3 @@ -141,7 +141,7 @@
    11.4    return fp();
    11.5  }
    11.6  
    11.7 -inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
    11.8 +inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
    11.9    return zero_entryframe()->call_wrapper();
   11.10  }
   11.11  
    12.1 --- a/src/cpu/zero/vm/stubGenerator_zero.cpp	Fri Aug 09 01:39:11 2013 -0700
    12.2 +++ b/src/cpu/zero/vm/stubGenerator_zero.cpp	Fri Aug 09 13:19:00 2013 -0700
    12.3 @@ -176,6 +176,19 @@
    12.4        StubRoutines::_oop_arraycopy;
    12.5    }
    12.6  
    12.7 +  static int SafeFetch32(int *adr, int errValue) {
    12.8 +    int value = errValue;
    12.9 +    value = *adr;
   12.10 +    return value;
   12.11 +  }
   12.12 +
   12.13 +  static intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
   12.14 +    intptr_t value = errValue;
   12.15 +    value = *adr;
   12.16 +    return value;
   12.17 +  }
   12.18 +
   12.19 +
   12.20    void generate_initial() {
   12.21      // Generates all stubs and initializes the entry points
   12.22  
   12.23 @@ -225,6 +238,15 @@
   12.24  
   12.25      // arraycopy stubs used by compilers
   12.26      generate_arraycopy_stubs();
   12.27 +
   12.28 +    // Safefetch stubs.
   12.29 +    StubRoutines::_safefetch32_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetch32);
   12.30 +    StubRoutines::_safefetch32_fault_pc = NULL;
   12.31 +    StubRoutines::_safefetch32_continuation_pc = NULL;
   12.32 +
   12.33 +    StubRoutines::_safefetchN_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetchN);
   12.34 +    StubRoutines::_safefetchN_fault_pc = NULL;
   12.35 +    StubRoutines::_safefetchN_continuation_pc = NULL;
   12.36    }
   12.37  
   12.38   public:
    13.1 --- a/src/os/bsd/vm/attachListener_bsd.cpp	Fri Aug 09 01:39:11 2013 -0700
    13.2 +++ b/src/os/bsd/vm/attachListener_bsd.cpp	Fri Aug 09 13:19:00 2013 -0700
    13.3 @@ -445,14 +445,14 @@
    13.4  
    13.5  void AttachListener::vm_start() {
    13.6    char fn[UNIX_PATH_MAX];
    13.7 -  struct stat64 st;
    13.8 +  struct stat st;
    13.9    int ret;
   13.10  
   13.11    int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
   13.12             os::get_temp_directory(), os::current_process_id());
   13.13    assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
   13.14  
   13.15 -  RESTARTABLE(::stat64(fn, &st), ret);
   13.16 +  RESTARTABLE(::stat(fn, &st), ret);
   13.17    if (ret == 0) {
   13.18      ret = ::unlink(fn);
   13.19      if (ret == -1) {
    14.1 --- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Fri Aug 09 01:39:11 2013 -0700
    14.2 +++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Fri Aug 09 13:19:00 2013 -0700
    14.3 @@ -410,16 +410,6 @@
    14.4    int SpinPause() {
    14.5    }
    14.6  
    14.7 -  int SafeFetch32(int *adr, int errValue) {
    14.8 -    int value = errValue;
    14.9 -    value = *adr;
   14.10 -    return value;
   14.11 -  }
   14.12 -  intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
   14.13 -    intptr_t value = errValue;
   14.14 -    value = *adr;
   14.15 -    return value;
   14.16 -  }
   14.17  
   14.18    void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
   14.19      if (from > to) {
    15.1 --- a/src/share/tools/ProjectCreator/BuildConfig.java	Fri Aug 09 01:39:11 2013 -0700
    15.2 +++ b/src/share/tools/ProjectCreator/BuildConfig.java	Fri Aug 09 13:19:00 2013 -0700
    15.3 @@ -142,6 +142,69 @@
    15.4          return rv;
    15.5      }
    15.6  
    15.7 +    // Returns true if the specified path refers to a relative alternate
    15.8 +    // source file. RelativeAltSrcInclude is usually "src\closed".
    15.9 +    public static boolean matchesRelativeAltSrcInclude(String path) {
   15.10 +        String relativeAltSrcInclude =
   15.11 +            getFieldString(null, "RelativeAltSrcInclude");
   15.12 +        Vector<String> v = getFieldVector(null, "AltRelativeInclude");
   15.13 +        for (String pathPart : v) {
   15.14 +            if (path.contains(relativeAltSrcInclude + Util.sep + pathPart))  {
   15.15 +                return true;
   15.16 +            }
   15.17 +        }
   15.18 +        return false;
   15.19 +    }
   15.20 +
   15.21 +    // Returns the relative alternate source file for the specified path.
   15.22 +    // Null is returned if the specified path does not have a matching
   15.23 +    // alternate source file.
   15.24 +    public static String getMatchingRelativeAltSrcFile(String path) {
   15.25 +        Vector<String> v = getFieldVector(null, "RelativeAltSrcFileList");
   15.26 +        if (v == null) {
   15.27 +            return null;
   15.28 +        }
   15.29 +        for (String pathPart : v) {
   15.30 +            if (path.endsWith(pathPart)) {
   15.31 +                String relativeAltSrcInclude =
   15.32 +                    getFieldString(null, "RelativeAltSrcInclude");
   15.33 +                return relativeAltSrcInclude + Util.sep + pathPart;
   15.34 +            }
   15.35 +        }
   15.36 +        return null;
   15.37 +    }
   15.38 +
   15.39 +    // Returns true if the specified path has a matching alternate
   15.40 +    // source file.
   15.41 +    public static boolean matchesRelativeAltSrcFile(String path) {
   15.42 +        return getMatchingRelativeAltSrcFile(path) != null;
   15.43 +    }
   15.44 +
   15.45 +    // Track the specified alternate source file. The source file is
   15.46 +    // tracked without the leading .*<sep><RelativeAltSrcFileList><sep>
   15.47 +    // part to make matching regular source files easier.
   15.48 +    public static void trackRelativeAltSrcFile(String path) {
   15.49 +        String pattern = getFieldString(null, "RelativeAltSrcInclude") +
   15.50 +            Util.sep;
   15.51 +        int altSrcInd = path.indexOf(pattern);
   15.52 +        if (altSrcInd == -1) {
   15.53 +            // not an AltSrc path
   15.54 +            return;
   15.55 +        }
   15.56 +
   15.57 +        altSrcInd += pattern.length();
   15.58 +        if (altSrcInd >= path.length()) {
   15.59 +            // not a valid AltSrc path
   15.60 +            return;
   15.61 +        }
   15.62 +
   15.63 +        String altSrcFile = path.substring(altSrcInd);
   15.64 +        Vector v = getFieldVector(null, "RelativeAltSrcFileList");
   15.65 +        if (v == null || !v.contains(altSrcFile)) {
   15.66 +            addFieldVector(null, "RelativeAltSrcFileList", altSrcFile);
   15.67 +        }
   15.68 +    }
   15.69 +
   15.70      void addTo(Hashtable ht, String key, String value) {
   15.71          ht.put(expandFormat(key), expandFormat(value));
   15.72      }
   15.73 @@ -272,8 +335,19 @@
   15.74  
   15.75      private Vector getSourceIncludes() {
   15.76          Vector<String> rv = new Vector<String>();
   15.77 +        String sourceBase = getFieldString(null, "SourceBase");
   15.78 +
   15.79 +        // add relative alternate source include values:
   15.80 +        String relativeAltSrcInclude =
   15.81 +            getFieldString(null, "RelativeAltSrcInclude");
   15.82 +        Vector<String> asri = new Vector<String>();
   15.83 +        collectRelevantVectors(asri, "AltRelativeInclude");
   15.84 +        for (String f : asri) {
   15.85 +            rv.add(sourceBase + Util.sep + relativeAltSrcInclude +
   15.86 +                   Util.sep + f);
   15.87 +        }
   15.88 +
   15.89          Vector<String> ri = new Vector<String>();
   15.90 -        String sourceBase = getFieldString(null, "SourceBase");
   15.91          collectRelevantVectors(ri, "RelativeInclude");
   15.92          for (String f : ri) {
   15.93              rv.add(sourceBase + Util.sep + f);
   15.94 @@ -541,35 +615,6 @@
   15.95      }
   15.96  }
   15.97  
   15.98 -class CoreDebugConfig extends GenericDebugNonKernelConfig {
   15.99 -    String getOptFlag() {
  15.100 -        return getCI().getNoOptFlag();
  15.101 -    }
  15.102 -
  15.103 -    CoreDebugConfig() {
  15.104 -        initNames("core", "debug", "jvm.dll");
  15.105 -        init(getIncludes(), getDefines());
  15.106 -    }
  15.107 -}
  15.108 -
  15.109 -class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
  15.110 -    String getOptFlag() {
  15.111 -        return getCI().getOptFlag();
  15.112 -    }
  15.113 -
  15.114 -    CoreFastDebugConfig() {
  15.115 -        initNames("core", "fastdebug", "jvm.dll");
  15.116 -        init(getIncludes(), getDefines());
  15.117 -    }
  15.118 -}
  15.119 -
  15.120 -class CoreProductConfig extends ProductConfig {
  15.121 -    CoreProductConfig() {
  15.122 -        initNames("core", "product", "jvm.dll");
  15.123 -        init(getIncludes(), getDefines());
  15.124 -    }
  15.125 -}
  15.126 -
  15.127  
  15.128  abstract class CompilerInterface {
  15.129      abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
    16.1 --- a/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java	Fri Aug 09 01:39:11 2013 -0700
    16.2 +++ b/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java	Fri Aug 09 13:19:00 2013 -0700
    16.3 @@ -1,3 +1,27 @@
    16.4 +/*
    16.5 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    16.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.7 + *
    16.8 + * This code is free software; you can redistribute it and/or modify it
    16.9 + * under the terms of the GNU General Public License version 2 only, as
   16.10 + * published by the Free Software Foundation.
   16.11 + *
   16.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   16.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   16.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   16.15 + * version 2 for more details (a copy is included in the LICENSE file that
   16.16 + * accompanied this code).
   16.17 + *
   16.18 + * You should have received a copy of the GNU General Public License version
   16.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   16.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   16.21 + *
   16.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   16.23 + * or visit www.oracle.com if you need additional information or have any
   16.24 + * questions.
   16.25 + *
   16.26 + */
   16.27 +
   16.28  import static java.nio.file.FileVisitResult.CONTINUE;
   16.29  
   16.30  import java.io.IOException;
   16.31 @@ -21,6 +45,8 @@
   16.32           boolean usePch = false;
   16.33           boolean disablePch = false;
   16.34           boolean useIgnore = false;
   16.35 +         boolean isAltSrc = false;  // only needed as a debugging crumb
   16.36 +         boolean isReplacedByAltSrc = false;
   16.37           String fileName = file.getFileName().toString();
   16.38  
   16.39           // TODO hideFile
   16.40 @@ -30,6 +56,26 @@
   16.41              usePch = true;
   16.42           }
   16.43  
   16.44 +         String fileLoc = vcProjLocation.relativize(file).toString();
   16.45 +
   16.46 +         // isAltSrc and isReplacedByAltSrc applies to all configs for a file
   16.47 +         if (BuildConfig.matchesRelativeAltSrcInclude(
   16.48 +               file.toAbsolutePath().toString())) {
   16.49 +            // current file is an alternate source file so track it
   16.50 +            isAltSrc = true;
   16.51 +            BuildConfig.trackRelativeAltSrcFile(
   16.52 +                file.toAbsolutePath().toString());
   16.53 +         } else if (BuildConfig.matchesRelativeAltSrcFile(
   16.54 +                    file.toAbsolutePath().toString())) {
   16.55 +            // current file is a regular file that matches an alternate
   16.56 +            // source file so yack about replacing the regular file
   16.57 +            isReplacedByAltSrc = true;
   16.58 +            System.out.println("INFO: alternate source file '" +
   16.59 +                               BuildConfig.getMatchingRelativeAltSrcFile(
   16.60 +                                   file.toAbsolutePath().toString()) +
   16.61 +                               "' replaces '" + fileLoc + "'");
   16.62 +         }
   16.63 +
   16.64           for (BuildConfig cfg : allConfigs) {
   16.65              if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
   16.66                 useIgnore = true;
   16.67 @@ -58,9 +104,8 @@
   16.68           }
   16.69  
   16.70           String tagName = wg.getFileTagFromSuffix(fileName);
   16.71 -         String fileLoc = vcProjLocation.relativize(file).toString();
   16.72  
   16.73 -         if (!useIgnore && !disablePch && !usePch) {
   16.74 +         if (!useIgnore && !disablePch && !usePch && !isReplacedByAltSrc) {
   16.75              wg.tag(tagName, new String[] { "Include", fileLoc});
   16.76           } else {
   16.77              wg.startTag(
   16.78 @@ -78,6 +123,11 @@
   16.79                 if (disablePch) {
   16.80                    wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
   16.81                 }
   16.82 +               if (isReplacedByAltSrc) {
   16.83 +                  wg.tagData("ExcludedFromBuild", "true", "Condition",
   16.84 +                             "'$(Configuration)|$(Platform)'=='" +
   16.85 +                             cfg.get("Name") + "'");
   16.86 +               }
   16.87              }
   16.88              wg.endTag();
   16.89           }
   16.90 @@ -137,6 +187,4 @@
   16.91        public void writeFileTree() throws IOException {
   16.92           Files.walkFileTree(this.startDir, this);
   16.93        }
   16.94 -
   16.95 -
   16.96 -   }
   16.97 \ No newline at end of file
   16.98 +}
    17.1 --- a/src/share/tools/ProjectCreator/ProjectCreator.java	Fri Aug 09 01:39:11 2013 -0700
    17.2 +++ b/src/share/tools/ProjectCreator/ProjectCreator.java	Fri Aug 09 13:19:00 2013 -0700
    17.3 @@ -1,5 +1,5 @@
    17.4  /*
    17.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
    17.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    17.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    17.8   *
    17.9   * This code is free software; you can redistribute it and/or modify it
   17.10 @@ -39,10 +39,15 @@
   17.11              + "jvm.dll; no trailing slash>");
   17.12        System.err.println("  If any of the above are specified, "
   17.13              + "they must all be.");
   17.14 +      System.err.println("  Note: if '-altRelativeInclude' option below is "
   17.15 +            + "used, then the '-relativeAltSrcInclude' option must be used "
   17.16 +            + "to specify the alternate source dir, e.g., 'src\\closed'");
   17.17        System.err.println("  Additional, optional arguments, which can be "
   17.18              + "specified multiple times:");
   17.19        System.err.println("    -absoluteInclude <string containing absolute "
   17.20              + "path to include directory>");
   17.21 +      System.err.println("    -altRelativeInclude <string containing "
   17.22 +            + "alternate include directory relative to -envVar>");
   17.23        System.err.println("    -relativeInclude <string containing include "
   17.24              + "directory relative to -envVar>");
   17.25        System.err.println("    -define <preprocessor flag to be #defined "
    18.1 --- a/src/share/tools/ProjectCreator/WinGammaPlatform.java	Fri Aug 09 01:39:11 2013 -0700
    18.2 +++ b/src/share/tools/ProjectCreator/WinGammaPlatform.java	Fri Aug 09 13:19:00 2013 -0700
    18.3 @@ -1,5 +1,5 @@
    18.4  /*
    18.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
    18.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    18.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.8   *
    18.9   * This code is free software; you can redistribute it and/or modify it
   18.10 @@ -140,10 +140,17 @@
   18.11                             "already exist>");
   18.12          System.err.println("  If any of the above are specified, "+
   18.13                             "they must all be.");
   18.14 +        System.err.println("  Note: if '-altRelativeInclude' option below " +
   18.15 +                           "is used, then the '-relativeAltSrcInclude' " +
   18.16 +                           "option must be used to specify the alternate " +
   18.17 +                           "source dir, e.g., 'src\\closed'");
   18.18          System.err.println("  Additional, optional arguments, which can be " +
   18.19                             "specified multiple times:");
   18.20          System.err.println("    -absoluteInclude <string containing absolute " +
   18.21                             "path to include directory>");
   18.22 +        System.err.println("    -altRelativeInclude <string containing " +
   18.23 +                           "alternate include directory relative to " +
   18.24 +                           "-sourceBase>");
   18.25          System.err.println("    -relativeInclude <string containing include " +
   18.26                             "directory relative to -sourceBase>");
   18.27          System.err.println("    -define <preprocessor flag to be #defined " +
   18.28 @@ -343,6 +350,12 @@
   18.29                                HsArgHandler.VECTOR
   18.30                                ),
   18.31  
   18.32 +                new HsArgRule("-altRelativeInclude",
   18.33 +                              "AltRelativeInclude",
   18.34 +                              null,
   18.35 +                              HsArgHandler.VECTOR
   18.36 +                              ),
   18.37 +
   18.38                  new HsArgRule("-relativeInclude",
   18.39                                "RelativeInclude",
   18.40                                null,
   18.41 @@ -355,6 +368,12 @@
   18.42                                HsArgHandler.VECTOR
   18.43                                ),
   18.44  
   18.45 +                new HsArgRule("-relativeAltSrcInclude",
   18.46 +                              "RelativeAltSrcInclude",
   18.47 +                              null,
   18.48 +                              HsArgHandler.STRING
   18.49 +                              ),
   18.50 +
   18.51                  new HsArgRule("-relativeSrcInclude",
   18.52                                "RelativeSrcInclude",
   18.53                                null,
   18.54 @@ -560,10 +579,6 @@
   18.55          allConfigs.add(new TieredFastDebugConfig());
   18.56          allConfigs.add(new TieredProductConfig());
   18.57  
   18.58 -        allConfigs.add(new CoreDebugConfig());
   18.59 -        allConfigs.add(new CoreFastDebugConfig());
   18.60 -        allConfigs.add(new CoreProductConfig());
   18.61 -
   18.62          return allConfigs;
   18.63      }
   18.64  
    19.1 --- a/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java	Fri Aug 09 01:39:11 2013 -0700
    19.2 +++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java	Fri Aug 09 13:19:00 2013 -0700
    19.3 @@ -1,3 +1,27 @@
    19.4 +/*
    19.5 + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
    19.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.7 + *
    19.8 + * This code is free software; you can redistribute it and/or modify it
    19.9 + * under the terms of the GNU General Public License version 2 only, as
   19.10 + * published by the Free Software Foundation.
   19.11 + *
   19.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   19.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   19.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   19.15 + * version 2 for more details (a copy is included in the LICENSE file that
   19.16 + * accompanied this code).
   19.17 + *
   19.18 + * You should have received a copy of the GNU General Public License version
   19.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   19.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   19.21 + *
   19.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   19.23 + * or visit www.oracle.com if you need additional information or have any
   19.24 + * questions.
   19.25 + *
   19.26 + */
   19.27 +
   19.28  import java.io.File;
   19.29  import java.io.FileNotFoundException;
   19.30  import java.io.IOException;
   19.31 @@ -24,7 +48,7 @@
   19.32      public void writeProjectFile(String projectFileName, String projectName,
   19.33              Vector<BuildConfig> allConfigs) throws IOException {
   19.34          System.out.println();
   19.35 -        System.out.print("    Writing .vcxproj file: " + projectFileName);
   19.36 +        System.out.println("    Writing .vcxproj file: " + projectFileName);
   19.37  
   19.38          String projDir = Util.normalize(new File(projectFileName).getParent());
   19.39  
   19.40 @@ -114,7 +138,7 @@
   19.41  
   19.42          endTag();
   19.43          printWriter.close();
   19.44 -        System.out.println("    Done.");
   19.45 +        System.out.println("    Done writing .vcxproj file.");
   19.46  
   19.47          writeFilterFile(projectFileName, projectName, allConfigs, projDir);
   19.48          writeUserFile(projectFileName, allConfigs);
    20.1 --- a/src/share/vm/classfile/javaClasses.cpp	Fri Aug 09 01:39:11 2013 -0700
    20.2 +++ b/src/share/vm/classfile/javaClasses.cpp	Fri Aug 09 13:19:00 2013 -0700
    20.3 @@ -2557,6 +2557,26 @@
    20.4    *offset = value;
    20.5  }
    20.6  
    20.7 +// Support for java_lang_invoke_DirectMethodHandle
    20.8 +
    20.9 +int java_lang_invoke_DirectMethodHandle::_member_offset;
   20.10 +
   20.11 +oop java_lang_invoke_DirectMethodHandle::member(oop dmh) {
   20.12 +  oop member_name = NULL;
   20.13 +  bool is_dmh = dmh->is_oop() && java_lang_invoke_DirectMethodHandle::is_instance(dmh);
   20.14 +  assert(is_dmh, "a DirectMethodHandle oop is expected");
   20.15 +  if (is_dmh) {
   20.16 +    member_name = dmh->obj_field(member_offset_in_bytes());
   20.17 +  }
   20.18 +  return member_name;
   20.19 +}
   20.20 +
   20.21 +void java_lang_invoke_DirectMethodHandle::compute_offsets() {
   20.22 +  Klass* klass_oop = SystemDictionary::DirectMethodHandle_klass();
   20.23 +  if (klass_oop != NULL && EnableInvokeDynamic) {
   20.24 +    compute_offset(_member_offset, klass_oop, vmSymbols::member_name(), vmSymbols::java_lang_invoke_MemberName_signature());
   20.25 +  }
   20.26 +}
   20.27  
   20.28  // Support for java_lang_invoke_MethodHandle
   20.29  
   20.30 @@ -3205,6 +3225,7 @@
   20.31    java_lang_ThreadGroup::compute_offsets();
   20.32    if (EnableInvokeDynamic) {
   20.33      java_lang_invoke_MethodHandle::compute_offsets();
   20.34 +    java_lang_invoke_DirectMethodHandle::compute_offsets();
   20.35      java_lang_invoke_MemberName::compute_offsets();
   20.36      java_lang_invoke_LambdaForm::compute_offsets();
   20.37      java_lang_invoke_MethodType::compute_offsets();
    21.1 --- a/src/share/vm/classfile/javaClasses.hpp	Fri Aug 09 01:39:11 2013 -0700
    21.2 +++ b/src/share/vm/classfile/javaClasses.hpp	Fri Aug 09 13:19:00 2013 -0700
    21.3 @@ -976,6 +976,32 @@
    21.4    static int form_offset_in_bytes()             { return _form_offset; }
    21.5  };
    21.6  
    21.7 +// Interface to java.lang.invoke.DirectMethodHandle objects
    21.8 +
    21.9 +class java_lang_invoke_DirectMethodHandle: AllStatic {
   21.10 +  friend class JavaClasses;
   21.11 +
   21.12 + private:
   21.13 +  static int _member_offset;               // the MemberName of this DMH
   21.14 +
   21.15 +  static void compute_offsets();
   21.16 +
   21.17 + public:
   21.18 +  // Accessors
   21.19 +  static oop  member(oop mh);
   21.20 +
   21.21 +  // Testers
   21.22 +  static bool is_subclass(Klass* klass) {
   21.23 +    return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
   21.24 +  }
   21.25 +  static bool is_instance(oop obj) {
   21.26 +    return obj != NULL && is_subclass(obj->klass());
   21.27 +  }
   21.28 +
   21.29 +  // Accessors for code generation:
   21.30 +  static int member_offset_in_bytes()           { return _member_offset; }
   21.31 +};
   21.32 +
   21.33  // Interface to java.lang.invoke.LambdaForm objects
   21.34  // (These are a private interface for managing adapter code generation.)
   21.35  
    22.1 --- a/src/share/vm/classfile/systemDictionary.hpp	Fri Aug 09 01:39:11 2013 -0700
    22.2 +++ b/src/share/vm/classfile/systemDictionary.hpp	Fri Aug 09 13:19:00 2013 -0700
    22.3 @@ -151,6 +151,7 @@
    22.4    do_klass(reflect_CallerSensitive_klass,               sun_reflect_CallerSensitive,               Opt                 ) \
    22.5                                                                                                                           \
    22.6    /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */                                            \
    22.7 +  do_klass(DirectMethodHandle_klass,                    java_lang_invoke_DirectMethodHandle,       Opt                 ) \
    22.8    do_klass(MethodHandle_klass,                          java_lang_invoke_MethodHandle,             Pre_JSR292          ) \
    22.9    do_klass(MemberName_klass,                            java_lang_invoke_MemberName,               Pre_JSR292          ) \
   22.10    do_klass(MethodHandleNatives_klass,                   java_lang_invoke_MethodHandleNatives,      Pre_JSR292          ) \
    23.1 --- a/src/share/vm/classfile/vmSymbols.hpp	Fri Aug 09 01:39:11 2013 -0700
    23.2 +++ b/src/share/vm/classfile/vmSymbols.hpp	Fri Aug 09 13:19:00 2013 -0700
    23.3 @@ -255,6 +255,7 @@
    23.4    /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */                                   \
    23.5    template(java_lang_invoke_CallSite,                 "java/lang/invoke/CallSite")                \
    23.6    template(java_lang_invoke_ConstantCallSite,         "java/lang/invoke/ConstantCallSite")        \
    23.7 +  template(java_lang_invoke_DirectMethodHandle,       "java/lang/invoke/DirectMethodHandle")      \
    23.8    template(java_lang_invoke_MutableCallSite,          "java/lang/invoke/MutableCallSite")         \
    23.9    template(java_lang_invoke_VolatileCallSite,         "java/lang/invoke/VolatileCallSite")        \
   23.10    template(java_lang_invoke_MethodHandle,             "java/lang/invoke/MethodHandle")            \
   23.11 @@ -352,6 +353,7 @@
   23.12    template(thread_id_name,                            "tid")                                      \
   23.13    template(newInstance0_name,                         "newInstance0")                             \
   23.14    template(limit_name,                                "limit")                                    \
   23.15 +  template(member_name,                               "member")                                   \
   23.16    template(forName_name,                              "forName")                                  \
   23.17    template(forName0_name,                             "forName0")                                 \
   23.18    template(isJavaIdentifierStart_name,                "isJavaIdentifierStart")                    \
    24.1 --- a/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Aug 09 01:39:11 2013 -0700
    24.2 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Aug 09 13:19:00 2013 -0700
    24.3 @@ -1209,3 +1209,26 @@
    24.4                         size_of_arguments * Interpreter::stackElementSize);
    24.5  IRT_END
    24.6  #endif
    24.7 +
    24.8 +#if INCLUDE_JVMTI
    24.9 +// This is a support of the JVMTI PopFrame interface.
   24.10 +// Make sure it is an invokestatic of a polymorphic intrinsic that has a member_name argument
   24.11 +// and return it as a vm_result so that it can be reloaded in the list of invokestatic parameters.
   24.12 +// The dmh argument is a reference to a DirectMethoHandle that has a member name field.
   24.13 +IRT_ENTRY(void, InterpreterRuntime::member_name_arg_or_null(JavaThread* thread, address dmh,
   24.14 +                                                            Method* method, address bcp))
   24.15 +  Bytecodes::Code code = Bytecodes::code_at(method, bcp);
   24.16 +  if (code != Bytecodes::_invokestatic) {
   24.17 +    return;
   24.18 +  }
   24.19 +  ConstantPool* cpool = method->constants();
   24.20 +  int cp_index = Bytes::get_native_u2(bcp + 1) + ConstantPool::CPCACHE_INDEX_TAG;
   24.21 +  Symbol* cname = cpool->klass_name_at(cpool->klass_ref_index_at(cp_index));
   24.22 +  Symbol* mname = cpool->name_ref_at(cp_index);
   24.23 +
   24.24 +  if (MethodHandles::has_member_arg(cname, mname)) {
   24.25 +    oop member_name = java_lang_invoke_DirectMethodHandle::member((oop)dmh);
   24.26 +    thread->set_vm_result(member_name);
   24.27 +  }
   24.28 +IRT_END
   24.29 +#endif // INCLUDE_JVMTI
    25.1 --- a/src/share/vm/interpreter/interpreterRuntime.hpp	Fri Aug 09 01:39:11 2013 -0700
    25.2 +++ b/src/share/vm/interpreter/interpreterRuntime.hpp	Fri Aug 09 13:19:00 2013 -0700
    25.3 @@ -95,6 +95,9 @@
    25.4    static void    create_exception(JavaThread* thread, char* name, char* message);
    25.5    static void    create_klass_exception(JavaThread* thread, char* name, oopDesc* obj);
    25.6    static address exception_handler_for_exception(JavaThread* thread, oopDesc* exception);
    25.7 +#if INCLUDE_JVMTI
    25.8 +  static void    member_name_arg_or_null(JavaThread* thread, address dmh, Method* m, address bcp);
    25.9 +#endif
   25.10    static void    throw_pending_exception(JavaThread* thread);
   25.11  
   25.12    // Statics & fields
    26.1 --- a/test/runtime/7107135/Test7107135.sh	Fri Aug 09 01:39:11 2013 -0700
    26.2 +++ b/test/runtime/7107135/Test7107135.sh	Fri Aug 09 13:19:00 2013 -0700
    26.3 @@ -53,9 +53,6 @@
    26.4      fi
    26.5      ;;
    26.6    *)
    26.7 -    NULL=NUL
    26.8 -    PS=";"
    26.9 -    FS="\\"
   26.10      echo "Test passed; only valid for Linux"
   26.11      exit 0;
   26.12      ;;
   26.13 @@ -87,14 +84,16 @@
   26.14  
   26.15  echo
   26.16  echo Test changing of stack protection:
   26.17 -echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw
   26.18 +echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx
   26.19  ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx
   26.20 +JAVA_RETVAL=$?
   26.21  
   26.22 -if [ "$?" == "0" ]
   26.23 +if [ "$JAVA_RETVAL" == "0" ]
   26.24  then
   26.25    echo
   26.26    echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx
   26.27    ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx
   26.28 +  JAVA_RETVAL=$?
   26.29  fi
   26.30  
   26.31 -exit $?
   26.32 +exit $JAVA_RETVAL

mercurial