src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompilationTask.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompilationTask.java
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompilationTask.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2016, 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.
--- 1,7 ----
/*
! * 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 24,41 ****
package jdk.tools.jaotc;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.graalvm.compiler.code.CompilationResult;
import org.graalvm.compiler.core.GraalCompilerOptions;
! import org.graalvm.compiler.debug.Debug;
! import org.graalvm.compiler.debug.DebugEnvironment;
import org.graalvm.compiler.debug.Management;
import org.graalvm.compiler.debug.TTY;
! import org.graalvm.compiler.debug.internal.DebugScope;
import org.graalvm.compiler.options.OptionValues;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.runtime.JVMCICompiler;
--- 24,42 ----
package jdk.tools.jaotc;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+ import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
import org.graalvm.compiler.code.CompilationResult;
import org.graalvm.compiler.core.GraalCompilerOptions;
! import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.debug.Management;
import org.graalvm.compiler.debug.TTY;
! import org.graalvm.compiler.debug.DebugContext.Activation;
import org.graalvm.compiler.options.OptionValues;
+ import org.graalvm.compiler.printer.GraalDebugHandlersFactory;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.runtime.JVMCICompiler;
*** 86,104 ****
}
/**
* Compile a method or a constructor.
*/
public void run() {
// Ensure a JVMCI runtime is initialized prior to Debug being initialized as the former
// may include processing command line options used by the latter.
HotSpotJVMCIRuntime.runtime();
- // Ensure a debug configuration for this thread is initialized
- if (Debug.isEnabled() && DebugScope.getConfig() == null) {
- DebugEnvironment.ensureInitialized(graalOptions);
- }
AOTCompiler.logCompilation(MiscUtils.uniqueMethodName(method), "Compiling");
final long threadId = Thread.currentThread().getId();
final boolean printCompilation = GraalCompilerOptions.PrintCompilation.getValue(graalOptions) && !TTY.isSuppressed();
--- 87,102 ----
}
/**
* Compile a method or a constructor.
*/
+ @SuppressWarnings("try")
public void run() {
// Ensure a JVMCI runtime is initialized prior to Debug being initialized as the former
// may include processing command line options used by the latter.
HotSpotJVMCIRuntime.runtime();
AOTCompiler.logCompilation(MiscUtils.uniqueMethodName(method), "Compiling");
final long threadId = Thread.currentThread().getId();
final boolean printCompilation = GraalCompilerOptions.PrintCompilation.getValue(graalOptions) && !TTY.isSuppressed();
*** 115,126 ****
} else {
start = 0L;
allocatedBytesBefore = 0L;
}
final long startTime = System.currentTimeMillis();
! CompilationResult compResult = aotBackend.compileMethod(method);
final long endTime = System.currentTimeMillis();
if (printAfterCompilation || printCompilation) {
final long stop = System.currentTimeMillis();
final int targetCodeSize = compResult != null ? compResult.getTargetCodeSize() : -1;
--- 113,128 ----
} else {
start = 0L;
allocatedBytesBefore = 0L;
}
+ CompilationResult compResult = null;
final long startTime = System.currentTimeMillis();
! SnippetReflectionProvider snippetReflection = aotBackend.getProviders().getSnippetReflection();
! try (DebugContext debug = DebugContext.create(graalOptions, new GraalDebugHandlersFactory(snippetReflection)); Activation a = debug.activate()) {
! compResult = aotBackend.compileMethod(method, debug);
! }
final long endTime = System.currentTimeMillis();
if (printAfterCompilation || printCompilation) {
final long stop = System.currentTimeMillis();
final int targetCodeSize = compResult != null ? compResult.getTargetCodeSize() : -1;
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTCompilationTask.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File