hotspot/src/share/vm/c1/c1_Compiler.cpp
author thartmann
Tue, 03 Nov 2015 09:41:03 +0100
changeset 33628 09241459a8b8
parent 33451 0712796e4039
child 33638 ef49ed90010b
permissions -rw-r--r--
8141132: JEP 254: Compact Strings Summary: Adopt a more space-efficient internal representation for strings. Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti Contributed-by: Brent Christian <brent.christian@oracle.com>, Vivek Deshpande <vivek.r.deshpande@intel.com>, Tobias Hartmann <tobias.hartmann@oracle.com>, Charlie Hunt <charlie.hunt@oracle.com>, Vladimir Kozlov <vladimir.kozlov@oracle.com>, Roger Riggs <roger.riggs@oracle.com>, Xueming Shen <xueming.shen@oracle.com>, Aleksey Shipilev <aleksey.shipilev@oracle.com>, Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
22236
44508442b8da 8029305: add type tag to AbstractCompiler
twisti
parents: 22234
diff changeset
     2
 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    26
#include "c1/c1_Compilation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    27
#include "c1/c1_Compiler.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    28
#include "c1/c1_FrameMap.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    29
#include "c1/c1_GraphBuilder.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    30
#include "c1/c1_LinearScan.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    31
#include "c1/c1_MacroAssembler.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    32
#include "c1/c1_Runtime1.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    33
#include "c1/c1_ValueType.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    34
#include "compiler/compileBroker.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    35
#include "interpreter/linkResolver.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    36
#include "memory/allocation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    37
#include "memory/allocation.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    38
#include "memory/resourceArea.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    39
#include "prims/nativeLookup.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    40
#include "runtime/arguments.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    41
#include "runtime/interfaceSupport.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5707
diff changeset
    42
#include "runtime/sharedRuntime.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
22236
44508442b8da 8029305: add type tag to AbstractCompiler
twisti
parents: 22234
diff changeset
    45
