hotspot/src/share/vm/classfile/javaClasses.cpp
changeset 29081 c61eb4914428
parent 27694 543f6042c268
child 30296 95baefac8485
child 30107 e3d259b825a1
equal deleted inserted replaced
29080:a16b0d9a08f5 29081:c61eb4914428
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2015, 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.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "classfile/altHashing.hpp"
    26 #include "classfile/altHashing.hpp"
    27 #include "classfile/javaClasses.hpp"
    27 #include "classfile/javaClasses.inline.hpp"
    28 #include "classfile/stringTable.hpp"
    28 #include "classfile/stringTable.hpp"
    29 #include "classfile/vmSymbols.hpp"
    29 #include "classfile/vmSymbols.hpp"
    30 #include "code/debugInfo.hpp"
    30 #include "code/debugInfo.hpp"
    31 #include "code/pcDesc.hpp"
    31 #include "code/pcDesc.hpp"
    32 #include "compiler/compilerOracle.hpp"
    32 #include "compiler/compilerOracle.hpp"
    37 #include "oops/fieldStreams.hpp"
    37 #include "oops/fieldStreams.hpp"
    38 #include "oops/instanceKlass.hpp"
    38 #include "oops/instanceKlass.hpp"
    39 #include "oops/instanceMirrorKlass.hpp"
    39 #include "oops/instanceMirrorKlass.hpp"
    40 #include "oops/klass.hpp"
    40 #include "oops/klass.hpp"
    41 #include "oops/method.hpp"
    41 #include "oops/method.hpp"
       
    42 #include "oops/objArrayOop.inline.hpp"
       
    43 #include "oops/oop.inline.hpp"
    42 #include "oops/symbol.hpp"
    44 #include "oops/symbol.hpp"
    43 #include "oops/typeArrayOop.hpp"
    45 #include "oops/typeArrayOop.hpp"
    44 #include "prims/jvmtiRedefineClassesTrace.hpp"
    46 #include "prims/jvmtiRedefineClassesTrace.hpp"
    45 #include "runtime/fieldDescriptor.hpp"
    47 #include "runtime/fieldDescriptor.hpp"
    46 #include "runtime/handles.inline.hpp"
    48 #include "runtime/handles.inline.hpp"
   146 int java_lang_String::offset_offset = 0;
   148 int java_lang_String::offset_offset = 0;
   147 int java_lang_String::count_offset  = 0;
   149 int java_lang_String::count_offset  = 0;
   148 int java_lang_String::hash_offset   = 0;
   150 int java_lang_String::hash_offset   = 0;
   149 
   151 
   150 bool java_lang_String::initialized  = false;
   152 bool java_lang_String::initialized  = false;
       
   153 
       
   154 bool java_lang_String::is_instance(oop obj) {
       
   155   return is_instance_inlined(obj);
       
   156 }
   151 
   157 
   152 void java_lang_String::compute_offsets() {
   158 void java_lang_String::compute_offsets() {
   153   assert(!initialized, "offsets should be initialized only once");
   159   assert(!initialized, "offsets should be initialized only once");
   154 
   160 
   155   Klass* k = SystemDictionary::String_klass();
   161   Klass* k = SystemDictionary::String_klass();
  2728   if (klass_oop != NULL) {
  2734   if (klass_oop != NULL) {
  2729     compute_offset(_vmentry_offset, klass_oop, vmSymbols::vmentry_name(), vmSymbols::java_lang_invoke_MemberName_signature());
  2735     compute_offset(_vmentry_offset, klass_oop, vmSymbols::vmentry_name(), vmSymbols::java_lang_invoke_MemberName_signature());
  2730   }
  2736   }
  2731 }
  2737 }
  2732 
  2738 
       
  2739 bool java_lang_invoke_LambdaForm::is_instance(oop obj) {
       
  2740   return obj != NULL && is_subclass(obj->klass());
       
  2741 }
       
  2742 
       
  2743 
  2733 oop java_lang_invoke_MethodHandle::type(oop mh) {
  2744 oop java_lang_invoke_MethodHandle::type(oop mh) {
  2734   return mh->obj_field(_type_offset);
  2745   return mh->obj_field(_type_offset);
  2735 }
  2746 }
  2736 
  2747 
  2737 void java_lang_invoke_MethodHandle::set_type(oop mh, oop mtype) {
  2748 void java_lang_invoke_MethodHandle::set_type(oop mh, oop mtype) {
  3072       return true;
  3083       return true;
  3073     }
  3084     }
  3074     assert(++loop_count > 0, "loop_count overflow");
  3085     assert(++loop_count > 0, "loop_count overflow");
  3075   } while (acl != NULL);
  3086   } while (acl != NULL);
  3076   return false;
  3087   return false;
       
  3088 }
       
  3089 
       
  3090 bool java_lang_ClassLoader::is_instance(oop obj) {
       
  3091   return obj != NULL && is_subclass(obj->klass());
  3077 }
  3092 }
  3078 
  3093 
  3079 
  3094 
  3080 // For class loader classes, parallelCapable defined
  3095 // For class loader classes, parallelCapable defined
  3081 // based on non-null field
  3096 // based on non-null field