This commit is contained in:
Kim Barrett 2017-06-23 01:08:42 +00:00
commit 08361aedba
102 changed files with 587 additions and 389 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -69,6 +69,7 @@ JVM_CFLAGS_TARGET_DEFINES += \
-DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
-DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
-DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
-DINCLUDE_SUFFIX_COMPILER=_$(HOTSPOT_TOOLCHAIN_TYPE) \
-DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
-D$(HOTSPOT_TARGET_CPU_DEFINE) \
-DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -38,6 +38,7 @@
#include "opto/compile.hpp"
#include "opto/intrinsicnode.hpp"
#include "opto/node.hpp"
#include "prims/jvm.h"
#include "runtime/biasedLocking.hpp"
#include "runtime/icache.hpp"
#include "runtime/interfaceSupport.hpp"
@ -2011,6 +2012,12 @@ void MacroAssembler::stop(const char* msg) {
hlt(0);
}
void MacroAssembler::unimplemented(const char* what) {
char* b = new char[1024];
jio_snprintf(b, 1024, "unimplemented: %s", what);
stop(b);
}
// If a constant does not fit in an immediate field, generate some
// number of MOV instructions and then perform the operation.
void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm,

View File

@ -941,7 +941,7 @@ public:
void untested() { stop("untested"); }
void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); }
void unimplemented(const char* what = "");
void should_not_reach_here() { stop("should not reach here"); }

View File

@ -32,6 +32,7 @@
#include "interpreter/interpreterRuntime.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#define __ _masm->

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/java.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/stubCodeGenerator.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/java.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/stubCodeGenerator.hpp"

View File

@ -29,6 +29,7 @@
#include "interpreter/interpreter.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#define __ _masm->

View File

@ -28,6 +28,7 @@
#include "asm/macroAssembler.inline.hpp"
#include "compiler/disassembler.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "runtime/stubCodeGenerator.hpp"

View File

@ -29,6 +29,7 @@
#include "interpreter/interpreter.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#ifdef PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -28,6 +28,7 @@
#include "compiler/disassembler.hpp"
#include "code/compiledIC.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/java.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "vm_version_s390.hpp"

View File

@ -31,6 +31,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/klass.inline.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/interfaceSupport.hpp"
@ -1392,6 +1393,13 @@ void MacroAssembler::untested(const char* what) {
}
void MacroAssembler::unimplemented(const char* what) {
char* b = new char[1024];
jio_snprintf(b, 1024, "unimplemented: %s", what);
stop(b);
}
void MacroAssembler::stop_subroutine() {
RegistersForDebugging::save_registers(this);

View File

@ -1130,7 +1130,7 @@ public:
void stop(const char* msg); // prints msg, dumps registers and stops execution
void warn(const char* msg); // prints msg, but don't stop
void untested(const char* what = "");
void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); }
void unimplemented(const char* what = "");
void should_not_reach_here() { stop("should not reach here"); }
void print_CPU_state();

View File

@ -29,6 +29,7 @@
#include "interpreter/interp_masm.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#define __ _masm->

View File

@ -26,6 +26,7 @@
#include "asm/macroAssembler.inline.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "runtime/stubCodeGenerator.hpp"

View File

@ -32,6 +32,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/klass.inline.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/interfaceSupport.hpp"
@ -3640,6 +3641,12 @@ void MacroAssembler::os_breakpoint() {
call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint)));
}
void MacroAssembler::unimplemented(const char* what) {
char* b = new char[1024];
jio_snprintf(b, 1024, "unimplemented: %s", what);
stop(b);
}
#ifdef _LP64
#define XSTATE_BV 0x200
#endif

View File

@ -628,7 +628,7 @@ class MacroAssembler: public Assembler {
void untested() { stop("untested"); }
void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); }
void unimplemented(const char* what = "");
void should_not_reach_here() { stop("should not reach here"); }

View File

@ -29,6 +29,7 @@
#include "interpreter/interpreterRuntime.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#define __ _masm->

View File

@ -27,6 +27,7 @@
#include "asm/macroAssembler.inline.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "runtime/stubCodeGenerator.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#include "precompiled.hpp"
#ifdef __APPLE__
#include "prims/jvm.h"
#include "decoder_machO.hpp"
#include <cxxabi.h>

View File

@ -27,6 +27,7 @@
#include "aot/aotLoader.inline.hpp"
#include "jvmci/jvmciRuntime.hpp"
#include "oops/method.hpp"
#include "prims/jvm.h"
#include "runtime/os.hpp"
GrowableArray<AOTCodeHeap*>* AOTLoader::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTCodeHeap*> (2, true);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,7 @@
#include "c1/c1_LIR.hpp"
#include "c1/c1_LinearScan.hpp"
#include "c1/c1_ValueStack.hpp"
#include "prims/jvm.h"
#ifndef PRODUCT

View File

@ -49,6 +49,7 @@
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiExport.hpp"
#include "runtime/init.hpp"
#include "runtime/reflection.hpp"

View File

@ -33,6 +33,7 @@
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "utilities/copy.hpp"
#include "utilities/macros.hpp"

View File

@ -51,6 +51,7 @@
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/compilationPolicy.hpp"

View File

@ -39,6 +39,7 @@
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/instanceKlass.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/javaCalls.hpp"

View File

@ -58,6 +58,7 @@
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayKlass.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiEnvBase.hpp"
#include "prims/resolvedMethodTable.hpp"
#include "prims/methodHandles.hpp"

View File

@ -27,6 +27,7 @@
#include "compiler/compilerDirectives.hpp"
#include "memory/oopFactory.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/handles.inline.hpp"
#include "utilities/xmlstream.hpp"

View File

@ -33,6 +33,7 @@
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "prims/forte.hpp"
#include "prims/jvm.h"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/mutexLocker.hpp"

View File

