comparison src/cpu/x86/vm/interpreter_x86_32.cpp @ 710:e5b0439ef4ae

6655638: dynamic languages need method handles Summary: initial implementation, with known omissions (x86/64, sparc, compiler optim., c-oops, C++ interp.) Reviewed-by: kvn, twisti, never
author jrose
date Wed, 08 Apr 2009 10:56:49 -0700
parents 9ee9cf798b59
children 2338d41fbd81
comparison
equal deleted inserted replaced
709:1d037ecd7960 710:e5b0439ef4ae
1 /* 1 /*
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
199 // rsi: sender SP 199 // rsi: sender SP
200 200
201 address entry_point = __ pc(); 201 address entry_point = __ pc();
202 202
203 // abstract method entry 203 // abstract method entry
204 // remove return address. Not really needed, since exception handling throws away expression stack 204
205 __ pop(rbx); 205 // pop return address, reset last_sp to NULL
206 206 __ empty_expression_stack();
207 // adjust stack to what a normal return would do 207 __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
208 __ mov(rsp, rsi); 208 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
209
209 // throw exception 210 // throw exception
210 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); 211 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
211 // the call_VM checks for exception, so we should never return here. 212 // the call_VM checks for exception, so we should never return here.
212 __ should_not_reach_here(); 213 __ should_not_reach_here();
213 214
214 return entry_point; 215 return entry_point;
215 } 216 }
217
218
219 // Method handle invoker
220 // Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
221 address InterpreterGenerator::generate_method_handle_entry(void) {
222 if (!EnableMethodHandles) {
223 return generate_abstract_entry();
224 }
225
226 address entry_point = MethodHandles::generate_method_handle_interpreter_entry(_masm);
227
228 return entry_point;
229 }
230
216 231
217 // This method tells the deoptimizer how big an interpreted frame must be: 232 // This method tells the deoptimizer how big an interpreted frame must be:
218 int AbstractInterpreter::size_activation(methodOop method, 233 int AbstractInterpreter::size_activation(methodOop method,
219 int tempcount, 234 int tempcount,
220 int popframe_extra_args, 235 int popframe_extra_args,