hotspot/src/share/vm/classfile/javaClasses.inline.hpp
author alanb
Fri, 07 Apr 2017 08:04:46 +0000
changeset 44520 0553e129e0ec
parent 43422 d4693bf78777
child 46505 fd4bc78630b1
permissions -rw-r--r--
8177530: Module system implementation refresh (4/2017) Reviewed-by: lfoltan, sspitsyn Contributed-by: alan.bateman@oracle.com, harold.seigel@oracle.com, mandy.chung@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     1
/*
44520
0553e129e0ec 8177530: Module system implementation refresh (4/2017)
alanb
parents: 43422
diff changeset
     2
 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     4
 *
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     8
 *
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    13
 * accompanied this code).
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    14
 *
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    18
 *
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    21
 * questions.
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    22
 *
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    23
 */
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    24
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    25
#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    26
#define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    27
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    28
#include "classfile/javaClasses.hpp"
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    29
#include "oops/oop.inline.hpp"
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    30
#include "oops/oopsHierarchy.hpp"
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
    31
35498
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    32
void java_lang_String::set_coder(oop string, jbyte coder) {
43422
d4693bf78777 8172169: Re-examine String field optionality
redestad
parents: 40020
diff changeset
    33
  assert(initialized && (coder_offset > 0), "Must be initialized");
d4693bf78777 8172169: Re-examine String field optionality
redestad
parents: 40020
diff changeset
    34
  string->byte_field_put(coder_offset, coder);
35498
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    35
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    36
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    37
void java_lang_String::set_value_raw(oop string, typeArrayOop buffer) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    38
  assert(initialized, "Must be initialized");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    39
  string->obj_field_put_raw(value_offset, buffer);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    40
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    41
void java_lang_String::set_value(oop string, typeArrayOop buffer) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    42
  assert(initialized && (value_offset > 0), "Must be initialized");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    43
  string->obj_field_put(value_offset, (oop)buffer);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    44
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    45
void java_lang_String::set_hash(oop string, unsigned int hash) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    46
  assert(initialized && (hash_offset > 0), "Must be initialized");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    47
  string->int_field_put(hash_offset, hash);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    48
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    49
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    50
// Accessors
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    51
typeArrayOop java_lang_String::value(oop java_string) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    52
  assert(initialized && (value_offset > 0), "Must be initialized");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    53
  assert(is_instance(java_string), "must be java_string");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    54
  return (typeArrayOop) java_string->obj_field(value_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    55
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    56
unsigned int java_lang_String::hash(oop java_string) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    57
  assert(initialized && (hash_offset > 0), "Must be initialized");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    58
  assert(is_instance(java_string), "must be java_string");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    59
  return java_string->int_field(hash_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    60
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    61
bool java_lang_String::is_latin1(oop java_string) {
43422
d4693bf78777 8172169: Re-examine String field optionality
redestad
parents: 40020
diff changeset
    62
  assert(initialized && (coder_offset > 0), "Must be initialized");
35498
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    63
  assert(is_instance(java_string), "must be java_string");
43422
d4693bf78777 8172169: Re-examine String field optionality
redestad
parents: 40020
diff changeset
    64
  jbyte coder = java_string->byte_field(coder_offset);
d4693bf78777 8172169: Re-examine String field optionality
redestad
parents: 40020
diff changeset
    65
  assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings");
d4693bf78777 8172169: Re-examine String field optionality
redestad
parents: 40020
diff changeset
    66
  return coder == CODER_LATIN1;
35498
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    67
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    68
int java_lang_String::length(oop java_string) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    69
  assert(initialized, "Must be initialized");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    70
  assert(is_instance(java_string), "must be java_string");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    71
  typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset));
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    72
  if (value_array == NULL) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    73
    return 0;
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    74
  }
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    75
  int arr_length = value_array->length();
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    76
  if (!is_latin1(java_string)) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    77
    assert((arr_length & 1) == 0, "should be even for UTF16 string");
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    78
    arr_length >>= 1; // convert number of bytes to number of elements
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    79
  }
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    80
  return arr_length;
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    81
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    82
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    83
bool java_lang_String::is_instance_inlined(oop obj) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    84
  return obj != NULL && obj->klass() == SystemDictionary::String_klass();
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    85
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    86
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    87
// Accessors
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    88
oop java_lang_ref_Reference::referent(oop ref) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    89
  return ref->obj_field(referent_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    90
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    91
void java_lang_ref_Reference::set_referent(oop ref, oop value) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    92
  ref->obj_field_put(referent_offset, value);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    93
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    94
void java_lang_ref_Reference::set_referent_raw(oop ref, oop value) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    95
  ref->obj_field_put_raw(referent_offset, value);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    96
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    97
HeapWord* java_lang_ref_Reference::referent_addr(oop ref) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    98
  return ref->obj_field_addr<HeapWord>(referent_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
    99
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   100
oop java_lang_ref_Reference::next(oop ref) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   101
  return ref->obj_field(next_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   102
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   103
void java_lang_ref_Reference::set_next(oop ref, oop value) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   104
  ref->obj_field_put(next_offset, value);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   105
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   106
void java_lang_ref_Reference::set_next_raw(oop ref, oop value) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   107
  ref->obj_field_put_raw(next_offset, value);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   108
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   109
HeapWord* java_lang_ref_Reference::next_addr(oop ref) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   110
  return ref->obj_field_addr<HeapWord>(next_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   111
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   112
oop java_lang_ref_Reference::discovered(oop ref) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   113
  return ref->obj_field(discovered_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   114
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   115
void java_lang_ref_Reference::set_discovered(oop ref, oop value) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   116
  ref->obj_field_put(discovered_offset, value);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   117
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   118
void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   119
  ref->obj_field_put_raw(discovered_offset, value);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   120
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   121
HeapWord* java_lang_ref_Reference::discovered_addr(oop ref) {
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   122
  return ref->obj_field_addr<HeapWord>(discovered_offset);
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   123
}
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 34280
diff changeset
   124
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   125
inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   126
  site->obj_field_put_volatile(_target_offset, target);
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   127
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   128
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   129
inline oop  java_lang_invoke_CallSite::target(oop site) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   130
  return site->obj_field(_target_offset);
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   131
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   132
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   133
inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   134
  site->obj_field_put(_target_offset, target);
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   135
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   136
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   137
inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   138
  return obj != NULL && is_subclass(obj->klass());
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   139
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   140
31037
01a5c5fa5681 8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents: 30263
diff changeset
   141
inline bool java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(oop obj) {
01a5c5fa5681 8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents: 30263
diff changeset
   142
  return obj != NULL && is_subclass(obj->klass());
01a5c5fa5681 8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents: 30263
diff changeset
   143
}
01a5c5fa5681 8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents: 30263
diff changeset
   144
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   145
inline bool java_lang_invoke_MemberName::is_instance(oop obj) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   146
  return obj != NULL && is_subclass(obj->klass());
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   147
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   148
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   149
inline bool java_lang_invoke_MethodType::is_instance(oop obj) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   150
  return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   151
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   152
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   153
inline bool java_lang_invoke_MethodHandle::is_instance(oop obj) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   154
  return obj != NULL && is_subclass(obj->klass());
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   155
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   156
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   157
inline bool java_lang_Class::is_instance(oop obj) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   158
  return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   159
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   160
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   161
inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   162
  return obj != NULL && is_subclass(obj->klass());
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   163
}
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   164
44520
0553e129e0ec 8177530: Module system implementation refresh (4/2017)
alanb
parents: 43422
diff changeset
   165
inline bool java_lang_Module::is_instance(oop obj) {
0553e129e0ec 8177530: Module system implementation refresh (4/2017)
alanb
parents: 43422
diff changeset
   166
  return obj != NULL && obj->klass() == SystemDictionary::Module_klass();
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 35498
diff changeset
   167
}
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 35498
diff changeset
   168
34280
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   169
inline int Backtrace::merge_bci_and_version(int bci, int version) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   170
  // only store u2 for version, checking for overflow.
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   171
  if (version > USHRT_MAX || version < 0) version = USHRT_MAX;
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   172
  assert((jushort)bci == bci, "bci should be short");
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   173
  return build_int_from_shorts(version, bci);
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   174
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   175
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   176
inline int Backtrace::merge_mid_and_cpref(int mid, int cpref) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   177
  // only store u2 for mid and cpref, checking for overflow.
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   178
  assert((jushort)mid == mid, "mid should be short");
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   179
  assert((jushort)cpref == cpref, "cpref should be short");
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   180
  return build_int_from_shorts(cpref, mid);
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   181
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   182
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   183
inline int Backtrace::bci_at(unsigned int merged) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   184
  return extract_high_short_from_int(merged);
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   185
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   186
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   187
inline int Backtrace::version_at(unsigned int merged) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   188
  return extract_low_short_from_int(merged);
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   189
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   190
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   191
inline int Backtrace::mid_at(unsigned int merged) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   192
  return extract_high_short_from_int(merged);
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   193
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   194
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   195
inline int Backtrace::cpref_at(unsigned int merged) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   196
  return extract_low_short_from_int(merged);
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   197
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   198
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   199
inline int Backtrace::get_line_number(const methodHandle& method, int bci) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   200
  int line_number = 0;
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   201
  if (method->is_native()) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   202
    // Negative value different from -1 below, enabling Java code in
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   203
    // class java.lang.StackTraceElement to distinguish "native" from
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   204
    // "no LineNumberTable".  JDK tests for -2.
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   205
    line_number = -2;
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   206
  } else {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   207
    // Returns -1 if no LineNumberTable, and otherwise actual line number
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   208
    line_number = method->line_number_from_bci(bci);
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   209
    if (line_number == -1 && ShowHiddenFrames) {
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   210
      line_number = bci + 1000000;
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   211
    }
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   212
  }
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   213
  return line_number;
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   214
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   215
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   216
inline Symbol* Backtrace::get_source_file_name(InstanceKlass* holder, int version) {
37475
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   217
  // RedefineClasses() currently permits redefine operations to
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   218
  // happen in parallel using a "last one wins" philosophy. That
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   219
  // spec laxness allows the constant pool entry associated with
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   220
  // the source_file_name_index for any older constant pool version
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   221
  // to be unstable so we shouldn't try to use it.
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   222
  if (holder->constants()->version() != version) {
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   223
    return NULL;
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   224
  } else {
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   225
    return holder->source_file_name();
0da78fa10d78 8148772: VM crash in nsk/jvmti/RedefineClasses/StressRedefine: assert failed: Corrupted constant pool
coleenp
parents: 36508
diff changeset
   226
  }
34280
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   227
}
72bfaaffee36 8143911: Reintegrate JEP 259: Stack-Walking API
mchung
parents: 34273
diff changeset
   228
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff changeset
   229
#endif // SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP