Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/javaClasses.hpp @ 7643:3ac7d10a6572
Merge with hsx25/hotspot.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 31 Jan 2013 15:42:25 +0100 |
parents | 989155e2d07a c73c3f2c5b3b |
children | b9a918201d47 |
comparison
equal
deleted
inserted
replaced
7573:17b6a63fe7c2 | 7643:3ac7d10a6572 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 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. |
205 // Interface to java.lang.Class objects | 205 // Interface to java.lang.Class objects |
206 | 206 |
207 #define CLASS_INJECTED_FIELDS(macro) \ | 207 #define CLASS_INJECTED_FIELDS(macro) \ |
208 macro(java_lang_Class, klass, intptr_signature, false) \ | 208 macro(java_lang_Class, klass, intptr_signature, false) \ |
209 GRAAL_ONLY(macro(java_lang_Class, graal_mirror, object_signature, false))\ | 209 GRAAL_ONLY(macro(java_lang_Class, graal_mirror, object_signature, false))\ |
210 macro(java_lang_Class, resolved_constructor, intptr_signature, false) \ | |
211 macro(java_lang_Class, array_klass, intptr_signature, false) \ | 210 macro(java_lang_Class, array_klass, intptr_signature, false) \ |
212 macro(java_lang_Class, oop_size, int_signature, false) \ | 211 macro(java_lang_Class, oop_size, int_signature, false) \ |
213 macro(java_lang_Class, static_oop_field_count, int_signature, false) | 212 macro(java_lang_Class, static_oop_field_count, int_signature, false) |
214 | 213 |
215 class java_lang_Class : AllStatic { | 214 class java_lang_Class : AllStatic { |
217 | 216 |
218 private: | 217 private: |
219 // The fake offsets are added by the class loader when java.lang.Class is loaded | 218 // The fake offsets are added by the class loader when java.lang.Class is loaded |
220 | 219 |
221 static int _klass_offset; | 220 static int _klass_offset; |
222 static int _resolved_constructor_offset; | |
223 static int _array_klass_offset; | 221 static int _array_klass_offset; |
224 | 222 |
225 static int _oop_size_offset; | 223 static int _oop_size_offset; |
226 static int _static_oop_field_count_offset; | 224 static int _static_oop_field_count_offset; |
227 #ifdef GRAAL | 225 #ifdef GRAAL |
256 return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); | 254 return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); |
257 } | 255 } |
258 static bool is_primitive(oop java_class); | 256 static bool is_primitive(oop java_class); |
259 static BasicType primitive_type(oop java_class); | 257 static BasicType primitive_type(oop java_class); |
260 static oop primitive_mirror(BasicType t); | 258 static oop primitive_mirror(BasicType t); |
261 // JVM_NewInstance support | |
262 static Method* resolved_constructor(oop java_class); | |
263 static void set_resolved_constructor(oop java_class, Method* constructor); | |
264 // JVM_NewArray support | 259 // JVM_NewArray support |
265 static Klass* array_klass(oop java_class); | 260 static Klass* array_klass(oop java_class); |
266 static void set_array_klass(oop java_class, Klass* klass); | 261 static void set_array_klass(oop java_class, Klass* klass); |
267 // compiler support for class operations | 262 // compiler support for class operations |
268 static int klass_offset_in_bytes() { return _klass_offset; } | 263 static int klass_offset_in_bytes() { return _klass_offset; } |
269 static int resolved_constructor_offset_in_bytes() { return _resolved_constructor_offset; } | |
270 static int array_klass_offset_in_bytes() { return _array_klass_offset; } | 264 static int array_klass_offset_in_bytes() { return _array_klass_offset; } |
271 // Support for classRedefinedCount field | 265 // Support for classRedefinedCount field |
272 static int classRedefinedCount(oop the_class_mirror); | 266 static int classRedefinedCount(oop the_class_mirror); |
273 static void set_classRedefinedCount(oop the_class_mirror, int value); | 267 static void set_classRedefinedCount(oop the_class_mirror, int value); |
274 | 268 |
477 static int cause_offset; | 471 static int cause_offset; |
478 static int stackTrace_offset; | 472 static int stackTrace_offset; |
479 static int static_unassigned_stacktrace_offset; | 473 static int static_unassigned_stacktrace_offset; |
480 | 474 |
481 // Printing | 475 // Printing |
482 static char* print_stack_element_to_buffer(Method* method, int bci); | 476 static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci); |
483 static void print_to_stream(Handle stream, const char* str); | |
484 // StackTrace (programmatic access, new since 1.4) | 477 // StackTrace (programmatic access, new since 1.4) |
485 static void clear_stacktrace(oop throwable); | 478 static void clear_stacktrace(oop throwable); |
486 // No stack trace available | 479 // No stack trace available |
487 static const char* no_stack_trace_message(); | 480 static const char* no_stack_trace_message(); |
488 // Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed) | 481 // Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed) |
498 static int get_detailMessage_offset() { return detailMessage_offset;} | 491 static int get_detailMessage_offset() { return detailMessage_offset;} |
499 // Message | 492 // Message |
500 static oop message(oop throwable); | 493 static oop message(oop throwable); |
501 static oop message(Handle throwable); | 494 static oop message(Handle throwable); |
502 static void set_message(oop throwable, oop value); | 495 static void set_message(oop throwable, oop value); |
503 // Print stack trace stored in exception by call-back to Java | 496 static void print_stack_element(outputStream *st, Handle mirror, int method, |
504 // Note: this is no longer used in Merlin, but we still suppport | 497 int version, int bci); |
505 // it for compatibility. | 498 static void print_stack_element(outputStream *st, methodHandle method, int bci); |
506 static void print_stack_trace(oop throwable, oop print_stream); | |
507 static void print_stack_element(Handle stream, Method* method, int bci); | |
508 static void print_stack_element(outputStream *st, Method* method, int bci); | |
509 static void print_stack_usage(Handle stream); | 499 static void print_stack_usage(Handle stream); |
510 | 500 |
511 // Allocate space for backtrace (created but stack trace not filled in) | 501 // Allocate space for backtrace (created but stack trace not filled in) |
512 static void allocate_backtrace(Handle throwable, TRAPS); | 502 static void allocate_backtrace(Handle throwable, TRAPS); |
513 // Fill in current stack trace for throwable with preallocated backtrace (no GC) | 503 // Fill in current stack trace for throwable with preallocated backtrace (no GC) |
1271 static void set_methodName(oop element, oop value); | 1261 static void set_methodName(oop element, oop value); |
1272 static void set_fileName(oop element, oop value); | 1262 static void set_fileName(oop element, oop value); |
1273 static void set_lineNumber(oop element, int value); | 1263 static void set_lineNumber(oop element, int value); |
1274 | 1264 |
1275 // Create an instance of StackTraceElement | 1265 // Create an instance of StackTraceElement |
1276 static oop create(methodHandle m, int bci, TRAPS); | 1266 static oop create(Handle mirror, int method, int version, int bci, TRAPS); |
1267 static oop create(methodHandle method, int bci, TRAPS); | |
1277 | 1268 |
1278 // Debugging | 1269 // Debugging |
1279 friend class JavaClasses; | 1270 friend class JavaClasses; |
1280 }; | 1271 }; |
1281 | 1272 |