提交 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 { ...@@ -276,9 +276,9 @@ class ciMethod : public ciObject {
void print_short_name(outputStream* st = tty); void print_short_name(outputStream* st = tty);
methodOop get_method_handle_target() { methodOop get_method_handle_target() {
klassOop receiver_limit_oop = NULL; KlassHandle receiver_limit; int flags = 0;
int flags = 0; methodHandle m = MethodHandles::decode_method(get_oop(), receiver_limit, flags);
return MethodHandles::decode_method(get_oop(), receiver_limit_oop, 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -175,7 +175,7 @@ class VerifyOopClosure: public OopClosure { ...@@ -175,7 +175,7 @@ class VerifyOopClosure: public OopClosure {
protected: protected:
template <class T> inline void do_oop_work(T* p) { template <class T> inline void do_oop_work(T* p) {
oop obj = oopDesc::load_decode_heap_oop(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: public:
virtual void do_oop(oop* p); virtual void do_oop(oop* p);
......
...@@ -82,10 +82,8 @@ void MethodHandleChain::set_method_handle(Handle mh, TRAPS) { ...@@ -82,10 +82,8 @@ void MethodHandleChain::set_method_handle(Handle mh, TRAPS) {
void MethodHandleChain::set_last_method(oop target, TRAPS) { void MethodHandleChain::set_last_method(oop target, TRAPS) {
_is_last = true; _is_last = true;
klassOop receiver_limit_oop = NULL; KlassHandle receiver_limit; int flags = 0;
int flags = 0; _last_method = MethodHandles::decode_method(target, receiver_limit, flags);
methodOop m = MethodHandles::decode_method(target, receiver_limit_oop, flags);
_last_method = methodHandle(THREAD, m);
if ((flags & MethodHandles::_dmf_has_receiver) == 0) if ((flags & MethodHandles::_dmf_has_receiver) == 0)
_last_invoke = Bytecodes::_invokestatic; _last_invoke = Bytecodes::_invokestatic;
else if ((flags & MethodHandles::_dmf_does_dispatch) == 0) else if ((flags & MethodHandles::_dmf_does_dispatch) == 0)
......
...@@ -266,12 +266,12 @@ class MethodHandles: AllStatic { ...@@ -266,12 +266,12 @@ class MethodHandles: AllStatic {
// helpers for decode_method. // helpers for decode_method.
static methodOop decode_methodOop(methodOop m, int& decode_flags_result); 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 methodHandle decode_vmtarget(oop vmtarget, int vmindex, oop mtype, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodOop decode_MemberName(oop mname, klassOop& receiver_limit_result, int& decode_flags_result); static methodHandle decode_MemberName(oop mname, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodOop decode_MethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result); static methodHandle decode_MethodHandle(oop mh, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodOop decode_DirectMethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result); static methodHandle decode_DirectMethodHandle(oop mh, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodOop decode_BoundMethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result); static methodHandle decode_BoundMethodHandle(oop mh, KlassHandle& receiver_limit_result, int& decode_flags_result);
static methodOop decode_AdapterMethodHandle(oop mh, klassOop& 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. // Find out how many stack slots an mh pushes or pops.
// The result is *not* reported as a multiple of stack_move_unit(); // The result is *not* reported as a multiple of stack_move_unit();
...@@ -317,7 +317,7 @@ class MethodHandles: AllStatic { ...@@ -317,7 +317,7 @@ class MethodHandles: AllStatic {
_dmf_adapter_lsb = 0x20, _dmf_adapter_lsb = 0x20,
_DMF_ADAPTER_MASK = (_dmf_adapter_lsb << CONV_OP_LIMIT) - _dmf_adapter_lsb _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 { enum {
// format of query to getConstant: // format of query to getConstant:
GC_JVM_PUSH_LIMIT = 0, GC_JVM_PUSH_LIMIT = 0,
......
...@@ -1721,14 +1721,14 @@ char* SharedRuntime::generate_wrong_method_type_message(JavaThread* thread, ...@@ -1721,14 +1721,14 @@ char* SharedRuntime::generate_wrong_method_type_message(JavaThread* thread,
targetArity = ArgumentCount(target->signature()).size(); targetArity = ArgumentCount(target->signature()).size();
} }
} }
klassOop kignore; int dmf_flags = 0; KlassHandle kignore; int dmf_flags = 0;
methodOop actual_method = MethodHandles::decode_method(actual, kignore, dmf_flags); methodHandle actual_method = MethodHandles::decode_method(actual, kignore, dmf_flags);
if ((dmf_flags & ~(MethodHandles::_dmf_has_receiver | if ((dmf_flags & ~(MethodHandles::_dmf_has_receiver |
MethodHandles::_dmf_does_dispatch | MethodHandles::_dmf_does_dispatch |
MethodHandles::_dmf_from_interface)) != 0) 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); 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(); mhName = actual_method->signature()->as_C_string();
mhArity = ArgumentCount(actual_method->signature()).size(); mhArity = ArgumentCount(actual_method->signature()).size();
if (!actual_method->is_static()) mhArity += 1; if (!actual_method->is_static()) mhArity += 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册