Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/oop.pcgc.inline.hpp @ 6948:e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 23:14:12 +0100 |
parents | d8ce2825b193 |
children | db9981fd3124 |
comparison
equal
deleted
inserted
replaced
6711:ae13cc658b80 | 6948:e522a00b91aa |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2005, 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. |
35 #endif | 35 #endif |
36 | 36 |
37 inline void oopDesc::update_contents(ParCompactionManager* cm) { | 37 inline void oopDesc::update_contents(ParCompactionManager* cm) { |
38 // The klass field must be updated before anything else | 38 // The klass field must be updated before anything else |
39 // can be done. | 39 // can be done. |
40 DEBUG_ONLY(klassOopDesc* original_klass = klass()); | 40 DEBUG_ONLY(Klass* original_klass = klass()); |
41 | 41 |
42 // Can the option to update and/or copy be moved up in the | 42 Klass* new_klass = klass(); |
43 // call chain to avoid calling into here? | |
44 | |
45 if (PSParallelCompact::should_update_klass(klass())) { | |
46 update_header(); | |
47 assert(klass()->is_klass(), "Not updated correctly"); | |
48 } else { | |
49 assert(klass()->is_klass(), "Not updated"); | |
50 } | |
51 | |
52 Klass* new_klass = blueprint(); | |
53 if (!new_klass->oop_is_typeArray()) { | 43 if (!new_klass->oop_is_typeArray()) { |
54 // It might contain oops beyond the header, so take the virtual call. | 44 // It might contain oops beyond the header, so take the virtual call. |
55 new_klass->oop_update_pointers(cm, this); | 45 new_klass->oop_update_pointers(cm, this); |
56 } | 46 } |
57 // Else skip it. The typeArrayKlass in the header never needs scavenging. | 47 // Else skip it. The TypeArrayKlass in the header never needs scavenging. |
58 } | 48 } |
59 | 49 |
60 inline void oopDesc::follow_contents(ParCompactionManager* cm) { | 50 inline void oopDesc::follow_contents(ParCompactionManager* cm) { |
61 assert (PSParallelCompact::mark_bitmap()->is_marked(this), | 51 assert (PSParallelCompact::mark_bitmap()->is_marked(this), |
62 "should be marked"); | 52 "should be marked"); |
63 blueprint()->oop_follow_contents(cm, this); | 53 klass()->oop_follow_contents(cm, this); |
64 } | 54 } |
65 | 55 |
66 // Used by parallel old GC. | 56 // Used by parallel old GC. |
67 | |
68 inline void oopDesc::follow_header(ParCompactionManager* cm) { | |
69 if (UseCompressedOops) { | |
70 PSParallelCompact::mark_and_push(cm, compressed_klass_addr()); | |
71 } else { | |
72 PSParallelCompact::mark_and_push(cm, klass_addr()); | |
73 } | |
74 } | |
75 | 57 |
76 inline oop oopDesc::forward_to_atomic(oop p) { | 58 inline oop oopDesc::forward_to_atomic(oop p) { |
77 assert(ParNewGeneration::is_legal_forward_ptr(p), | 59 assert(ParNewGeneration::is_legal_forward_ptr(p), |
78 "illegal forwarding pointer value."); | 60 "illegal forwarding pointer value."); |
79 markOop oldMark = mark(); | 61 markOop oldMark = mark(); |
95 oldMark = curMark; | 77 oldMark = curMark; |
96 } | 78 } |
97 return forwardee(); | 79 return forwardee(); |
98 } | 80 } |
99 | 81 |
100 inline void oopDesc::update_header() { | 82 inline void oopDesc::update_header(ParCompactionManager* cm) { |
101 if (UseCompressedOops) { | 83 PSParallelCompact::adjust_klass(cm, klass()); |
102 PSParallelCompact::adjust_pointer(compressed_klass_addr()); | |
103 } else { | |
104 PSParallelCompact::adjust_pointer(klass_addr()); | |
105 } | |
106 } | 84 } |
107 | 85 |
108 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP | 86 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP |