Mercurial > hg > graal-compiler
comparison src/share/vm/oops/klass.hpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 70f715dfbb41 b632e80fc9dc |
children | dddcdb7ae209 |
comparison
equal
deleted
inserted
replaced
5891:fd8832ae511d | 6275:957c266d8bc5 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2012, 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. |
147 // that the factory knows how to initialize the C++ vtable with the | 147 // that the factory knows how to initialize the C++ vtable with the |
148 // right pointer value. All other common initializations are handled | 148 // right pointer value. All other common initializations are handled |
149 // by the shared "base_create" subroutines. | 149 // by the shared "base_create" subroutines. |
150 // | 150 // |
151 virtual void* allocate_permanent(KlassHandle& klass, int size, TRAPS) const = 0; | 151 virtual void* allocate_permanent(KlassHandle& klass, int size, TRAPS) const = 0; |
152 void post_new_init_klass(KlassHandle& klass, klassOop obj, int size) const; | 152 void post_new_init_klass(KlassHandle& klass, klassOop obj) const; |
153 | 153 |
154 // Every subclass on which vtbl_value is called must include this macro. | 154 // Every subclass on which vtbl_value is called must include this macro. |
155 // Delay the installation of the klassKlass pointer until after the | 155 // Delay the installation of the klassKlass pointer until after the |
156 // the vtable for a new klass has been installed (after the call to new()). | 156 // the vtable for a new klass has been installed (after the call to new()). |
157 #define DEFINE_ALLOCATE_PERMANENT(thisKlass) \ | 157 #define DEFINE_ALLOCATE_PERMANENT(thisKlass) \ |
158 void* allocate_permanent(KlassHandle& klass_klass, int size, TRAPS) const { \ | 158 void* allocate_permanent(KlassHandle& klass_klass, int size, TRAPS) const { \ |
159 void* result = new(klass_klass, size, THREAD) thisKlass(); \ | 159 void* result = new(klass_klass, size, THREAD) thisKlass(); \ |
160 if (HAS_PENDING_EXCEPTION) return NULL; \ | 160 if (HAS_PENDING_EXCEPTION) return NULL; \ |
161 klassOop new_klass = ((Klass*) result)->as_klassOop(); \ | 161 klassOop new_klass = ((Klass*) result)->as_klassOop(); \ |
162 OrderAccess::storestore(); \ | 162 OrderAccess::storestore(); \ |
163 post_new_init_klass(klass_klass, new_klass, size); \ | 163 post_new_init_klass(klass_klass, new_klass); \ |
164 return result; \ | 164 return result; \ |
165 } | 165 } |
166 | 166 |
167 bool null_vtbl() { return *(intptr_t*)this == 0; } | 167 bool null_vtbl() { return *(intptr_t*)this == 0; } |
168 | 168 |
811 virtual void oop_print_on (oop obj, outputStream* st); | 811 virtual void oop_print_on (oop obj, outputStream* st); |
812 | 812 |
813 // Verification | 813 // Verification |
814 virtual const char* internal_name() const = 0; | 814 virtual const char* internal_name() const = 0; |
815 virtual void oop_verify_on(oop obj, outputStream* st); | 815 virtual void oop_verify_on(oop obj, outputStream* st); |
816 virtual void oop_verify_old_oop(oop obj, oop* p, bool allow_dirty); | |
817 virtual void oop_verify_old_oop(oop obj, narrowOop* p, bool allow_dirty); | |
818 // tells whether obj is partially constructed (gc during class loading) | 816 // tells whether obj is partially constructed (gc during class loading) |
819 virtual bool oop_partially_loaded(oop obj) const { return false; } | 817 virtual bool oop_partially_loaded(oop obj) const { return false; } |
820 virtual void oop_set_partially_loaded(oop obj) {}; | 818 virtual void oop_set_partially_loaded(oop obj) {}; |
821 | 819 |
822 #ifndef PRODUCT | 820 #ifndef PRODUCT |