aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/x86/vm/interpreter_x86_32.cpp
diff options
context:
space:
mode:
authorjrose <none@none>2009-04-08 10:56:49 -0700
committerjrose <none@none>2009-04-08 10:56:49 -0700
commit36801011c9b0d8edaf6a7f97a8394c439de607ba (patch)
treeb7300e43ab49aea0527e81c61bf1232f7a2c6567 /src/cpu/x86/vm/interpreter_x86_32.cpp
parentf8ba0457fc2cdb878a2fc2cf183152f7a4b4c05b (diff)
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
Diffstat (limited to 'src/cpu/x86/vm/interpreter_x86_32.cpp')
-rw-r--r--src/cpu/x86/vm/interpreter_x86_32.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/cpu/x86/vm/interpreter_x86_32.cpp b/src/cpu/x86/vm/interpreter_x86_32.cpp
index 221cd8561..2db290c43 100644
--- a/src/cpu/x86/vm/interpreter_x86_32.cpp
+++ b/src/cpu/x86/vm/interpreter_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -201,11 +201,12 @@ address InterpreterGenerator::generate_abstract_entry(void) {
address entry_point = __ pc();
// abstract method entry
- // remove return address. Not really needed, since exception handling throws away expression stack
- __ pop(rbx);
- // adjust stack to what a normal return would do
- __ mov(rsp, rsi);
+ // pop return address, reset last_sp to NULL
+ __ empty_expression_stack();
+ __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
+ __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
+
// throw exception
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
// the call_VM checks for exception, so we should never return here.
@@ -214,6 +215,20 @@ address InterpreterGenerator::generate_abstract_entry(void) {
return entry_point;
}
+
+// Method handle invoker
+// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
+address InterpreterGenerator::generate_method_handle_entry(void) {
+ if (!EnableMethodHandles) {
+ return generate_abstract_entry();
+ }
+
+ address entry_point = MethodHandles::generate_method_handle_interpreter_entry(_masm);
+
+ return entry_point;
+}
+
+
// This method tells the deoptimizer how big an interpreted frame must be:
int AbstractInterpreter::size_activation(methodOop method,
int tempcount,