Commit 2f59e0c0 authored by Lubomir Bulej's avatar Lubomir Bulej
Browse files

Keep bytecode.c up-to-date in both agents

This is now also reflected in the main build file.
parent cc1d0b53
......@@ -510,11 +510,11 @@
generation options. This target triggers generation of the header file
using the "generate-codeflags" target in the DiSL subproject.
-->
<target name="-check-codeflags">
<target name="-check-agent-codeflags">
<property name="build.disl.agent.codeflags.path" value="${src.disl.agent}/codeflags.h"/>
<property name="build.shvm.agent.codeflags.path" value="${src.shvm.agent}/disl/codeflags.h"/>
<condition property="build.disl.codeflags.uptodate">
<condition property="build.agent.codeflags.uptodate">
<and>
<uptodate targetfile="${build.disl.agent.codeflags.path}" >
<srcfiles dir="${src.disl.prefix}/src" includes="**/CodeOption.java"/>
......@@ -527,8 +527,7 @@
</condition>
</target>
<target name="-generate-codeflags-if-needed" unless="build.disl.codeflags.uptodate" depends="-check-codeflags">
<target name="-generate-agent-codeflags-if-needed" unless="build.agent.codeflags.uptodate" depends="-check-agent-codeflags">
<ant dir="${src.disl.prefix}" target="generate-codeflags"/>
<copy file="${src.disl.prefix}/${build.disl.codeflags.path}" tofile="${build.disl.agent.codeflags.path}"/>
......@@ -536,25 +535,36 @@
</target>
<!-- DiSL agent -->
<!-- Bypass Bytecode -->
<!--
The DiSL agent requires the bytecode of several bypass
classes. This target generates the "bytecode.c" containing
the necessary bytecode.
Both agents require the bytecode of several bypass
classes. This target triggers generation of the source file
using the "generate-bytecode" target in the DiSL subproject.
-->
<target name="-check-disl-agent-bytecode">
<property name="build.disl.agent.bytecode.path" value="${src.shvm.agent}/disl/bytecode.c"/>
<uptodate property="build.disl.agent.bytecode.uptodate" targetfile="${build.disl.agent.bytecode.path}">
<srcfiles dir="${src.disl.bypass}"/>
</uptodate>
<target name="-check-agent-bytecode">
<property name="build.disl.agent.bytecode.path" value="${src.disl.agent}/bytecode.c"/>
<property name="build.shvm.agent.bytecode.path" value="${src.shvm.agent}/disl/bytecode.c"/>
<condition property="build.agent.bytecode.uptodate">
<and>
<uptodate targetfile="${build.disl.agent.bytecode.path}" >
<srcfiles dir="${src.disl.bypass}"/>
</uptodate>
<uptodate targetfile="${build.shvm.agent.bytecode.path}" >
<srcfiles dir="${src.disl.bypass}"/>
</uptodate>
</and>
</condition>
</target>
<target name="-generate-disl-agent-bytecode-if-needed" unless="build.disl.agent.bytecode.uptodate" depends="-check-disl-agent-bytecode">
<antcall target="-generate-disl-agent-bytecode"/>
<target name="-generate-agent-bytecode-if-needed" unless="build.agent.bytecode.uptodate" depends="-check-agent-bytecode">
<antcall target="-generate-agent-bytecode"/>
<copy file="${build.disl.agent.bytecode.path}" tofile="${build.shvm.agent.bytecode.path}"/>
</target>
<target name="-generate-disl-agent-bytecode" depends="compile-disl,compile-tools">
<target name="-generate-agent-bytecode" depends="compile-disl,compile-tools">
<taskdef name="bytedump" classname="ch.usi.dag.disl.tools.ByteDumpTask">
<classpath>
<pathelement location="${build.tools}"/>
......@@ -567,7 +577,7 @@
<echo file="${output.file}">/**${line.separator}</echo>
<echo file="${output.file}" append="true"> * DO NOT EDIT!${line.separator}</echo>
<echo file="${output.file}" append="true"> *${line.separator}</echo>
<echo file="${output.file}" append="true"> * This file was generated using the '-generate-disl-agent-bytecode' target.${line.separator}</echo>
<echo file="${output.file}" append="true"> * This file was generated using the '-generate-agent-bytecode' target.${line.separator}</echo>
<echo file="${output.file}" append="true"> */${line.separator}</echo>
<echo file="${output.file}" append="true">#include &lt;jvmti.h&gt;${line.separator}</echo>
......@@ -609,8 +619,9 @@
</target>
<target name="prepare-disl-agent" depends="-generate-codeflags-if-needed,-generate-disl-agent-bytecode-if-needed"/>
<!-- DiSL agent -->
<target name="prepare-disl-agent" depends="-generate-agent-codeflags-if-needed,-generate-agent-bytecode-if-needed"/>
<target name="compile-disl-agent" depends="prepare-disl-agent">
<exec executable="make" dir="${src.disl.agent}"/>
......@@ -655,7 +666,7 @@
<!-- Shadow VM agent -->
<target name="compile-shvm-agent" depends="-generate-codeflags-if-needed">
<target name="compile-shvm-agent" depends="-generate-agent-codeflags-if-needed,-generate-agent-bytecode-if-needed">
<exec executable="make" dir="${src.shvm.agent}">
<arg value="WHOLE=1"/>
</exec>
......@@ -663,7 +674,7 @@
<target name="build-shvm-agent" depends="compile-shvm-agent,-determine-lib-names">
<copy file="${src.shvm.agent}/${shvm.agent.lib}" todir="${out.lib}"/>
<copy file="${src.shvm.agent}/${disl.agent.os}-${disl.agent.arch}/${shvm.agent.lib}" todir="${out.lib}"/>
</target>
......
/**
* DO NOT EDIT!
*
* This file was generated using the 'generate-disl-agent-bytecode' target.
* This file was generated using the '-generate-agent-bytecode' target.
*/
#include <jvmti.h>
jvmtiClassDefinition always_BypassCheck_classdef = {
.class_byte_count = 388,
.class_bytes = (unsigned char *)
"\xca\xfe\xba\xbe\x00\x00\x00\x30\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\xca\xfe\xba\xbe\x00\x00\x00\x34\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\x00\x10\x07\x00\x11\x01\x00\x06\x3c\x69\x6e\x69\x74\x3e\x01\x00"
"\x03\x28\x29\x56\x01\x00\x04\x43\x6f\x64\x65\x01\x00\x0f\x4c\x69"
"\x6e\x65\x4e\x75\x6d\x62\x65\x72\x54\x61\x62\x6c\x65\x01\x00\x12"
......@@ -38,7 +38,7 @@ jvmtiClassDefinition always_BypassCheck_classdef = {
jvmtiClassDefinition dynamic_BypassCheck_classdef = {
.class_byte_count = 460,
.class_bytes = (unsigned char *)
"\xca\xfe\xba\xbe\x00\x00\x00\x30\x00\x17\x0a\x00\x04\x00\x10\x0a"
"\xca\xfe\xba\xbe\x00\x00\x00\x34\x00\x17\x0a\x00\x04\x00\x10\x0a"
"\x00\x11\x00\x12\x07\x00\x13\x07\x00\x14\x01\x00\x06\x3c\x69\x6e"
"\x69\x74\x3e\x01\x00\x03\x28\x29\x56\x01\x00\x04\x43\x6f\x64\x65"
"\x01\x00\x0f\x4c\x69\x6e\x65\x4e\x75\x6d\x62\x65\x72\x54\x61\x62"
......@@ -72,7 +72,7 @@ jvmtiClassDefinition dynamic_BypassCheck_classdef = {
jvmtiClassDefinition never_BypassCheck_classdef = {
.class_byte_count = 388,
.class_bytes = (unsigned char *)
"\xca\xfe\xba\xbe\x00\x00\x00\x30\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\xca\xfe\xba\xbe\x00\x00\x00\x34\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\x00\x10\x07\x00\x11\x01\x00\x06\x3c\x69\x6e\x69\x74\x3e\x01\x00"
"\x03\x28\x29\x56\x01\x00\x04\x43\x6f\x64\x65\x01\x00\x0f\x4c\x69"
"\x6e\x65\x4e\x75\x6d\x62\x65\x72\x54\x61\x62\x6c\x65\x01\x00\x12"
......
/**
* DO NOT EDIT!
*
* This file was generated using the '-generate-disl-agent-bytecode' target.
* This file was generated using the '-generate-agent-bytecode' target.
*/
#include <jvmti.h>
jvmtiClassDefinition always_BypassCheck_classdef = {
.class_byte_count = 388,
.class_bytes = (unsigned char *)
"\xca\xfe\xba\xbe\x00\x00\x00\x32\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\xca\xfe\xba\xbe\x00\x00\x00\x34\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\x00\x10\x07\x00\x11\x01\x00\x06\x3c\x69\x6e\x69\x74\x3e\x01\x00"
"\x03\x28\x29\x56\x01\x00\x04\x43\x6f\x64\x65\x01\x00\x0f\x4c\x69"
"\x6e\x65\x4e\x75\x6d\x62\x65\x72\x54\x61\x62\x6c\x65\x01\x00\x12"
......@@ -38,7 +38,7 @@ jvmtiClassDefinition always_BypassCheck_classdef = {
jvmtiClassDefinition dynamic_BypassCheck_classdef = {
.class_byte_count = 460,
.class_bytes = (unsigned char *)
"\xca\xfe\xba\xbe\x00\x00\x00\x32\x00\x17\x0a\x00\x04\x00\x10\x0a"
"\xca\xfe\xba\xbe\x00\x00\x00\x34\x00\x17\x0a\x00\x04\x00\x10\x0a"
"\x00\x11\x00\x12\x07\x00\x13\x07\x00\x14\x01\x00\x06\x3c\x69\x6e"
"\x69\x74\x3e\x01\x00\x03\x28\x29\x56\x01\x00\x04\x43\x6f\x64\x65"
"\x01\x00\x0f\x4c\x69\x6e\x65\x4e\x75\x6d\x62\x65\x72\x54\x61\x62"
......@@ -72,7 +72,7 @@ jvmtiClassDefinition dynamic_BypassCheck_classdef = {
jvmtiClassDefinition never_BypassCheck_classdef = {
.class_byte_count = 388,
.class_bytes = (unsigned char *)
"\xca\xfe\xba\xbe\x00\x00\x00\x32\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\xca\xfe\xba\xbe\x00\x00\x00\x34\x00\x12\x0a\x00\x03\x00\x0f\x07"
"\x00\x10\x07\x00\x11\x01\x00\x06\x3c\x69\x6e\x69\x74\x3e\x01\x00"
"\x03\x28\x29\x56\x01\x00\x04\x43\x6f\x64\x65\x01\x00\x0f\x4c\x69"
"\x6e\x65\x4e\x75\x6d\x62\x65\x72\x54\x61\x62\x6c\x65\x01\x00\x12"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment