hotspot/src/share/vm/utilities/internalVMTests.cpp
author ehelin
Thu, 14 Jan 2016 15:09:11 +0100
changeset 35519 9200162499f7
child 35529 39376b4613b5
permissions -rw-r--r--
8146994: Move internal vm tests to a separate file Reviewed-by: coleenp, stefank, kbarrett, mikael
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35519
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     1
/*
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     4
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     8
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    13
 * accompanied this code).
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    14
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    18
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    21
 * questions.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    22
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    23
 */
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    24
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    25
#include "precompiled.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    26
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    27
#ifndef PRODUCT
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    28
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    29
#include "classfile/altHashing.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    30
#include "compiler/directivesParser.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    31
#include "gc/shared/collectedHeap.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    32
#include "gc/shared/gcTimer.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    33
#include "memory/guardedMemory.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    34
#include "utilities/internalVMTests.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    35
#include "utilities/json.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    36
#include "utilities/macros.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    37
#include "utilities/ostream.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    38
#include "utilities/quickSort.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    39
#if INCLUDE_ALL_GCS
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    40
#include "gc/g1/heapRegionRemSet.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    41
#endif
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    42
#if INCLUDE_VM_STRUCTS
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    43
#include "runtime/vmStructs.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    44
#endif
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    45
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    46
#define run_unit_test(unit_test_function_call)              \
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    47
  tty->print_cr("Running test: " #unit_test_function_call); \
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    48
  unit_test_function_call
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    49
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    50
// Forward declaration
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    51
void TestDependencyContext_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    52
void test_semaphore();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    53
void TestOS_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    54
void TestReservedSpace_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    55
void TestReserveMemorySpecial_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    56
void TestVirtualSpace_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    57
void TestMetaspaceAux_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    58
void TestMetachunk_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    59
void TestVirtualSpaceNode_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    60
void TestNewSize_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    61
void TestOldSize_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    62
void TestKlass_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    63
void TestBitMap_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    64
void TestAsUtf8();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    65
void Test_linked_list();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    66
void TestResourcehash_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    67
void TestChunkedList_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    68
void Test_log_length();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    69
void Test_TempNewSymbol();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    70
#if INCLUDE_ALL_GCS
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    71
void TestOldFreeSpaceCalculation_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    72
void TestG1BiasedArray_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    73
void TestBufferingOopClosure_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    74
void TestCodeCacheRemSet_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    75
void FreeRegionList_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    76
void IHOP_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    77
void test_memset_with_concurrent_readers() NOT_DEBUG_RETURN;
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    78
void TestPredictions_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    79
void WorkerDataArray_test();
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    80
#endif
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    81
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    82
void InternalVMTests::run() {
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    83
  tty->print_cr("Running internal VM tests");
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    84
  run_unit_test(TestDependencyContext_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    85
  run_unit_test(test_semaphore());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    86
  run_unit_test(TestOS_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    87
  run_unit_test(TestReservedSpace_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    88
  run_unit_test(TestReserveMemorySpecial_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    89
  run_unit_test(TestVirtualSpace_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    90
  run_unit_test(TestMetaspaceAux_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    91
  run_unit_test(TestMetachunk_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    92
  run_unit_test(TestVirtualSpaceNode_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    93
  run_unit_test(GlobalDefinitions::test_globals());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    94
  run_unit_test(GCTimerAllTest::all());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    95
  run_unit_test(arrayOopDesc::test_max_array_length());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    96
  run_unit_test(CollectedHeap::test_is_in());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    97
  run_unit_test(QuickSort::test_quick_sort());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    98
  run_unit_test(GuardedMemory::test_guarded_memory());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    99
  run_unit_test(AltHashing::test_alt_hash());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   100
  run_unit_test(TestNewSize_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   101
  run_unit_test(TestOldSize_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   102
  run_unit_test(TestKlass_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   103
  run_unit_test(TestBitMap_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   104
  run_unit_test(TestAsUtf8());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   105
  run_unit_test(TestResourcehash_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   106
  run_unit_test(ObjectMonitor::sanity_checks());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   107
  run_unit_test(Test_linked_list());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   108
  run_unit_test(TestChunkedList_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   109
  run_unit_test(JSONTest::test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   110
  run_unit_test(Test_log_length());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   111
  run_unit_test(DirectivesParser::test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   112
  run_unit_test(Test_TempNewSymbol());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   113
#if INCLUDE_VM_STRUCTS
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   114
  run_unit_test(VMStructs::test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   115
#endif
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   116
#if INCLUDE_ALL_GCS
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   117
  run_unit_test(TestOldFreeSpaceCalculation_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   118
  run_unit_test(TestG1BiasedArray_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   119
  run_unit_test(TestBufferingOopClosure_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   120
  run_unit_test(TestCodeCacheRemSet_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   121
  if (UseG1GC) {
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   122
    run_unit_test(FreeRegionList_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   123
    run_unit_test(IHOP_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   124
  }
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   125
  run_unit_test(test_memset_with_concurrent_readers());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   126
  run_unit_test(TestPredictions_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   127
  run_unit_test(WorkerDataArray_test());
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   128
#endif
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   129
  tty->print_cr("All internal VM tests passed");
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   130
}
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   131
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
   132
#endif