equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2017, Oracle and/or its affiliates. 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. |
52 ciObject::ciObject(oop o) { |
52 ciObject::ciObject(oop o) { |
53 ASSERT_IN_VM; |
53 ASSERT_IN_VM; |
54 if (ciObjectFactory::is_initialized()) { |
54 if (ciObjectFactory::is_initialized()) { |
55 _handle = JNIHandles::make_local(o); |
55 _handle = JNIHandles::make_local(o); |
56 } else { |
56 } else { |
57 _handle = JNIHandles::make_global(o); |
57 Handle obj(Thread::current(), o); |
|
58 _handle = JNIHandles::make_global(obj); |
58 } |
59 } |
59 _klass = NULL; |
60 _klass = NULL; |
60 init_flags_from(o); |
61 init_flags_from(o); |
61 } |
62 } |
62 |
63 |