Compiler::Compiler() : AbstractCompiler(c1) {
44508442b8da 8029305: add type tag to AbstractCompiler
twisti
parents: 22234
diff changeset
    46
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
20707
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    48
void Compiler::init_c1_runtime() {
5707
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    49
  BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 22236
diff changeset
    50
  Arena* arena = new (mtCompiler) Arena(mtCompiler);
5707
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    51
  Runtime1::initialize(buffer_blob);
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    52
  FrameMap::initialize();
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    53
  // initialize data structures
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    54
  ValueType::initialize(arena);
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    55
  GraphBuilder::initialize();
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    56
  // note: to use more than one instance of LinearScan at a time this function call has to
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    57
  //       be moved somewhere outside of this constructor:
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    58
  Interval::initialize(arena);
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    59
}
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    60
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    61
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
void Compiler::initialize() {
20707
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    63
  // Buffer blob must be allocated per C1 compiler thread at startup
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    64
  BufferBlob* buffer_blob = init_buffer_blob();
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    65
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    66
  if (should_perform_init()) {
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    67
    if (buffer_blob == NULL) {
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    68
      // When we come here we are in state 'initializing'; entire C1 compilation
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    69
      // can be shut down.
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    70
      set_state(failed);
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    71
    } else {
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    72
      init_c1_runtime();
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    73
      set_state(initialized);
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    74
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
26796
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25946
diff changeset
    78
int Compiler::code_buffer_size() {
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25946
diff changeset
    79
  assert(SegmentedCodeCache, "Should be only used with a segmented code cache");
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25946
diff changeset
    80
  return Compilation::desired_max_code_buffer_size() + Compilation::desired_max_constant_size();
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25946
diff changeset
    81
}
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25946
diff changeset
    82
20707
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    83
BufferBlob* Compiler::init_buffer_blob() {
17623
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    84
  // Allocate buffer blob once at startup since allocation for each
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    85
  // compilation seems to be too expensive (at least on Intel win32).
20707
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    86
  assert (CompilerThread::current()->get_buffer_blob() == NULL, "Should initialize only once");
17623
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    87
5707
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    88
  // setup CodeBuffer.  Preallocate a BufferBlob of size
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    89
  // NMethodSizeLimit plus some extra space for constants.
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    90
  int code_buffer_size = Compilation::desired_max_code_buffer_size() +
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    91
    Compilation::desired_max_constant_size();
17623
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    92
20707
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    93
  BufferBlob* buffer_blob = BufferBlob::create("C1 temporary CodeBuffer", code_buffer_size);
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
    94
  if (buffer_blob != NULL) {
17623
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    95
    CompilerThread::current()->set_buffer_blob(buffer_blob);
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    96
  }
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    97
6295813086d0 8014430: JRE crashes instead of stop compilation on full Code Cache. Internal Error (c1_Compiler.cpp:87)
anoll
parents: 13963
diff changeset
    98
  return buffer_blob;
5707
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
    99
}
6c66849ed24e 6958292: C1: Enable parallel compilation
iveresov
parents: 5547
diff changeset
   100
31962
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   101
bool Compiler::is_intrinsic_supported(methodHandle method) {
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   102
  vmIntrinsics::ID id = method->intrinsic_id();
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   103
  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   104
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   105
  if (method->is_synchronized()) {
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   106
    // C1 does not support intrinsification of synchronized methods.
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   107
    return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   108
  }
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   109
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   110
  switch (id) {
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   111
  case vmIntrinsics::_compareAndSwapLong:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   112
    if (!VM_Version::supports_cx8()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   113
    break;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   114
  case vmIntrinsics::_getAndAddInt:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   115
    if (!VM_Version::supports_atomic_getadd4()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   116
    break;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   117
  case vmIntrinsics::_getAndAddLong:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   118
    if (!VM_Version::supports_atomic_getadd8()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   119
    break;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   120
  case vmIntrinsics::_getAndSetInt:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   121
    if (!VM_Version::supports_atomic_getset4()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   122
    break;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   123
  case vmIntrinsics::_getAndSetLong:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   124
    if (!VM_Version::supports_atomic_getset8()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   125
    break;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   126
  case vmIntrinsics::_getAndSetObject:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   127
#ifdef _LP64
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   128
    if (!UseCompressedOops && !VM_Version::supports_atomic_getset8()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   129
    if (UseCompressedOops && !VM_Version::supports_atomic_getset4()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   130
#else
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   131
    if (!VM_Version::supports_atomic_getset4()) return false;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   132
#endif
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   133
    break;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   134
  case vmIntrinsics::_arraycopy:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   135
  case vmIntrinsics::_currentTimeMillis:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   136
  case vmIntrinsics::_nanoTime:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   137
  case vmIntrinsics::_Reference_get:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   138
    // Use the intrinsic version of Reference.get() so that the value in
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   139
    // the referent field can be registered by the G1 pre-barrier code.
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   140
    // Also to prevent commoning reads from this field across safepoint
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   141
    // since GC can change its value.
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   142
  case vmIntrinsics::_loadFence:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   143
  case vmIntrinsics::_storeFence:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   144
  case vmIntrinsics::_fullFence:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   145
  case vmIntrinsics::_floatToRawIntBits:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   146
  case vmIntrinsics::_intBitsToFloat:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   147
  case vmIntrinsics::_doubleToRawLongBits:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   148
  case vmIntrinsics::_longBitsToDouble:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   149
  case vmIntrinsics::_getClass:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   150
  case vmIntrinsics::_isInstance:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   151
  case vmIntrinsics::_currentThread:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   152
  case vmIntrinsics::_dabs:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   153
  case vmIntrinsics::_dsqrt:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   154
  case vmIntrinsics::_dsin:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   155
  case vmIntrinsics::_dcos:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   156
  case vmIntrinsics::_dtan:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   157
  case vmIntrinsics::_dlog:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   158
  case vmIntrinsics::_dlog10:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   159
  case vmIntrinsics::_dexp:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   160
  case vmIntrinsics::_dpow:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   161
  case vmIntrinsics::_getObject:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   162
  case vmIntrinsics::_getBoolean:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   163
  case vmIntrinsics::_getByte:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   164
  case vmIntrinsics::_getShort:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   165
  case vmIntrinsics::_getChar:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   166
  case vmIntrinsics::_getInt:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   167
  case vmIntrinsics::_getLong:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   168
  case vmIntrinsics::_getFloat:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   169
  case vmIntrinsics::_getDouble:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   170
  case vmIntrinsics::_putObject:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   171
  case vmIntrinsics::_putBoolean:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   172
  case vmIntrinsics::_putByte:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   173
  case vmIntrinsics::_putShort:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   174
  case vmIntrinsics::_putChar:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   175
  case vmIntrinsics::_putInt:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   176
  case vmIntrinsics::_putLong:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   177
  case vmIntrinsics::_putFloat:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   178
  case vmIntrinsics::_putDouble:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   179
  case vmIntrinsics::_getObjectVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   180
  case vmIntrinsics::_getBooleanVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   181
  case vmIntrinsics::_getByteVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   182
  case vmIntrinsics::_getShortVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   183
  case vmIntrinsics::_getCharVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   184
  case vmIntrinsics::_getIntVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   185
  case vmIntrinsics::_getLongVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   186
  case vmIntrinsics::_getFloatVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   187
  case vmIntrinsics::_getDoubleVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   188
  case vmIntrinsics::_putObjectVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   189
  case vmIntrinsics::_putBooleanVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   190
  case vmIntrinsics::_putByteVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   191
  case vmIntrinsics::_putShortVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   192
  case vmIntrinsics::_putCharVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   193
  case vmIntrinsics::_putIntVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   194
  case vmIntrinsics::_putLongVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   195
  case vmIntrinsics::_putFloatVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   196
  case vmIntrinsics::_putDoubleVolatile:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   197
  case vmIntrinsics::_getByte_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   198
  case vmIntrinsics::_getShort_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   199
  case vmIntrinsics::_getChar_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   200
  case vmIntrinsics::_getInt_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   201
  case vmIntrinsics::_getLong_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   202
  case vmIntrinsics::_getFloat_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   203
  case vmIntrinsics::_getDouble_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   204
  case vmIntrinsics::_putByte_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   205
  case vmIntrinsics::_putShort_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   206
  case vmIntrinsics::_putChar_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   207
  case vmIntrinsics::_putInt_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   208
  case vmIntrinsics::_putLong_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   209
  case vmIntrinsics::_putFloat_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   210
  case vmIntrinsics::_putDouble_raw:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   211
  case vmIntrinsics::_putOrderedObject:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   212
  case vmIntrinsics::_putOrderedInt:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   213
  case vmIntrinsics::_putOrderedLong:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   214
  case vmIntrinsics::_getShortUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   215
  case vmIntrinsics::_getCharUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   216
  case vmIntrinsics::_getIntUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   217
  case vmIntrinsics::_getLongUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   218
  case vmIntrinsics::_putShortUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   219
  case vmIntrinsics::_putCharUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   220
  case vmIntrinsics::_putIntUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   221
  case vmIntrinsics::_putLongUnaligned:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   222
  case vmIntrinsics::_checkIndex:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   223
  case vmIntrinsics::_updateCRC32:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   224
  case vmIntrinsics::_updateBytesCRC32:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   225
  case vmIntrinsics::_updateByteBufferCRC32:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   226
  case vmIntrinsics::_compareAndSwapInt:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   227
  case vmIntrinsics::_compareAndSwapObject:
33628
09241459a8b8 8141132: JEP 254: Compact Strings
thartmann
parents: 33451
diff changeset
   228
  case vmIntrinsics::_getCharStringU:
09241459a8b8 8141132: JEP 254: Compact Strings
thartmann
parents: 33451
diff changeset
   229
  case vmIntrinsics::_putCharStringU:
31962
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   230
#ifdef TRACE_HAVE_INTRINSICS
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   231
  case vmIntrinsics::_classID:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   232
  case vmIntrinsics::_threadID:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   233
  case vmIntrinsics::_counterTime:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   234
#endif
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   235
    break;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   236
  default:
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   237
    return false; // Intrinsics not on the previous list are not available.
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   238
  }
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   239
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   240
  return true;
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   241
}
d05e0a4d1b43 8130832: Extend the WhiteBox API to provide information about the availability of compiler intrinsics
zmajo
parents: 26796
diff changeset
   242
33451
0712796e4039 8137167: JEP165: Compiler Control: Implementation task
neliasso
parents: 32582
diff changeset
   243
void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci, DirectiveSet* directive) {
20707
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
   244
  BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 17623
diff changeset
   245
  assert(buffer_blob != NULL, "Must exist");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  // invoke compilation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
    // We are nested here because we need for the destructor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
    // of Compilation to occur before we release the any
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
    // competing compiler thread
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
    ResourceMark rm;
33451
0712796e4039 8137167: JEP165: Compiler Control: Implementation task
neliasso
parents: 32582
diff changeset
   252
    Compilation c(this, env, method, entry_bci, buffer_blob, directive);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
void Compiler::print_timers() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  Compilation::print_timers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
}