Mercurial > hg > truffle
comparison src/share/vm/prims/privilegedStack.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | f95d63e2154a |
children | 78bbf4d43a14 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2012, 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. |
23 */ | 23 */ |
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "memory/allocation.inline.hpp" | 26 #include "memory/allocation.inline.hpp" |
27 #include "oops/instanceKlass.hpp" | 27 #include "oops/instanceKlass.hpp" |
28 #include "oops/methodOop.hpp" | 28 #include "oops/method.hpp" |
29 #include "oops/oop.inline.hpp" | 29 #include "oops/oop.inline.hpp" |
30 #include "prims/privilegedStack.hpp" | 30 #include "prims/privilegedStack.hpp" |
31 #include "runtime/vframe.hpp" | 31 #include "runtime/vframe.hpp" |
32 | 32 |
33 | 33 |
34 void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) { | 34 void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) { |
35 methodOop method = vfst->method(); | 35 Method* method = vfst->method(); |
36 _klass = method->method_holder(); | 36 _klass = method->method_holder(); |
37 _privileged_context = context; | 37 _privileged_context = context; |
38 #ifdef CHECK_UNHANDLED_OOPS | 38 #ifdef CHECK_UNHANDLED_OOPS |
39 THREAD->allow_unhandled_oop(&_klass); | |
40 THREAD->allow_unhandled_oop(&_privileged_context); | 39 THREAD->allow_unhandled_oop(&_privileged_context); |
41 #endif // CHECK_UNHANDLED_OOPS | 40 #endif // CHECK_UNHANDLED_OOPS |
42 _frame_id = vfst->frame_id(); | 41 _frame_id = vfst->frame_id(); |
43 _next = next; | 42 _next = next; |
44 assert(_privileged_context == NULL || _privileged_context->is_oop(), "must be an oop"); | 43 assert(_privileged_context == NULL || _privileged_context->is_oop(), "must be an oop"); |
46 } | 45 } |
47 | 46 |
48 void PrivilegedElement::oops_do(OopClosure* f) { | 47 void PrivilegedElement::oops_do(OopClosure* f) { |
49 PrivilegedElement *cur = this; | 48 PrivilegedElement *cur = this; |
50 do { | 49 do { |
51 f->do_oop((oop*) &cur->_klass); | |
52 f->do_oop((oop*) &cur->_privileged_context); | 50 f->do_oop((oop*) &cur->_privileged_context); |
51 cur = cur->_next; | |
52 } while(cur != NULL); | |
53 } | |
54 | |
55 void PrivilegedElement::classes_do(KlassClosure* f) { | |
56 PrivilegedElement *cur = this; | |
57 do { | |
58 f->do_klass(cur->_klass); | |
53 cur = cur->_next; | 59 cur = cur->_next; |
54 } while(cur != NULL); | 60 } while(cur != NULL); |
55 } | 61 } |
56 | 62 |
57 //------------------------------------------------------------------------------- | 63 //------------------------------------------------------------------------------- |