changeset 10588:b0b368d38b40

CR-1032 - change ExternalCompilationResult kernel -> entryPoint
author Morris Meyer <morris.meyer@oracle.com>
date Mon, 01 Jul 2013 15:46:27 -0400
parents e43bb3295475
children 17c5cc84560b
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ExternalCompilationResult.java graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXTargetMethodAssembler.java src/gpu/ptx/gpu_ptx.cpp src/share/vm/graal/graalCompilerToVM.cpp src/share/vm/graal/graalJavaAccess.hpp
diffstat 5 files changed, 34 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ExternalCompilationResult.java	Mon Jul 01 11:47:01 2013 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ExternalCompilationResult.java	Mon Jul 01 15:46:27 2013 -0400
@@ -22,21 +22,40 @@
  */
 package com.oracle.graal.api.code;
 
+/**
+ * Represents the output from compiling a method generated by graal, but executing 
+ * in a memory and computational subsystem outside the graal host system.
+ * 
+ * Output may include the compiled machine code, associated
+ * data and references, relocation information, deoptimization information,
+ * as this result is generated from a structure graph on the graal host system.
+ */
 public class ExternalCompilationResult extends CompilationResult {
 
-  private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-    private long kernel;
+    /**
+     * Address of the point of entry to the external compilation result.
+     */
+    private long entryPoint;
 
     public ExternalCompilationResult() {
         super();
     }
 
-    public void setKernel(long k) {
-        kernel = k;
+    /**
+     * Set the address for the point of entry to the external compilation result.
+     * @param addr    The address of the entry point.
+     */
+    public void setEntryPoint(long addr) {
+        entryPoint = addr;
     }
 
-    public long getKernel() {
-      return kernel;
+    /**
+     * Return the address for the point of entry to the external compilation result.
+     * @return address value
+     */
+    public long getEntryPoint() {
+      return entryPoint;
     }
 }
--- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXTargetMethodAssembler.java	Mon Jul 01 11:47:01 2013 +0200
+++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXTargetMethodAssembler.java	Mon Jul 01 15:46:27 2013 -0400
@@ -52,7 +52,7 @@
         try {
             if (validDevice) {
                 long kernel = toGPU.generateKernel(graalCompile.getTargetCode(), method.getName());
-                graalCompile.setKernel(kernel);
+                graalCompile.setEntryPoint(kernel);
             }
         } catch (Throwable th) {
             th.printStackTrace();
--- a/src/gpu/ptx/gpu_ptx.cpp	Mon Jul 01 11:47:01 2013 +0200
+++ b/src/gpu/ptx/gpu_ptx.cpp	Mon Jul 01 15:46:27 2013 -0400
@@ -164,7 +164,9 @@
                                       gridX, gridY, gridZ,
                                       blockX, blockY, blockZ,
                                       0, NULL, NULL, NULL);
-  tty->print_cr("gpu_ptx::_cuda_cu_launch_kernel(%x): %d", kernel, status);
+  if (TraceWarpLoading) {
+    tty->print_cr("gpu_ptx::_cuda_cu_launch_kernel(%x): %d", kernel, status);
+  }
   return status == 0;  // CUDA_SUCCESS
 }
 
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Mon Jul 01 11:47:01 2013 +0200
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Mon Jul 01 15:46:27 2013 -0400
@@ -971,8 +971,10 @@
       HotSpotInstalledCode::set_codeBlob(installed_code_handle, (jlong) cb);
       oop comp_result = HotSpotCompiledCode::comp(compiled_code_handle);
       if (comp_result->is_a(ExternalCompilationResult::klass())) {
-        tty->print_cr("installCode0: ExternalCompilationResult");
-        HotSpotInstalledCode::set_start(installed_code_handle, ExternalCompilationResult::kernel(comp_result));
+        if (TraceWarpLoading) {
+          tty->print_cr("installCode0: ExternalCompilationResult");
+        }
+        HotSpotInstalledCode::set_start(installed_code_handle, ExternalCompilationResult::entryPoint(comp_result));
       } else {
         HotSpotInstalledCode::set_start(installed_code_handle, (jlong) cb->code_begin());
       }
--- a/src/share/vm/graal/graalJavaAccess.hpp	Mon Jul 01 11:47:01 2013 +0200
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Mon Jul 01 15:46:27 2013 -0400
@@ -112,7 +112,7 @@
     oop_field(ExceptionHandler, catchType, "Lcom/oracle/graal/api/meta/JavaType;")                                                                             \
   end_class                                                                                                                                                    \
   start_class(ExternalCompilationResult)                                                                                                                       \
-    long_field(ExternalCompilationResult, kernel)                                                                                                              \
+    long_field(ExternalCompilationResult, entryPoint)                                                                                                              \
   end_class                                                                                                                                                    \
   start_class(CompilationResult)                                                                                                                               \
     int_field(CompilationResult, frameSize)                                                                                                                    \