hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
changeset 20282 7f9cbdf89af2
parent 13728 882756847a04
child 22547 4671971bad6b
equal deleted inserted replaced
20281:e4d33bd980c4 20282:7f9cbdf89af2
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2013, 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.
    89 template <class T> inline bool has_partial_array_mask(T* ref) {
    89 template <class T> inline bool has_partial_array_mask(T* ref) {
    90   return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK;
    90   return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK;
    91 }
    91 }
    92 
    92 
    93 template <class T> inline T* set_partial_array_mask(T obj) {
    93 template <class T> inline T* set_partial_array_mask(T obj) {
    94   assert(((uintptr_t)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!");
    94   assert(((uintptr_t)(void *)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!");
    95   return (T*) ((uintptr_t)obj | G1_PARTIAL_ARRAY_MASK);
    95   return (T*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK);
    96 }
    96 }
    97 
    97 
    98 template <class T> inline oop clear_partial_array_mask(T* ref) {
    98 template <class T> inline oop clear_partial_array_mask(T* ref) {
    99   return oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK);
    99   return cast_to_oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK);
   100 }
   100 }
   101 
   101 
   102 class G1ParScanPartialArrayClosure : public G1ParClosureSuper {
   102 class G1ParScanPartialArrayClosure : public G1ParClosureSuper {
   103   G1ParScanClosure _scanner;
   103   G1ParScanClosure _scanner;
   104 
   104