@ -40,6 +40,7 @@
#include "memory/resourceArea.hpp"
#include "oops/methodData.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiImpl.hpp"
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.inline.hpp"

View File

@ -38,6 +38,7 @@
#include "oops/methodData.hpp"
#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "prims/nativeLookup.hpp"
#include "prims/whitebox.hpp"
#include "runtime/arguments.hpp"
@ -51,8 +52,10 @@
#include "runtime/sweeper.hpp"
#include "runtime/timerTrace.hpp"
#include "trace/tracing.hpp"
#include "utilities/debug.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
#ifdef COMPILER1
#include "c1/c1_Compiler.hpp"
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,7 @@
#include "compiler/compileLog.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/method.hpp"
#include "prims/jvm.h"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,7 @@
#include "oops/klass.hpp"
#include "oops/method.hpp"
#include "oops/symbol.hpp"
#include "prims/jvm.h"
#include "runtime/handles.inline.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/os.hpp"

View File

@ -35,6 +35,8 @@
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,7 @@
#include "gc/shared/collectedHeap.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.hpp"

View File

@ -66,7 +66,9 @@
#include "services/management.hpp"
#include "services/memTracker.hpp"
#include "services/memoryService.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/stack.inline.hpp"
#include <math.h>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,6 +30,7 @@
#include "memory/resourceArea.hpp"
#include "logging/log.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "utilities/copy.hpp"
/* Copyright (c) 1992, 2016, Oracle and/or its affiliates, and Stanford University.

View File

@ -31,7 +31,9 @@
#include "runtime/handles.hpp"
#include "runtime/perfData.hpp"
#include "runtime/safepoint.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
// A "CollectedHeap" is an implementation of a java heap for HotSpot. This
// is an abstract class: there may be many different kinds of heaps. This

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "gc/shared/gcId.hpp"
#include "prims/jvm.h"
#include "runtime/safepoint.hpp"
#include "runtime/thread.inline.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -53,6 +53,8 @@
#include "runtime/vmThread.hpp"
#include "services/management.hpp"
#include "services/memoryService.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/macros.hpp"
#include "utilities/stack.inline.hpp"
#include "utilities/vmError.hpp"

View File

@ -40,6 +40,7 @@
#include "oops/method.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#include "prims/nativeLookup.hpp"
#include "runtime/compilationPolicy.hpp"

View File

@ -25,6 +25,7 @@
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/javaCalls.hpp"
#include "runtime/handles.hpp"
#include "jvmci/jvmciJavaClasses.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "jvmci/jvmci_globals.hpp"
#include "prims/jvm.h"
#include "utilities/defaultStream.hpp"
#include "runtime/globals_extension.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,6 +34,7 @@
#include "logging/logTagSet.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/os.inline.hpp"
#include "runtime/semaphore.hpp"
#include "utilities/globalDefinitions.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logDecorations.hpp"
#include "prims/jvm.h"
#include "runtime/os.inline.hpp"
#include "runtime/thread.inline.hpp"
#include "services/management.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
#include "logging/logConfiguration.hpp"
#include "logging/logFileOutput.hpp"
#include "memory/allocation.inline.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "runtime/os.inline.hpp"
#include "utilities/globalDefinitions.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@
#include "logging/logFileStreamOutput.hpp"
#include "logging/logMessageBuffer.hpp"
#include "memory/allocation.inline.hpp"
#include "prims/jvm.h"
static bool initialized;
static union {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
#include "logging/logOutput.hpp"
#include "logging/logTagSet.hpp"
#include "memory/allocation.inline.hpp"
#include "prims/jvm.h"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.inline.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,7 @@
#include "logging/logTagSet.hpp"
#include "logging/logTagSetDescriptions.hpp"
#include "memory/allocation.inline.hpp"
#include "prims/jvm.h"
#include "utilities/ostream.hpp"
LogTagSet* LogTagSet::_list = NULL;

View File

@ -38,6 +38,7 @@
#include "memory/metadataFactory.hpp"
#include "memory/oopFactory.hpp"
#include "oops/objArrayOop.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/java.hpp"

View File

@ -49,6 +49,7 @@
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "oops/typeArrayKlass.hpp"
#include "prims/jvm.h"
#include "runtime/timerTrace.hpp"
#include "runtime/os.hpp"
#include "runtime/signature.hpp"

View File

@ -73,7 +73,9 @@
#include "runtime/vm_operations.hpp"
#include "services/memoryService.hpp"
#include "utilities/copy.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/hashtable.inline.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"

View File

@ -39,6 +39,7 @@
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/fieldType.hpp"
#include "runtime/init.hpp"
#include "runtime/javaCalls.hpp"

View File

@ -28,6 +28,7 @@
#include "oops/generateOopMap.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "prims/jvm.h"
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/relocator.hpp"

View File

@ -57,6 +57,7 @@
#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiRedefineClasses.hpp"
#include "prims/jvmtiThreadState.hpp"

View File

@ -35,6 +35,7 @@
#include "oops/method.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "runtime/handles.inline.hpp"
#include "utilities/copy.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,6 +32,7 @@
#include "oops/symbol.hpp"
#include "prims/jni.h"
#include "prims/jniCheck.hpp"
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/fieldDescriptor.hpp"
#include "runtime/handles.hpp"

View File

@ -27,6 +27,7 @@
#include "classfile/javaClasses.hpp"
#include "classfile/vmSymbols.hpp"
#include "prims/jvm.h"
#include "runtime/frame.inline.hpp"
#include "runtime/globals.hpp"
#include "runtime/interfaceSupport.hpp"

View File

@ -39,6 +39,7 @@
#include "memory/allocation.inline.hpp"
#include "memory/universe.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/arguments_ext.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
#include "classfile/stringTable.hpp"
#include "classfile/symbolTable.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "runtime/commandLineFlagConstraintList.hpp"
#include "runtime/commandLineFlagRangeList.hpp"

View File

@ -40,6 +40,7 @@
#include "oops/oop.inline.hpp"
#include "oops/fieldStreams.hpp"
#include "oops/verifyOopClosure.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/compilationPolicy.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -48,7 +48,9 @@
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
#include "utilities/debug.hpp"
#include "utilities/decoder.hpp"
#include "utilities/formatBuffer.hpp"
RegisterMap::RegisterMap(JavaThread *thread, bool update_map) {
_thread = thread;

View File

@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "runtime/globals.hpp"
#include "runtime/globals_extension.hpp"

View File

@ -25,7 +25,7 @@
#ifndef SHARE_VM_RUNTIME_GLOBALS_HPP
#define SHARE_VM_RUNTIME_GLOBALS_HPP
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
#include <float.h> // for DBL_MAX

View File

@ -48,6 +48,7 @@
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/biasedLocking.hpp"

View File

@ -26,6 +26,7 @@
#include "classfile/vmSymbols.hpp"
#include "logging/log.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/mutex.hpp"

View File

@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "runtime/java.hpp"
#include "runtime/mutex.hpp"

View File

@ -45,6 +45,7 @@
#include "oops/objArrayKlass.hpp"
#include "oops/oop.inline.hpp"
#include "prims/forte.hpp"
#include "prims/jvm.h"
#include "prims/jvmtiExport.hpp"
#include "prims/methodHandles.hpp"
#include "prims/nativeLookup.hpp"

View File

@ -50,6 +50,7 @@
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/verifyOopClosure.hpp"
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiThreadState.hpp"

View File

@ -38,6 +38,8 @@
#include "services/diagnosticCommand.hpp"
#include "services/heapDumper.hpp"
#include "services/writeableFlags.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
volatile bool AttachListener::_initialized;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/thread.hpp"
#include "services/diagnosticArgument.hpp"

View File

@ -30,6 +30,7 @@
#include "gc/shared/vmGCOperations.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/globals.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/os.hpp"
@ -39,6 +40,8 @@
#include "services/heapDumper.hpp"
#include "services/management.hpp"
#include "services/writeableFlags.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/macros.hpp"
#include "oops/objArrayOop.inline.hpp"

View File

@ -26,6 +26,7 @@
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "services/diagnosticArgument.hpp"

View File

@ -34,6 +34,7 @@
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/javaCalls.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/os.hpp"

View File

@ -56,6 +56,8 @@
#include "services/memoryService.hpp"
#include "services/runtimeService.hpp"
#include "services/threadService.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/macros.hpp"
PerfVariable* Management::_begin_vm_creation_time = NULL;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "prims/jvm.h"
#include "runtime/mutex.hpp"
#include "services/memBaseline.hpp"
#include "services/memReporter.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,9 @@
#ifndef SHARE_VM_SERVICES_WRITEABLEFLAG_HPP
#define SHARE_VM_SERVICES_WRITEABLEFLAG_HPP
#include "runtime/globals.hpp"
#include "utilities/formatBuffer.hpp"
class WriteableFlags : AllStatic {
private:
// a writeable flag setter accepting either 'jvalue' or 'char *' values

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_UTILITIES_BREAKPOINT_HPP
#define SHARE_VM_UTILITIES_BREAKPOINT_HPP
// Provide BREAKPOINT macro for requesting stop in the debugger.
// We presently only have one non-default definition, so it's not
// worth going through the COMPILER_HEADER() dispatch, with all
// non-visCPP files being empty.
#ifdef TARGET_COMPILER_visCPP
#ifndef _WIN64
#define BREAKPOINT __asm { int 3 }
#endif // _WIN64
#endif // TARGET_COMPILER_visCPP
// If no more specific definition provided, default to calling a
// function that is defined per-platform. See also os::breakpoint().
#ifndef BREAKPOINT
extern "C" void breakpoint();
#define BREAKPOINT ::breakpoint()
#endif
#endif // SHARE_VM_UTILITIES_BREAKPOINT_HPP

View File

@ -0,0 +1,87 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_UTILITIES_COMPILERWARNINGS_HPP
#define SHARE_VM_UTILITIES_COMPILERWARNINGS_HPP
// Macros related to control of compiler warnings.
// We presently only have interesting macros here for gcc and variants,
// so it's not worth going through the COMPILER_HEADER() dispatch, with
// all the non-gcc files being empty.
#ifdef TARGET_COMPILER_gcc
// Diagnostic pragmas like the ones defined below in PRAGMA_FORMAT_NONLITERAL_IGNORED
// were only introduced in GCC 4.2. Because we have no other possibility to ignore
// these warnings for older versions of GCC, we simply don't decorate our printf-style
// functions with __attribute__(format) in that case.
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || (__GNUC__ > 4)
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(fmt,vargs) __attribute__((format(printf, fmt, vargs)))
#endif
#ifndef ATTRIBUTE_SCANF
#define ATTRIBUTE_SCANF(fmt,vargs) __attribute__((format(scanf, fmt, vargs)))
#endif
#endif // gcc version check
#define PRAGMA_FORMAT_NONLITERAL_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \
_Pragma("GCC diagnostic ignored \"-Wformat-security\"")
#define PRAGMA_FORMAT_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat\"")
#if defined(__clang_major__) && \
(__clang_major__ >= 4 || \
(__clang_major__ >= 3 && __clang_minor__ >= 1)) || \
((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
// Tested to work with clang version 3.1 and better.
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
#endif // clang/gcc version check
#endif // TARGET_COMPILER_gcc
// Defaults when not defined for the TARGET_COMPILER_xxx.
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(fmt, vargs)
#endif
#ifndef ATTRIBUTE_SCANF
#define ATTRIBUTE_SCANF(fmt, vargs)
#endif
#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED
#define PRAGMA_FORMAT_NONLITERAL_IGNORED
#endif
#ifndef PRAGMA_FORMAT_IGNORED
#define PRAGMA_FORMAT_IGNORED
#endif
#ifndef PRAGMA_DIAG_PUSH
#define PRAGMA_DIAG_PUSH
#endif
#ifndef PRAGMA_DIAG_POP
#define PRAGMA_DIAG_POP
#endif
#endif // SHARE_VM_UTILITIES_COMPILERWARNINGS_HPP

View File

@ -36,6 +36,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "prims/privilegedStack.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.hpp"
@ -51,6 +52,7 @@
#include "services/heapDumper.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/macros.hpp"
#include "utilities/vmError.hpp"
@ -80,14 +82,6 @@
# endif
#endif // PRODUCT
FormatBufferResource::FormatBufferResource(const char * format, ...)
: FormatBufferBase((char*)resource_allocate_bytes(FormatBufferBase::BufferSize)) {
va_list argp;
va_start(argp, format);
jio_vsnprintf(_buf, FormatBufferBase::BufferSize, format, argp);
va_end(argp);
}
ATTRIBUTE_PRINTF(1, 2)
void warning(const char* format, ...) {
if (PrintWarnings) {
@ -601,7 +595,7 @@ extern "C" void ps() { // print stack
f = f.sender(&reg_map);
tty->print("(guessing starting frame id=" PTR_FORMAT " based on current fp)\n", p2i(f.id()));
p->trace_stack_from(vframe::new_vframe(&f, &reg_map, p));
pd_ps(f);
pd_ps(f);
#endif // PRODUCT
}
@ -765,57 +759,13 @@ void help() {
tty->print_cr(" ndebug() - undo debug");
}
#endif // !PRODUCT
void print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size) {
// see if it's a valid frame
if (fr.pc()) {
st->print_cr("Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)");
int count = 0;
while (count++ < StackPrintLimit) {
fr.print_on_error(st, buf, buf_size);
st->cr();
// Compiled code may use EBP register on x86 so it looks like
// non-walkable C frame. Use frame.sender() for java frames.
if (t && t->is_Java_thread()) {
// Catch very first native frame by using stack address.
// For JavaThread stack_base and stack_size should be set.
if (!t->on_local_stack((address)(fr.real_fp() + 1))) {
break;
}
if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) {
RegisterMap map((JavaThread*)t, false); // No update
fr = fr.sender(&map);
} else {
fr = os::get_sender_for_C_frame(&fr);
}
} else {
// is_first_C_frame() does only simple checks for frame pointer,
// it will pass if java compiled code has a pointer in EBP.
if (os::is_first_C_frame(&fr)) break;
fr = os::get_sender_for_C_frame(&fr);
}
}
if (count > StackPrintLimit) {
st->print_cr("...<more frames>...");
}
st->cr();
}
}
#ifndef PRODUCT
extern "C" void pns(void* sp, void* fp, void* pc) { // print native stack
Command c("pns");
static char buf[O_BUFLEN];
Thread* t = Thread::current_or_null();
// Call generic frame constructor (certain arguments may be ignored)
frame fr(sp, fp, pc);
print_native_stack(tty, fr, t, buf, sizeof(buf));
VMError::print_native_stack(tty, fr, t, buf, sizeof(buf));
}
#endif // !PRODUCT

View File

@ -25,97 +25,11 @@
#ifndef SHARE_VM_UTILITIES_DEBUG_HPP
#define SHARE_VM_UTILITIES_DEBUG_HPP
#include "utilities/globalDefinitions.hpp"
#include "prims/jvm.h"
#include "utilities/breakpoint.hpp"
#include "utilities/compilerWarnings.hpp"
#include "utilities/macros.hpp"
#include <stdarg.h>
// Simple class to format the ctor arguments into a fixed-sized buffer.
class FormatBufferBase {
protected:
char* _buf;
inline FormatBufferBase(char* buf) : _buf(buf) {}
public:
static const int BufferSize = 256;
operator const char *() const { return _buf; }
};
// Use resource area for buffer
class FormatBufferResource : public FormatBufferBase {
public:
FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
};
class FormatBufferDummy {};
// Use stack for buffer
template <size_t bufsz = FormatBufferBase::BufferSize>
class FormatBuffer : public FormatBufferBase {
public:
inline FormatBuffer(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
// since va_list is unspecified type (can be char*), we use FormatBufferDummy to disambiguate these constructors
inline FormatBuffer(FormatBufferDummy dummy, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
inline void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
inline void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
char* buffer() { return _buf; }
int size() { return bufsz; }
private:
FormatBuffer(const FormatBuffer &); // prevent copies
char _buffer[bufsz];
protected:
inline FormatBuffer();
};
template <size_t bufsz>
FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) : FormatBufferBase(_buffer) {
va_list argp;
va_start(argp, format);
jio_vsnprintf(_buf, bufsz, format, argp);
va_end(argp);
}
template <size_t bufsz>
FormatBuffer<bufsz>::FormatBuffer(FormatBufferDummy dummy, const char * format, va_list ap) : FormatBufferBase(_buffer) {
jio_vsnprintf(_buf, bufsz, format, ap);
}
template <size_t bufsz>
FormatBuffer<bufsz>::FormatBuffer() : FormatBufferBase(_buffer) {
_buf[0] = '\0';
}
template <size_t bufsz>
void FormatBuffer<bufsz>::print(const char * format, ...) {
va_list argp;
va_start(argp, format);
jio_vsnprintf(_buf, bufsz, format, argp);
va_end(argp);
}
template <size_t bufsz>
void FormatBuffer<bufsz>::printv(const char * format, va_list argp) {
jio_vsnprintf(_buf, bufsz, format, argp);
}
template <size_t bufsz>
void FormatBuffer<bufsz>::append(const char* format, ...) {
// Given that the constructor does a vsnprintf we can assume that
// _buf is already initialized.
size_t len = strlen(_buf);
char* buf_end = _buf + len;
va_list argp;
va_start(argp, format);
jio_vsnprintf(buf_end, bufsz - len, format, argp);
va_end(argp);
}
// Used to format messages.
typedef FormatBuffer<> err_msg;
#include <stddef.h>
// assertions
#ifndef ASSERT
@ -311,10 +225,7 @@ NOT_PRODUCT(void controlled_crash(int how);)
// for test purposes, which is not NULL and contains bits in every word
NOT_PRODUCT(void* get_segfault_address();)
class frame;
void pd_ps(frame f);
void pd_obfuscate_location(char *buf, size_t buflen);
class outputStream;
void print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size);
#endif // SHARE_VM_UTILITIES_DEBUG_HPP

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@
#if !defined(_WINDOWS) && !defined(__APPLE__)
#include "memory/allocation.inline.hpp"
#include "prims/jvm.h"
#include "runtime/os.hpp"
#include "utilities/elfStringTable.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,7 @@
#include "memory/allocation.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/thread.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/vmError.hpp"
// Events and EventMark provide interfaces to log events taking place in the vm.

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "prims/jvm.h"
#include "utilities/formatBuffer.hpp"
#include <stdarg.h>
FormatBufferResource::FormatBufferResource(const char * format, ...)
: FormatBufferBase((char*)resource_allocate_bytes(FormatBufferBase::BufferSize)) {
va_list argp;
va_start(argp, format);
jio_vsnprintf(_buf, FormatBufferBase::BufferSize, format, argp);
va_end(argp);
}

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_UTILITIES_FORMATBUFFER_HPP
#define SHARE_VM_UTILITIES_FORMATBUFFER_HPP
#include "utilities/globalDefinitions.hpp"
#include "prims/jvm.h"
#include <stdarg.h>
// Simple class to format the ctor arguments into a fixed-sized buffer.
class FormatBufferBase {
protected:
char* _buf;
inline FormatBufferBase(char* buf) : _buf(buf) {}
public:
static const int BufferSize = 256;
operator const char *() const { return _buf; }
};
// Use resource area for buffer
class FormatBufferResource : public FormatBufferBase {
public:
FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
};
class FormatBufferDummy {};
// Use stack for buffer
template <size_t bufsz = FormatBufferBase::BufferSize>
class FormatBuffer : public FormatBufferBase {
public:
inline FormatBuffer(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
// since va_list is unspecified type (can be char*), we use FormatBufferDummy to disambiguate these constructors
inline FormatBuffer(FormatBufferDummy dummy, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
inline void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
inline void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
char* buffer() { return _buf; }
int size() { return bufsz; }
private:
FormatBuffer(const FormatBuffer &); // prevent copies
char _buffer[bufsz];
protected:
inline FormatBuffer();
};
template <size_t bufsz>
FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) : FormatBufferBase(_buffer) {
va_list argp;
va_start(argp, format);
jio_vsnprintf(_buf, bufsz, format, argp);
va_end(argp);
}
template <size_t bufsz>
FormatBuffer<bufsz>::FormatBuffer(FormatBufferDummy dummy, const char * format, va_list ap) : FormatBufferBase(_buffer) {
jio_vsnprintf(_buf, bufsz, format, ap);
}
template <size_t bufsz>
FormatBuffer<bufsz>::FormatBuffer() : FormatBufferBase(_buffer) {
_buf[0] = '\0';
}
template <size_t bufsz>
void FormatBuffer<bufsz>::print(const char * format, ...) {
va_list argp;
va_start(argp, format);
jio_vsnprintf(_buf, bufsz, format, argp);
va_end(argp);
}
template <size_t bufsz>
void FormatBuffer<bufsz>::printv(const char * format, va_list argp) {
jio_vsnprintf(_buf, bufsz, format, argp);
}
template <size_t bufsz>
void FormatBuffer<bufsz>::append(const char* format, ...) {
// Given that the constructor does a vsnprintf we can assume that
// _buf is already initialized.
size_t len = strlen(_buf);
char* buf_end = _buf + len;
va_list argp;
va_start(argp, format);
jio_vsnprintf(buf_end, bufsz - len, format, argp);
va_end(argp);
}
// Used to format messages.
typedef FormatBuffer<> err_msg;
#endif // SHARE_VM_UTILITIES_FORMATBUFFER_HPP

View File

@ -25,55 +25,83 @@
#ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
#define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
#ifdef TARGET_COMPILER_gcc
# include "utilities/globalDefinitions_gcc.hpp"
#endif
#ifdef TARGET_COMPILER_visCPP
# include "utilities/globalDefinitions_visCPP.hpp"
#endif
#ifdef TARGET_COMPILER_sparcWorks
# include "utilities/globalDefinitions_sparcWorks.hpp"
#endif
#ifdef TARGET_COMPILER_xlc
# include "utilities/globalDefinitions_xlc.hpp"
#endif
#include "utilities/compilerWarnings.hpp"
#include "utilities/debug.hpp"
#include "utilities/macros.hpp"
#include COMPILER_HEADER(utilities/globalDefinitions)
// Defaults for macros that might be defined per compiler.
#ifndef NOINLINE
#define NOINLINE
#endif
#ifndef ALWAYSINLINE
#define ALWAYSINLINE inline
#endif
#ifndef PRAGMA_DIAG_PUSH
#define PRAGMA_DIAG_PUSH
#endif
#ifndef PRAGMA_DIAG_POP
#define PRAGMA_DIAG_POP
#endif
#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED
#define PRAGMA_FORMAT_NONLITERAL_IGNORED
#endif
#ifndef PRAGMA_FORMAT_IGNORED
#define PRAGMA_FORMAT_IGNORED
#endif
#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
#endif
#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
#endif
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(fmt, vargs)
#endif
#ifndef ATTRIBUTE_SCANF
#define ATTRIBUTE_SCANF(fmt, vargs)
#endif
#include "utilities/macros.hpp"
// This file holds all globally used constants & types, class (forward)
// declarations and a few frequently used utility functions.
//----------------------------------------------------------------------------------------------------
// Printf-style formatters for fixed- and variable-width types as pointers and
// integers. These are derived from the definitions in inttypes.h. If the platform
// doesn't provide appropriate definitions, they should be provided in
// the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp)
#define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false")
// Format 32-bit quantities.
#define INT32_FORMAT "%" PRId32
#define UINT32_FORMAT "%" PRIu32
#define INT32_FORMAT_W(width) "%" #width PRId32
#define UINT32_FORMAT_W(width) "%" #width PRIu32
#define PTR32_FORMAT "0x%08" PRIx32
#define PTR32_FORMAT_W(width) "0x%" #width PRIx32
// Format 64-bit quantities.
#define INT64_FORMAT "%" PRId64
#define UINT64_FORMAT "%" PRIu64
#define UINT64_FORMAT_X "%" PRIx64
#define INT64_FORMAT_W(width) "%" #width PRId64
#define UINT64_FORMAT_W(width) "%" #width PRIu64
#define PTR64_FORMAT "0x%016" PRIx64
// Format jlong, if necessary
#ifndef JLONG_FORMAT
#define JLONG_FORMAT INT64_FORMAT
#endif
#ifndef JULONG_FORMAT
#define JULONG_FORMAT UINT64_FORMAT
#endif
#ifndef JULONG_FORMAT_X
#define JULONG_FORMAT_X UINT64_FORMAT_X
#endif
// Format pointers which change size between 32- and 64-bit.
#ifdef _LP64
#define INTPTR_FORMAT "0x%016" PRIxPTR
#define PTR_FORMAT "0x%016" PRIxPTR
#else // !_LP64
#define INTPTR_FORMAT "0x%08" PRIxPTR
#define PTR_FORMAT "0x%08" PRIxPTR
#endif // _LP64
#define INTPTR_FORMAT_W(width) "%" #width PRIxPTR
#define SSIZE_FORMAT "%" PRIdPTR
#define SIZE_FORMAT "%" PRIuPTR
#define SIZE_FORMAT_HEX "0x%" PRIxPTR
#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
#define SIZE_FORMAT_W(width) "%" #width PRIuPTR
#define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR
#define INTX_FORMAT "%" PRIdPTR
#define UINTX_FORMAT "%" PRIuPTR
#define INTX_FORMAT_W(width) "%" #width PRIdPTR
#define UINTX_FORMAT_W(width) "%" #width PRIuPTR
//----------------------------------------------------------------------------------------------------
// Constants
@ -950,8 +978,6 @@ class RFrame;
class CompiledRFrame;
class InterpretedRFrame;
class frame;
class vframe;
class javaVFrame;
class interpretedVFrame;
@ -1012,11 +1038,9 @@ class JavaValue;
class methodHandle;
class JavaCallArguments;
// Basic support for errors (general debug facilities not defined at this point fo the include phase)
// Basic support for errors.
extern void basic_fatal(const char* msg);
//----------------------------------------------------------------------------------------------------
// Special constants for debugging
@ -1152,35 +1176,27 @@ inline int log2_long(jlong x) {
//* the argument must be exactly a power of 2
inline int exact_log2(intptr_t x) {
#ifdef ASSERT
if (!is_power_of_2(x)) basic_fatal("x must be a power of 2");
#endif
assert(is_power_of_2(x), "x must be a power of 2: " INTPTR_FORMAT, x);
return log2_intptr(x);
}
//* the argument must be exactly a power of 2
inline int exact_log2_long(jlong x) {
#ifdef ASSERT
if (!is_power_of_2_long(x)) basic_fatal("x must be a power of 2");
#endif
assert(is_power_of_2_long(x), "x must be a power of 2: " JLONG_FORMAT, x);
return log2_long(x);
}
// returns integer round-up to the nearest multiple of s (s must be a power of two)
inline intptr_t round_to(intptr_t x, uintx s) {
#ifdef ASSERT
if (!is_power_of_2(s)) basic_fatal("s must be a power of 2");
#endif
assert(is_power_of_2(s), "s must be a power of 2: " UINTX_FORMAT, s);
const uintx m = s - 1;
return mask_bits(x + m, ~m);
}
// returns integer round-down to the nearest multiple of s (s must be a power of two)
inline intptr_t round_down(intptr_t x, uintx s) {
#ifdef ASSERT
if (!is_power_of_2(s)) basic_fatal("s must be a power of 2");
#endif
assert(is_power_of_2(s), "s must be a power of 2: " UINTX_FORMAT, s);
const uintx m = s - 1;
return mask_bits(x, ~m);
}
@ -1332,66 +1348,6 @@ template<class T> static void swap(T& a, T& b) {
b = tmp;
}
// Printf-style formatters for fixed- and variable-width types as pointers and
// integers. These are derived from the definitions in inttypes.h. If the platform
// doesn't provide appropriate definitions, they should be provided in
// the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp)
#define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false")
// Format 32-bit quantities.
#define INT32_FORMAT "%" PRId32
#define UINT32_FORMAT "%" PRIu32
#define INT32_FORMAT_W(width) "%" #width PRId32
#define UINT32_FORMAT_W(width) "%" #width PRIu32
#define PTR32_FORMAT "0x%08" PRIx32
#define PTR32_FORMAT_W(width) "0x%" #width PRIx32
// Format 64-bit quantities.
#define INT64_FORMAT "%" PRId64
#define UINT64_FORMAT "%" PRIu64
#define UINT64_FORMAT_X "%" PRIx64
#define INT64_FORMAT_W(width) "%" #width PRId64
#define UINT64_FORMAT_W(width) "%" #width PRIu64
#define PTR64_FORMAT "0x%016" PRIx64
// Format jlong, if necessary
#ifndef JLONG_FORMAT
#define JLONG_FORMAT INT64_FORMAT
#endif
#ifndef JULONG_FORMAT
#define JULONG_FORMAT UINT64_FORMAT
#endif
#ifndef JULONG_FORMAT_X
#define JULONG_FORMAT_X UINT64_FORMAT_X
#endif
// Format pointers which change size between 32- and 64-bit.
#ifdef _LP64
#define INTPTR_FORMAT "0x%016" PRIxPTR
#define PTR_FORMAT "0x%016" PRIxPTR
#else // !_LP64
#define INTPTR_FORMAT "0x%08" PRIxPTR
#define PTR_FORMAT "0x%08" PRIxPTR
#endif // _LP64
#define INTPTR_FORMAT_W(width) "%" #width PRIxPTR
#define SSIZE_FORMAT "%" PRIdPTR
#define SIZE_FORMAT "%" PRIuPTR
#define SIZE_FORMAT_HEX "0x%" PRIxPTR
#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
#define SIZE_FORMAT_W(width) "%" #width PRIuPTR
#define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR
#define INTX_FORMAT "%" PRIdPTR
#define UINTX_FORMAT "%" PRIuPTR
#define INTX_FORMAT_W(width) "%" #width PRIdPTR
#define UINTX_FORMAT_W(width) "%" #width PRIuPTR
#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
//----------------------------------------------------------------------------------------------------

View File

@ -158,7 +158,6 @@ typedef uint64_t julong;
#ifdef SOLARIS
//----------------------------------------------------------------------------------------------------
// ANSI C++ fixes
// NOTE:In the ANSI committee's continuing attempt to make each version
// of C++ incompatible with the previous version, you can no longer cast
@ -193,14 +192,6 @@ extern "C" {
};
#endif // SOLARIS
//----------------------------------------------------------------------------------------------------
// Debugging
#define DEBUG_EXCEPTION ::abort();
extern "C" void breakpoint();
#define BREAKPOINT ::breakpoint()
// checking for nanness
#ifdef SOLARIS
#ifdef SPARC
@ -241,40 +232,6 @@ inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
#define PRAGMA_IMPLEMENTATION #pragma implementation
#define VALUE_OBJ_CLASS_SPEC
// Diagnostic pragmas like the ones defined below in PRAGMA_FORMAT_NONLITERAL_IGNORED
// were only introduced in GCC 4.2. Because we have no other possibility to ignore
// these warnings for older versions of GCC, we simply don't decorate our printf-style
// functions with __attribute__(format) in that case.
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || (__GNUC__ > 4)
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(fmt,vargs) __attribute__((format(printf, fmt, vargs)))
#endif
#ifndef ATTRIBUTE_SCANF
#define ATTRIBUTE_SCANF(fmt,vargs) __attribute__((format(scanf, fmt, vargs)))
#endif
#endif
#define PRAGMA_FORMAT_NONLITERAL_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \
_Pragma("GCC diagnostic ignored \"-Wformat-security\"")
#define PRAGMA_FORMAT_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat\"")
#if defined(__clang_major__) && \
(__clang_major__ >= 4 || \
(__clang_major__ >= 3 && __clang_minor__ >= 1)) || \
((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
// Tested to work with clang version 3.1 and better.
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
// Hack to deal with gcc yammering about non-security format stuff
#else
// Old versions of gcc don't do push/pop, also do not cope with this pragma within a function
// One method does so much varied printing that it is decorated with both internal and external
// versions of the macro-pragma to obtain better checking with newer compilers.
#define PRAGMA_DIAG_PUSH
#define PRAGMA_DIAG_POP
#endif
#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
#define TEMPLATE_TABLE_BUG
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -175,7 +175,6 @@ typedef unsigned long long julong;
#ifdef SOLARIS
//----------------------------------------------------------------------------------------------------
// ANSI C++ fixes
// NOTE:In the ANSI committee's continuing attempt to make each version
// of C++ incompatible with the previous version, you can no longer cast
@ -210,14 +209,6 @@ extern "C" {
};
#endif
//----------------------------------------------------------------------------------------------------
// Debugging
#define DEBUG_EXCEPTION ::abort();
extern "C" void breakpoint();
#define BREAKPOINT ::breakpoint()
// checking for nanness
#ifdef SOLARIS
#ifdef SPARC

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -108,7 +108,6 @@ typedef signed int ssize_t;
#endif
#endif
//----------------------------------------------------------------------------------------------------
// Additional Java basic types
typedef unsigned char jubyte;
@ -116,38 +115,22 @@ typedef unsigned short jushort;
typedef unsigned int juint;
typedef unsigned __int64 julong;
//----------------------------------------------------------------------------------------------------
// Non-standard stdlib-like stuff:
inline int strcasecmp(const char *s1, const char *s2) { return _stricmp(s1,s2); }
inline int strncasecmp(const char *s1, const char *s2, size_t n) {
return _strnicmp(s1,s2,n);
}
//----------------------------------------------------------------------------------------------------
// Debugging
#if _WIN64
extern "C" void breakpoint();
#define BREAKPOINT ::breakpoint()
#else
#define BREAKPOINT __asm { int 3 }
#endif
//----------------------------------------------------------------------------------------------------
// Checking for nanness
inline int g_isnan(jfloat f) { return _isnan(f); }
inline int g_isnan(jdouble f) { return _isnan(f); }
//----------------------------------------------------------------------------------------------------
// Checking for finiteness
inline int g_isfinite(jfloat f) { return _finite(f); }
inline int g_isfinite(jdouble f) { return _finite(f); }
//----------------------------------------------------------------------------------------------------
// Miscellaneous
// Visual Studio 2005 deprecates POSIX names - use ISO C++ names instead

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -106,15 +106,6 @@ typedef uint16_t jushort;
typedef uint32_t juint;
typedef uint64_t julong;
//----------------------------------------------------------------------------------------------------
// Debugging
#define DEBUG_EXCEPTION ::abort();
extern "C" void breakpoint();
#define BREAKPOINT ::breakpoint()
// checking for nanness
#ifdef AIX
inline int g_isnan(float f) { return isnan(f); }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -490,12 +490,13 @@
#define CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_CPU)
#define OS_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_OS)
#define OS_CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, PASTE_TOKENS(INCLUDE_SUFFIX_OS, INCLUDE_SUFFIX_CPU))
#define COMPILER_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_COMPILER)
// Include platform dependent files.
//
// This macro constructs from basename and INCLUDE_SUFFIX_OS /
// INCLUDE_SUFFIX_CPU, which are set on the command line, the name of
// platform dependent files to be included.
// INCLUDE_SUFFIX_CPU / INCLUDE_SUFFIX_COMPILER, which are set on
// the command line, the name of platform dependent files to be included.
// Example: INCLUDE_SUFFIX_OS=_linux / INCLUDE_SUFFIX_CPU=_sparc
// CPU_HEADER_INLINE(macroAssembler) --> macroAssembler_sparc.inline.hpp
// OS_CPU_HEADER(vmStructs) --> vmStructs_linux_sparc.hpp
@ -511,6 +512,9 @@
// basename<os><cpu>.hpp / basename<os><cpu>.inline.hpp
#define OS_CPU_HEADER(basename) XSTR(OS_CPU_HEADER_STEM(basename).hpp)
#define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp)
// basename<compiler>.hpp / basename<compiler>.inline.hpp
#define COMPILER_HEADER(basename) XSTR(COMPILER_HEADER_STEM(basename).hpp)
#define COMPILER_HEADER_INLINE(basename) XSTR(COMPILER_HEADER_STEM(basename).inline.hpp)
// To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially
// aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "compiler/compileLog.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvm.h"
#include "runtime/arguments.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"

View File

@ -29,6 +29,7 @@
#include "compiler/disassembler.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "logging/logConfiguration.hpp"
#include "prims/jvm.h"
#include "prims/whitebox.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.hpp"
@ -203,6 +204,46 @@ void VMError::print_stack_trace(outputStream* st, JavaThread* jt,
#endif // ZERO
}
void VMError::print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size) {
// see if it's a valid frame
if (fr.pc()) {
st->print_cr("Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)");
int count = 0;
while (count++ < StackPrintLimit) {
fr.print_on_error(st, buf, buf_size);
st->cr();
// Compiled code may use EBP register on x86 so it looks like
// non-walkable C frame. Use frame.sender() for java frames.
if (t && t->is_Java_thread()) {
// Catch very first native frame by using stack address.
// For JavaThread stack_base and stack_size should be set.
if (!t->on_local_stack((address)(fr.real_fp() + 1))) {
break;
}
if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) {
RegisterMap map((JavaThread*)t, false); // No update
fr = fr.sender(&map);
} else {
fr = os::get_sender_for_C_frame(&fr);
}
} else {
// is_first_C_frame() does only simple checks for frame pointer,
// it will pass if java compiled code has a pointer in EBP.
if (os::is_first_C_frame(&fr)) break;
fr = os::get_sender_for_C_frame(&fr);
}
}
if (count > StackPrintLimit) {
st->print_cr("...<more frames>...");
}
st->cr();
}
}
static void print_oom_reasons(outputStream* st) {
st->print_cr("# Possible reasons:");
st->print_cr("# The system is out of physical RAM or swap space");

View File

@ -28,6 +28,7 @@
#include "utilities/globalDefinitions.hpp"
class Decoder;
class frame;
class VM_ReportJavaOutOfMemory;
class VMError : public AllStatic {
@ -99,6 +100,12 @@ class VMError : public AllStatic {
static void print_stack_trace(outputStream* st, JavaThread* jt,
char* buf, int buflen, bool verbose = false);
// public for use by the internal non-product debugger.
NOT_PRODUCT(public:)
static void print_native_stack(outputStream* st, frame fr, Thread* t,
char* buf, int buf_size);
NOT_PRODUCT(private:)
static bool should_report_bug(unsigned int id) {
return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
#include "logTestUtils.inline.hpp"
#include "logging/logConfiguration.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "unittest.hpp"
#include "utilities/ostream.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
#include "logTestFixture.hpp"
#include "logTestUtils.inline.hpp"
#include "logging/log.hpp"
#include "prims/jvm.h"
#include "unittest.hpp"
class LogTest : public LogTestFixture {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,7 @@
#include "logging/logTag.hpp"
#include "logging/logTagSet.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "unittest.hpp"
#include "utilities/ostream.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,7 @@
#include "precompiled.hpp"
#include "logging/logDecorators.hpp"
#include "prims/jvm.h"
#include "unittest.hpp"
static LogDecorators::Decorator decorator_array[] = {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#include "logTestUtils.inline.hpp"
#include "logging/logFileOutput.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvm.h"
#include "runtime/os.hpp"
#include "unittest.hpp"
#include "utilities/globalDefinitions.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
#include "logTestUtils.inline.hpp"
#include "logging/log.hpp"
#include "logging/logMessage.hpp"
#include "prims/jvm.h"
#include "unittest.hpp"
#include "utilities/globalDefinitions.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#include "logging/logLevel.hpp"
#include "logging/logTagLevelExpression.hpp"
#include "logging/logTagSet.hpp"
#include "prims/jvm.h"
#include "unittest.hpp"
#include "utilities/globalDefinitions.hpp"

Some files were not shown because too many files have changed in this diff Show More