Mercurial > hg > truffle
comparison src/share/vm/opto/graphKit.hpp @ 3249:e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
Summary: A referent object that is only weakly reachable at the start of concurrent marking but is re-attached to the strongly reachable object graph during marking may not be marked as live. This can cause the reference object to be processed prematurely and leave dangling pointers to the referent object. Implement a read barrier for the java.lang.ref.Reference::referent field by intrinsifying the Reference.get() method, and intercepting accesses though JNI, reflection, and Unsafe, so that when a non-null referent object is read it is also logged in an SATB buffer.
Reviewed-by: kvn, iveresov, never, tonyp, dholmes
author | johnc |
---|---|
date | Thu, 07 Apr 2011 09:53:20 -0700 |
parents | 9dc311b8473e |
children | 92add02409c9 |
comparison
equal
deleted
inserted
replaced
3248:e6beb62de02d | 3249:e1162778c1c8 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2011, 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. |
542 const TypePtr* adr_type, | 542 const TypePtr* adr_type, |
543 Node* val, | 543 Node* val, |
544 BasicType bt); | 544 BasicType bt); |
545 | 545 |
546 // For the few case where the barriers need special help | 546 // For the few case where the barriers need special help |
547 void pre_barrier(Node* ctl, Node* obj, Node* adr, uint adr_idx, | 547 void pre_barrier(bool do_load, Node* ctl, |
548 Node* val, const TypeOopPtr* val_type, BasicType bt); | 548 Node* obj, Node* adr, uint adr_idx, Node* val, const TypeOopPtr* val_type, |
549 Node* pre_val, | |
550 BasicType bt); | |
549 | 551 |
550 void post_barrier(Node* ctl, Node* store, Node* obj, Node* adr, uint adr_idx, | 552 void post_barrier(Node* ctl, Node* store, Node* obj, Node* adr, uint adr_idx, |
551 Node* val, BasicType bt, bool use_precise); | 553 Node* val, BasicType bt, bool use_precise); |
552 | 554 |
553 // Return addressing for an array element. | 555 // Return addressing for an array element. |
667 // vanilla/CMS post barrier | 669 // vanilla/CMS post barrier |
668 void write_barrier_post(Node *store, Node* obj, | 670 void write_barrier_post(Node *store, Node* obj, |
669 Node* adr, uint adr_idx, Node* val, bool use_precise); | 671 Node* adr, uint adr_idx, Node* val, bool use_precise); |
670 | 672 |
671 // G1 pre/post barriers | 673 // G1 pre/post barriers |
672 void g1_write_barrier_pre(Node* obj, | 674 void g1_write_barrier_pre(bool do_load, |
675 Node* obj, | |
673 Node* adr, | 676 Node* adr, |
674 uint alias_idx, | 677 uint alias_idx, |
675 Node* val, | 678 Node* val, |
676 const TypeOopPtr* val_type, | 679 const TypeOopPtr* val_type, |
680 Node* pre_val, | |
677 BasicType bt); | 681 BasicType bt); |
678 | 682 |
679 void g1_write_barrier_post(Node* store, | 683 void g1_write_barrier_post(Node* store, |
680 Node* obj, | 684 Node* obj, |
681 Node* adr, | 685 Node* adr, |