Mercurial > hg > truffle
diff src/share/vm/interpreter/interpreterRuntime.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 | a61af66fc99e |
children | be93aad57795 |
line wrap: on
line diff
--- a/src/share/vm/interpreter/interpreterRuntime.cpp Wed Apr 08 00:12:59 2009 -0700 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp Wed Apr 08 10:56:49 2009 -0700 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 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 @@ -293,6 +293,24 @@ THROW_MSG(vmSymbols::java_lang_ClassCastException(), message); IRT_END +// required can be either a MethodType, or a Class (for a single argument) +// actual (if not null) can be either a MethodHandle, or an arbitrary value (for a single argument) +IRT_ENTRY(void, InterpreterRuntime::throw_WrongMethodTypeException(JavaThread* thread, + oopDesc* required, + oopDesc* actual)) { + ResourceMark rm(thread); + char* message = SharedRuntime::generate_wrong_method_type_message(thread, required, actual); + + if (ProfileTraps) { + note_trap(thread, Deoptimization::Reason_constraint, CHECK); + } + + // create exception + THROW_MSG(vmSymbols::java_dyn_WrongMethodTypeException(), message); +} +IRT_END + + // exception_handler_for_exception(...) returns the continuation address, // the exception oop (via TLS) and sets the bci/bcp for the continuation.