src/share/vm/gc_interface/collectedHeap.inline.hpp

changeset 6627
cf9f24de0b93
parent 6198
55fb97c4c58d
child 6876
710a3c8b516e
child 7031
ee019285a52c
     1.1 --- a/src/share/vm/gc_interface/collectedHeap.inline.hpp	Tue Apr 15 17:02:20 2014 -0400
     1.2 +++ b/src/share/vm/gc_interface/collectedHeap.inline.hpp	Fri Apr 11 20:02:37 2014 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -70,7 +70,7 @@
    1.11  }
    1.12  
    1.13  // Support for jvmti and dtrace
    1.14 -inline void post_allocation_notify(KlassHandle klass, oop obj) {
    1.15 +inline void post_allocation_notify(KlassHandle klass, oop obj, int size) {
    1.16    // support low memory notifications (no-op if not enabled)
    1.17    LowMemoryDetector::detect_low_memory_for_collected_pools();
    1.18  
    1.19 @@ -80,18 +80,19 @@
    1.20    if (DTraceAllocProbes) {
    1.21      // support for Dtrace object alloc event (no-op most of the time)
    1.22      if (klass() != NULL && klass()->name() != NULL) {
    1.23 -      SharedRuntime::dtrace_object_alloc(obj);
    1.24 +      SharedRuntime::dtrace_object_alloc(obj, size);
    1.25      }
    1.26    }
    1.27  }
    1.28  
    1.29  void CollectedHeap::post_allocation_setup_obj(KlassHandle klass,
    1.30 -                                              HeapWord* obj) {
    1.31 +                                              HeapWord* obj,
    1.32 +                                              int size) {
    1.33    post_allocation_setup_common(klass, obj);
    1.34    assert(Universe::is_bootstrapping() ||
    1.35           !((oop)obj)->is_array(), "must not be an array");
    1.36    // notify jvmti and dtrace
    1.37 -  post_allocation_notify(klass, (oop)obj);
    1.38 +  post_allocation_notify(klass, (oop)obj, size);
    1.39  }
    1.40  
    1.41  void CollectedHeap::post_allocation_setup_array(KlassHandle klass,
    1.42 @@ -103,9 +104,10 @@
    1.43    assert(length >= 0, "length should be non-negative");
    1.44    ((arrayOop)obj)->set_length(length);
    1.45    post_allocation_setup_common(klass, obj);
    1.46 -  assert(((oop)obj)->is_array(), "must be an array");
    1.47 +  oop new_obj = (oop)obj;
    1.48 +  assert(new_obj->is_array(), "must be an array");
    1.49    // notify jvmti and dtrace (must be after length is set for dtrace)
    1.50 -  post_allocation_notify(klass, (oop)obj);
    1.51 +  post_allocation_notify(klass, new_obj, new_obj->size());
    1.52  }
    1.53  
    1.54  HeapWord* CollectedHeap::common_mem_allocate_noinit(KlassHandle klass, size_t size, TRAPS) {
    1.55 @@ -199,7 +201,7 @@
    1.56    assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
    1.57    assert(size >= 0, "int won't convert to size_t");
    1.58    HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL);
    1.59 -  post_allocation_setup_obj(klass, obj);
    1.60 +  post_allocation_setup_obj(klass, obj, size);
    1.61    NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size));
    1.62    return (oop)obj;
    1.63  }

mercurial