--- old/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp 2014-02-10 11:49:38.850258131 +0100 +++ new/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp 2014-02-10 11:49:38.738258126 +0100 @@ -26,6 +26,7 @@ #define SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP #include "memory/iterator.hpp" +#include "oops/oopsHierarchy.hpp" #include "runtime/os.hpp" #include "utilities/debug.hpp" @@ -45,11 +46,15 @@ protected: static const size_t BufferLength = 1024; - // The full-sized oops are filled in from the bottom, - // while the narrowOops are filled in from the top. - void* _buffer[BufferLength]; - void** _oop_top; - void** _narrowOop_bottom; + // We need to know if the buffered addresses contain oops or narrowOops. + // We can't tag the addresses the way StarTask does, because we need to + // be able to handle unaligned addresses coming from oops embedded in code. + // + // The addresses for the full-sized oops are filled in from the bottom, + // while the addresses for the narrowOops are filled in from the top. + OopOrNarrowOopStar _buffer[BufferLength]; + OopOrNarrowOopStar* _oop_top; + OopOrNarrowOopStar* _narrowOop_bottom; OopClosure* _oc; double _closure_app_seconds; @@ -65,7 +70,7 @@ // Process addresses containing full-sized oops. void process_oops() { - for (void** curr = _buffer; curr < _oop_top; ++curr) { + for (OopOrNarrowOopStar* curr = _buffer; curr < _oop_top; ++curr) { _oc->do_oop((oop*)(*curr)); } _oop_top = _buffer; @@ -73,7 +78,7 @@ // Process addresses containing narrow oops. void process_narrowOops() { - for (void** curr = _buffer + BufferLength - 1; curr > _narrowOop_bottom; --curr) { + for (OopOrNarrowOopStar* curr = _buffer + BufferLength - 1; curr > _narrowOop_bottom; --curr) { _oc->do_oop((narrowOop*)(*curr)); } _narrowOop_bottom = _buffer + BufferLength - 1; @@ -98,13 +103,13 @@ void add_narrowOop(narrowOop* p) { assert(!is_buffer_full(), "Buffer should not be full"); - *_narrowOop_bottom = (void*)p; + *_narrowOop_bottom = (OopOrNarrowOopStar)p; _narrowOop_bottom--; } void add_oop(oop* p) { assert(!is_buffer_full(), "Buffer should not be full"); - *_oop_top = (void*)p; + *_oop_top = (OopOrNarrowOopStar)p; _oop_top++; } --- old/src/share/vm/gc_implementation/g1/g1RemSet.hpp 2014-02-10 11:49:39.254258148 +0100 +++ new/src/share/vm/gc_implementation/g1/g1RemSet.hpp 2014-02-10 11:49:39.146258143 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it --- old/src/share/vm/prims/jni.cpp 2014-02-10 11:49:39.710258167 +0100 +++ new/src/share/vm/prims/jni.cpp 2014-02-10 11:49:39.590258162 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. *