Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/shared/markSweep.inline.hpp @ 17764:595c0f60d50d
8029075: String deduplication in G1
Summary: Implementation of JEP 192, http://openjdk.java.net/jeps/192
Reviewed-by: brutisso, tschatzl, coleenp
author | pliden |
---|---|
date | Tue, 18 Mar 2014 19:07:22 +0100 |
parents | 55fb97c4c58d |
children | 52b4284cb496 |
comparison
equal
deleted
inserted
replaced
17763:6e7e363c5a8f | 17764:595c0f60d50d |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2000, 2014, 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. |
28 #include "gc_implementation/shared/markSweep.hpp" | 28 #include "gc_implementation/shared/markSweep.hpp" |
29 #include "gc_interface/collectedHeap.hpp" | 29 #include "gc_interface/collectedHeap.hpp" |
30 #include "utilities/stack.inline.hpp" | 30 #include "utilities/stack.inline.hpp" |
31 #include "utilities/macros.hpp" | 31 #include "utilities/macros.hpp" |
32 #if INCLUDE_ALL_GCS | 32 #if INCLUDE_ALL_GCS |
33 #include "gc_implementation/g1/g1StringDedup.hpp" | |
33 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp" | 34 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp" |
34 #endif // INCLUDE_ALL_GCS | 35 #endif // INCLUDE_ALL_GCS |
35 | 36 |
36 inline void MarkSweep::mark_object(oop obj) { | 37 inline void MarkSweep::mark_object(oop obj) { |
38 #if INCLUDE_ALL_GCS | |
39 if (G1StringDedup::is_enabled()) { | |
40 // We must enqueue the object before it is marked | |
41 // as we otherwise can't read the object's age. | |
42 G1StringDedup::enqueue_from_mark(obj); | |
43 } | |
44 #endif | |
37 // some marks may contain information we need to preserve so we store them away | 45 // some marks may contain information we need to preserve so we store them away |
38 // and overwrite the mark. We'll restore it at the end of markSweep. | 46 // and overwrite the mark. We'll restore it at the end of markSweep. |
39 markOop mark = obj->mark(); | 47 markOop mark = obj->mark(); |
40 obj->set_mark(markOopDesc::prototype()->set_marked()); | 48 obj->set_mark(markOopDesc::prototype()->set_marked()); |
41 | 49 |