提交 b42bb5de 编写于 作者: T twisti

7018355: JSR 292: VM crash in DefNewGeneration::copy_to_survivor_space

Reviewed-by: kvn, jrose
上级 0f11ba0c
......@@ -276,9 +276,9 @@ class ciMethod : public ciObject {
void print_short_name(outputStream* st = tty);
methodOop get_method_handle_target() {
klassOop receiver_limit_oop = NULL;
int flags = 0;
return MethodHandles::decode_method(get_oop(), receiver_limit_oop, flags);
KlassHandle receiver_limit; int flags = 0;
methodHandle m = MethodHandles::decode_method(get_oop(), receiver_limit, flags);
return m();
}
};
......
/*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. 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
......@@ -175,7 +175,7 @@ class VerifyOopClosure: public OopClosure {
protected:
template <class T> inline void do_oop_work(T* p) {
oop obj = oopDesc::load_decode_heap_oop(p);
guarantee(obj->is_oop_or_null(), "invalid oop");
guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, obj));
}
public:
virtual void do_oop(oop* p);
......
......@@ -82,10 +82,8 @@ void MethodHandleChain::set_method_handle(Handle mh, TRAPS) {
void MethodHandleChain::set_last_method(oop target, TRAPS) {
_is_last = true;
klassOop receiver_limit_oop = NULL;
int flags = 0;
methodOop m = MethodHandles::decode_method(target, receiver_limit_oop, flags);
_last_method = methodHandle(THREAD, m);
KlassHandle receiver_limit; int flags = 0;
_last_method = MethodHandles::decode_method(target, receiver_limit, flags);
if ((flags & MethodHandles::_dmf_has_receiver) == 0)
_last_invoke = Bytecodes::_invokestatic;
else if ((flags & MethodHandles::_dmf_does_dispatch) == 0)
......
......@@ -266,12 +266,12 @@ class MethodHandles: AllStatic {
// helpers for decode_method.
static methodOop decode_methodOop(methodOop m, int& decode_flags_result);
static methodOop decode_vmtarget(oop vmtarget, int vmindex, oop mtype, klassOop& receiver_limit_result, int& decode_flags_result);
static methodOop decode_MemberName(oop mname, klassOop& receiver_limit_result, int& decode_flags_result);
static methodOop decode_MethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result);
static methodOop decode_DirectMethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result);
static methodOop decode_BoundMethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result);
static methodOop decode_AdapterMethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result);
static methodHandle decode_vmtarget(oop vmtarget, int vmindex, oop mtype, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodHandle decode_MemberName(oop mname, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodHandle decode_MethodHandle(oop mh, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodHandle decode_DirectMethodHandle(oop mh, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodHandle decode_BoundMethodHandle(oop mh, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodHandle decode_AdapterMethodHandle(oop mh, KlassHandle& receiver_limit_result, int& decode_flags_result);
// Find out how many stack slots an mh pushes or pops.
// The result is *not* reported as a multiple of stack_move_unit();
......@@ -317,7 +317,7 @@ class MethodHandles: AllStatic {
_dmf_adapter_lsb = 0x20,
_DMF_ADAPTER_MASK = (_dmf_adapter_lsb << CONV_OP_LIMIT) - _dmf_adapter_lsb
};
static methodOop decode_method(oop x, klassOop& receiver_limit_result, int& decode_flags_result);
static methodHandle decode_method(oop x, KlassHandle& receiver_limit_result, int& decode_flags_result);
enum {
// format of query to getConstant:
GC_JVM_PUSH_LIMIT = 0,
......
......@@ -1721,14 +1721,14 @@ char* SharedRuntime::generate_wrong_method_type_message(JavaThread* thread,
targetArity = ArgumentCount(target->signature()).size();
}
}
klassOop kignore; int dmf_flags = 0;
methodOop actual_method = MethodHandles::decode_method(actual, kignore, dmf_flags);
KlassHandle kignore; int dmf_flags = 0;
methodHandle actual_method = MethodHandles::decode_method(actual, kignore, dmf_flags);
if ((dmf_flags & ~(MethodHandles::_dmf_has_receiver |
MethodHandles::_dmf_does_dispatch |
MethodHandles::_dmf_from_interface)) != 0)
actual_method = NULL; // MH does extra binds, drops, etc.
actual_method = methodHandle(); // MH does extra binds, drops, etc.
bool has_receiver = ((dmf_flags & MethodHandles::_dmf_has_receiver) != 0);
if (actual_method != NULL) {
if (actual_method.not_null()) {
mhName = actual_method->signature()->as_C_string();
mhArity = ArgumentCount(actual_method->signature()).size();
if (!actual_method->is_static()) mhArity += 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册