1.1 --- a/src/cpu/x86/vm/interpreter_x86_32.cpp Wed Apr 08 00:12:59 2009 -0700 1.2 +++ b/src/cpu/x86/vm/interpreter_x86_32.cpp Wed Apr 08 10:56:49 2009 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -201,11 +201,12 @@ 1.11 address entry_point = __ pc(); 1.12 1.13 // abstract method entry 1.14 - // remove return address. Not really needed, since exception handling throws away expression stack 1.15 - __ pop(rbx); 1.16 1.17 - // adjust stack to what a normal return would do 1.18 - __ mov(rsp, rsi); 1.19 + // pop return address, reset last_sp to NULL 1.20 + __ empty_expression_stack(); 1.21 + __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) 1.22 + __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) 1.23 + 1.24 // throw exception 1.25 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); 1.26 // the call_VM checks for exception, so we should never return here. 1.27 @@ -214,6 +215,20 @@ 1.28 return entry_point; 1.29 } 1.30 1.31 + 1.32 +// Method handle invoker 1.33 +// Dispatch a method of the form java.dyn.MethodHandles::invoke(...) 1.34 +address InterpreterGenerator::generate_method_handle_entry(void) { 1.35 + if (!EnableMethodHandles) { 1.36 + return generate_abstract_entry(); 1.37 + } 1.38 + 1.39 + address entry_point = MethodHandles::generate_method_handle_interpreter_entry(_masm); 1.40 + 1.41 + return entry_point; 1.42 +} 1.43 + 1.44 + 1.45 // This method tells the deoptimizer how big an interpreted frame must be: 1.46 int AbstractInterpreter::size_activation(methodOop method, 1.47 int tempcount,