Fri, 02 Apr 2010 15:55:04 -0700
Merge
src/share/vm/runtime/globals.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Apr 01 20:48:50 2010 -0400 1.2 +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Apr 02 15:55:04 2010 -0700 1.3 @@ -206,7 +206,6 @@ 1.4 1.5 // Update the invocation counter 1.6 if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) { 1.7 - thread->set_do_not_unlock(); 1.8 InvocationCounter *counter = method->invocation_counter(); 1.9 counter->increment(); 1.10 if (counter->reached_InvocationLimit()) { 1.11 @@ -215,7 +214,6 @@ 1.12 if (HAS_PENDING_EXCEPTION) 1.13 goto unwind_and_return; 1.14 } 1.15 - thread->clr_do_not_unlock(); 1.16 } 1.17 1.18 // Lock if necessary
2.1 --- a/src/cpu/zero/vm/methodHandles_zero.cpp Thu Apr 01 20:48:50 2010 -0400 2.2 +++ b/src/cpu/zero/vm/methodHandles_zero.cpp Fri Apr 02 15:55:04 2010 -0700 2.3 @@ -1,6 +1,6 @@ 2.4 /* 2.5 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. 2.6 - * Copyright 2009 Red Hat, Inc. 2.7 + * Copyright 2009, 2010 Red Hat, Inc. 2.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.9 * 2.10 * This code is free software; you can redistribute it and/or modify it 2.11 @@ -23,4 +23,10 @@ 2.12 * 2.13 */ 2.14 2.15 -// This file is intentionally empty 2.16 +#include "incls/_precompiled.incl" 2.17 +#include "incls/_methodHandles_zero.cpp.incl" 2.18 + 2.19 +void MethodHandles::generate_method_handle_stub(MacroAssembler* masm, 2.20 + MethodHandles::EntryKind ek) { 2.21 + ShouldNotCallThis(); 2.22 +}
3.1 --- a/src/cpu/zero/vm/stubRoutines_zero.hpp Thu Apr 01 20:48:50 2010 -0400 3.2 +++ b/src/cpu/zero/vm/stubRoutines_zero.hpp Fri Apr 02 15:55:04 2010 -0700 3.3 @@ -1,6 +1,6 @@ 3.4 /* 3.5 * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. 3.6 - * Copyright 2007, 2008, 2009 Red Hat, Inc. 3.7 + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. 3.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.9 * 3.10 * This code is free software; you can redistribute it and/or modify it 3.11 @@ -41,6 +41,10 @@ 3.12 code_size2 = 0 // if these are too small. Simply increase 3.13 }; // them if that happens. 3.14 3.15 + enum method_handles_platform_dependent_constants { 3.16 + method_handles_adapters_code_size = 0 3.17 + }; 3.18 + 3.19 #ifdef IA32 3.20 class x86 { 3.21 friend class VMStructs;
4.1 --- a/src/share/vm/ci/ciConstant.cpp Thu Apr 01 20:48:50 2010 -0400 4.2 +++ b/src/share/vm/ci/ciConstant.cpp Fri Apr 02 15:55:04 2010 -0700 4.3 @@ -36,7 +36,7 @@ 4.4 basictype_to_str(basic_type())); 4.5 switch (basic_type()) { 4.6 case T_BOOLEAN: 4.7 - tty->print("%s", bool_to_str(_value._int == 0)); 4.8 + tty->print("%s", bool_to_str(_value._int != 0)); 4.9 break; 4.10 case T_CHAR: 4.11 case T_BYTE:
5.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp Thu Apr 01 20:48:50 2010 -0400 5.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Apr 02 15:55:04 2010 -0700 5.3 @@ -2328,6 +2328,17 @@ 5.4 } 5.5 5.6 DEFAULT: 5.7 +#ifdef ZERO 5.8 + // Some zero configurations use the C++ interpreter as a 5.9 + // fallback interpreter and have support for platform 5.10 + // specific fast bytecodes which aren't supported here, so 5.11 + // redispatch to the equivalent non-fast bytecode when they 5.12 + // are encountered. 5.13 + if (Bytecodes::is_defined((Bytecodes::Code)opcode)) { 5.14 + opcode = (jubyte)Bytecodes::java_code((Bytecodes::Code)opcode); 5.15 + goto opcode_switch; 5.16 + } 5.17 +#endif 5.18 fatal2("\t*** Unimplemented opcode: %d = %s\n", 5.19 opcode, Bytecodes::name((Bytecodes::Code)opcode)); 5.20 goto finish;
6.1 --- a/src/share/vm/opto/doCall.cpp Thu Apr 01 20:48:50 2010 -0400 6.2 +++ b/src/share/vm/opto/doCall.cpp Fri Apr 02 15:55:04 2010 -0700 6.3 @@ -714,8 +714,6 @@ 6.4 6.5 // iterate through all entries sequentially 6.6 for (;!handlers.is_done(); handlers.next()) { 6.7 - // Do nothing if turned off 6.8 - if( !DeutschShiffmanExceptions ) break; 6.9 ciExceptionHandler* handler = handlers.handler(); 6.10 6.11 if (handler->is_rethrow()) { 6.12 @@ -741,46 +739,26 @@ 6.13 return; // No more handling to be done here! 6.14 } 6.15 6.16 - // %%% The following logic replicates make_from_klass_unique. 6.17 - // TO DO: Replace by a subroutine call. Then generalize 6.18 - // the type check, as noted in the next "%%%" comment. 6.19 + // Get the handler's klass 6.20 + ciInstanceKlass* klass = handler->catch_klass(); 6.21 6.22 - ciInstanceKlass* klass = handler->catch_klass(); 6.23 - if (UseUniqueSubclasses) { 6.24 - // (We use make_from_klass because it respects UseUniqueSubclasses.) 6.25 - const TypeOopPtr* tp = TypeOopPtr::make_from_klass(klass); 6.26 - klass = tp->klass()->as_instance_klass(); 6.27 + if (!klass->is_loaded()) { // klass is not loaded? 6.28 + // fall through into catch_call_exceptions which will emit a 6.29 + // handler with an uncommon trap. 6.30 + break; 6.31 } 6.32 6.33 - // Get the handler's klass 6.34 - if (!klass->is_loaded()) // klass is not loaded? 6.35 - break; // Must call Rethrow! 6.36 if (klass->is_interface()) // should not happen, but... 6.37 break; // bail out 6.38 - // See if the loaded exception klass has no subtypes 6.39 - if (klass->has_subklass()) 6.40 - break; // Cannot easily do precise test ==> Rethrow 6.41 6.42 - // %%% Now that subclass checking is very fast, we need to rewrite 6.43 - // this section and remove the option "DeutschShiffmanExceptions". 6.44 - // The exception processing chain should be a normal typecase pattern, 6.45 - // with a bailout to the interpreter only in the case of unloaded 6.46 - // classes. (The bailout should mark the method non-entrant.) 6.47 - // This rewrite should be placed in GraphKit::, not Parse::. 6.48 - 6.49 - // Add a dependence; if any subclass added we need to recompile 6.50 - // %%% should use stronger assert_unique_concrete_subtype instead 6.51 - if (!klass->is_final()) { 6.52 - C->dependencies()->assert_leaf_type(klass); 6.53 - } 6.54 - 6.55 - // Implement precise test 6.56 + // Check the type of the exception against the catch type 6.57 const TypeKlassPtr *tk = TypeKlassPtr::make(klass); 6.58 Node* con = _gvn.makecon(tk); 6.59 - Node* cmp = _gvn.transform( new (C, 3) CmpPNode(ex_klass_node, con) ); 6.60 - Node* bol = _gvn.transform( new (C, 2) BoolNode(cmp, BoolTest::ne) ); 6.61 - { BuildCutout unless(this, bol, PROB_LIKELY(0.7f)); 6.62 - const TypeInstPtr* tinst = TypeInstPtr::make_exact(TypePtr::NotNull, klass); 6.63 + Node* not_subtype_ctrl = gen_subtype_check(ex_klass_node, con); 6.64 + if (!stopped()) { 6.65 + PreserveJVMState pjvms(this); 6.66 + const TypeInstPtr* tinst = TypeOopPtr::make_from_klass_unique(klass)->cast_to_ptr_type(TypePtr::NotNull)->is_instptr(); 6.67 + assert(klass->has_subklass() || tinst->klass_is_exact(), "lost exactness"); 6.68 Node* ex_oop = _gvn.transform(new (C, 2) CheckCastPPNode(control(), ex_node, tinst)); 6.69 push_ex_oop(ex_oop); // Push exception oop for handler 6.70 #ifndef PRODUCT 6.71 @@ -792,6 +770,7 @@ 6.72 #endif 6.73 merge_exception(handler_bci); 6.74 } 6.75 + set_control(not_subtype_ctrl); 6.76 6.77 // Come here if exception does not match handler. 6.78 // Carry on with more handler checks. 6.79 @@ -800,21 +779,6 @@ 6.80 6.81 assert(!stopped(), "you should return if you finish the chain"); 6.82 6.83 - if (remaining == 1) { 6.84 - // Further checks do not matter. 6.85 - } 6.86 - 6.87 - if (can_rerun_bytecode()) { 6.88 - // Do not push_ex_oop here! 6.89 - // Re-executing the bytecode will reproduce the throwing condition. 6.90 - bool must_throw = true; 6.91 - uncommon_trap(Deoptimization::Reason_unhandled, 6.92 - Deoptimization::Action_none, 6.93 - (ciKlass*)NULL, (const char*)NULL, // default args 6.94 - must_throw); 6.95 - return; 6.96 - } 6.97 - 6.98 // Oops, need to call into the VM to resolve the klasses at runtime. 6.99 // Note: This call must not deoptimize, since it is not a real at this bci! 6.100 kill_dead_locals();
7.1 --- a/src/share/vm/opto/parse.hpp Thu Apr 01 20:48:50 2010 -0400 7.2 +++ b/src/share/vm/opto/parse.hpp Fri Apr 02 15:55:04 2010 -0700 7.3 @@ -551,9 +551,6 @@ 7.4 // Also handles exceptions for individual bytecodes. 7.5 void catch_inline_exceptions(SafePointNode* ex_map); 7.6 7.7 - // Bytecode classifier, helps decide to use uncommon_trap vs. rethrow_C. 7.8 - bool can_rerun_bytecode(); 7.9 - 7.10 // Merge the given map into correct exceptional exit state. 7.11 // Assumes that there is no applicable local handler. 7.12 void throw_to_exit(SafePointNode* ex_map);
8.1 --- a/src/share/vm/opto/parse1.cpp Thu Apr 01 20:48:50 2010 -0400 8.2 +++ b/src/share/vm/opto/parse1.cpp Fri Apr 02 15:55:04 2010 -0700 8.3 @@ -798,67 +798,6 @@ 8.4 initial_gvn()->transform_no_reclaim(exit); 8.5 } 8.6 8.7 -bool Parse::can_rerun_bytecode() { 8.8 - switch (bc()) { 8.9 - case Bytecodes::_ldc: 8.10 - case Bytecodes::_ldc_w: 8.11 - case Bytecodes::_ldc2_w: 8.12 - case Bytecodes::_getfield: 8.13 - case Bytecodes::_putfield: 8.14 - case Bytecodes::_getstatic: 8.15 - case Bytecodes::_putstatic: 8.16 - case Bytecodes::_arraylength: 8.17 - case Bytecodes::_baload: 8.18 - case Bytecodes::_caload: 8.19 - case Bytecodes::_iaload: 8.20 - case Bytecodes::_saload: 8.21 - case Bytecodes::_faload: 8.22 - case Bytecodes::_aaload: 8.23 - case Bytecodes::_laload: 8.24 - case Bytecodes::_daload: 8.25 - case Bytecodes::_bastore: 8.26 - case Bytecodes::_castore: 8.27 - case Bytecodes::_iastore: 8.28 - case Bytecodes::_sastore: 8.29 - case Bytecodes::_fastore: 8.30 - case Bytecodes::_aastore: 8.31 - case Bytecodes::_lastore: 8.32 - case Bytecodes::_dastore: 8.33 - case Bytecodes::_irem: 8.34 - case Bytecodes::_idiv: 8.35 - case Bytecodes::_lrem: 8.36 - case Bytecodes::_ldiv: 8.37 - case Bytecodes::_frem: 8.38 - case Bytecodes::_fdiv: 8.39 - case Bytecodes::_drem: 8.40 - case Bytecodes::_ddiv: 8.41 - case Bytecodes::_checkcast: 8.42 - case Bytecodes::_instanceof: 8.43 - case Bytecodes::_anewarray: 8.44 - case Bytecodes::_newarray: 8.45 - case Bytecodes::_multianewarray: 8.46 - case Bytecodes::_new: 8.47 - case Bytecodes::_monitorenter: // can re-run initial null check, only 8.48 - case Bytecodes::_return: 8.49 - return true; 8.50 - break; 8.51 - 8.52 - // Don't rerun athrow since it's part of the exception path. 8.53 - case Bytecodes::_athrow: 8.54 - case Bytecodes::_invokestatic: 8.55 - case Bytecodes::_invokedynamic: 8.56 - case Bytecodes::_invokespecial: 8.57 - case Bytecodes::_invokevirtual: 8.58 - case Bytecodes::_invokeinterface: 8.59 - return false; 8.60 - break; 8.61 - 8.62 - default: 8.63 - assert(false, "unexpected bytecode produced an exception"); 8.64 - return true; 8.65 - } 8.66 -} 8.67 - 8.68 //---------------------------do_exceptions------------------------------------- 8.69 // Process exceptions arising from the current bytecode. 8.70 // Send caught exceptions to the proper handler within this method. 8.71 @@ -872,9 +811,6 @@ 8.72 return; 8.73 } 8.74 8.75 - // Make sure we can classify this bytecode if we need to. 8.76 - debug_only(can_rerun_bytecode()); 8.77 - 8.78 PreserveJVMState pjvms(this, false); 8.79 8.80 SafePointNode* ex_map;
9.1 --- a/src/share/vm/prims/forte.cpp Thu Apr 01 20:48:50 2010 -0400 9.2 +++ b/src/share/vm/prims/forte.cpp Fri Apr 02 15:55:04 2010 -0700 9.3 @@ -55,12 +55,11 @@ 9.4 }; 9.5 9.6 9.7 -static void is_decipherable_compiled_frame(frame* fr, RegisterMap* map, 9.8 - bool* is_compiled_p, bool* is_walkable_p); 9.9 +static bool is_decipherable_compiled_frame(JavaThread* thread, frame* fr, nmethod* nm); 9.10 static bool is_decipherable_interpreted_frame(JavaThread* thread, 9.11 - frame* fr, 9.12 - methodOop* method_p, 9.13 - int* bci_p); 9.14 + frame* fr, 9.15 + methodOop* method_p, 9.16 + int* bci_p); 9.17 9.18 9.19 9.20 @@ -122,41 +121,43 @@ 9.21 // Determine if 'fr' is a decipherable compiled frame. We are already 9.22 // assured that fr is for a java nmethod. 9.23 9.24 -static bool is_decipherable_compiled_frame(frame* fr) { 9.25 - 9.26 - assert(fr->cb() != NULL && fr->cb()->is_nmethod(), "invariant"); 9.27 - nmethod* nm = (nmethod*) fr->cb(); 9.28 +static bool is_decipherable_compiled_frame(JavaThread* thread, frame* fr, nmethod* nm) { 9.29 assert(nm->is_java_method(), "invariant"); 9.30 9.31 - // First try and find an exact PcDesc 9.32 + if (thread->has_last_Java_frame() && thread->last_Java_pc() == fr->pc()) { 9.33 + // We're stopped at a call into the JVM so look for a PcDesc with 9.34 + // the actual pc reported by the frame. 9.35 + PcDesc* pc_desc = nm->pc_desc_at(fr->pc()); 9.36 9.37 - PcDesc* pc_desc = nm->pc_desc_at(fr->pc()); 9.38 - 9.39 - // Did we find a useful PcDesc? 9.40 - if (pc_desc != NULL && 9.41 - pc_desc->scope_decode_offset() == DebugInformationRecorder::serialized_null) { 9.42 - 9.43 - address probe_pc = fr->pc() + 1; 9.44 - pc_desc = nm->pc_desc_near(probe_pc); 9.45 - 9.46 - // Now do we have a useful PcDesc? 9.47 - 9.48 + // Did we find a useful PcDesc? 9.49 if (pc_desc != NULL && 9.50 - pc_desc->scope_decode_offset() == DebugInformationRecorder::serialized_null) { 9.51 - // No debug information available for this pc 9.52 - // vframeStream would explode if we try and walk the frames. 9.53 - return false; 9.54 + pc_desc->scope_decode_offset() != DebugInformationRecorder::serialized_null) { 9.55 + return true; 9.56 } 9.57 - 9.58 - // This PcDesc is useful however we must adjust the frame's pc 9.59 - // so that the vframeStream lookups will use this same pc 9.60 - 9.61 - fr->set_pc(pc_desc->real_pc(nm)); 9.62 } 9.63 9.64 + // We're at some random pc in the nmethod so search for the PcDesc 9.65 + // whose pc is greater than the current PC. It's done this way 9.66 + // because the extra PcDescs that are recorded for improved debug 9.67 + // info record the end of the region covered by the ScopeDesc 9.68 + // instead of the beginning. 9.69 + PcDesc* pc_desc = nm->pc_desc_near(fr->pc() + 1); 9.70 + 9.71 + // Now do we have a useful PcDesc? 9.72 + if (pc_desc == NULL || 9.73 + pc_desc->scope_decode_offset() == DebugInformationRecorder::serialized_null) { 9.74 + // No debug information available for this pc 9.75 + // vframeStream would explode if we try and walk the frames. 9.76 + return false; 9.77 + } 9.78 + 9.79 + // This PcDesc is useful however we must adjust the frame's pc 9.80 + // so that the vframeStream lookups will use this same pc 9.81 + fr->set_pc(pc_desc->real_pc(nm)); 9.82 return true; 9.83 } 9.84 9.85 + 9.86 // Determine if 'fr' is a walkable interpreted frame. Returns false 9.87 // if it is not. *method_p, and *bci_p are not set when false is 9.88 // returned. *method_p is non-NULL if frame was executing a Java 9.89 @@ -166,9 +167,9 @@ 9.90 // even if a valid BCI cannot be found. 9.91 9.92 static bool is_decipherable_interpreted_frame(JavaThread* thread, 9.93 - frame* fr, 9.94 - methodOop* method_p, 9.95 - int* bci_p) { 9.96 + frame* fr, 9.97 + methodOop* method_p, 9.98 + int* bci_p) { 9.99 assert(fr->is_interpreted_frame(), "just checking"); 9.100 9.101 // top frame is an interpreted frame 9.102 @@ -323,13 +324,15 @@ 9.103 // have a PCDesc that can get us a bci however we did find 9.104 // a method 9.105 9.106 - if (!is_decipherable_compiled_frame(&candidate)) { 9.107 + if (!is_decipherable_compiled_frame(thread, &candidate, nm)) { 9.108 return false; 9.109 } 9.110 9.111 // is_decipherable_compiled_frame may modify candidate's pc 9.112 *initial_frame_p = candidate; 9.113 9.114 + assert(nm->pc_desc_at(candidate.pc()) != NULL, "if it's decipherable then pc must be valid"); 9.115 + 9.116 return true; 9.117 } 9.118
10.1 --- a/src/share/vm/runtime/globals.hpp Thu Apr 01 20:48:50 2010 -0400 10.2 +++ b/src/share/vm/runtime/globals.hpp Fri Apr 02 15:55:04 2010 -0700 10.3 @@ -2502,10 +2502,6 @@ 10.4 notproduct(bool, TraceSpilling, false, \ 10.5 "Trace spilling") \ 10.6 \ 10.7 - develop(bool, DeutschShiffmanExceptions, true, \ 10.8 - "Fast check to find exception handler for precisely typed " \ 10.9 - "exceptions") \ 10.10 - \ 10.11 product(bool, SplitIfBlocks, true, \ 10.12 "Clone compares and control flow through merge points to fold " \ 10.13 "some branches") \