Skip to content

Commit

Permalink
Release 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aoli-al committed Aug 11, 2024
1 parent fa98c38 commit 997b6fb
Show file tree
Hide file tree
Showing 57 changed files with 130 additions and 107 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {

allprojects {
group = "org.pastalab.fray"
version = "0.1"
version = "0.1.1"
}

repositories {
Expand Down Expand Up @@ -43,7 +43,7 @@ configure(allprojects - project(":jvmti")) {
}
}

configure(allprojects - rootProject) {
configure(allprojects - rootProject - project(":instrumentation")) {
plugins.apply("maven-publish")
plugins.apply("org.jetbrains.dokka")

Expand Down
10 changes: 5 additions & 5 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {

dependencies {
compileOnly(project(":runtime"))
compileOnly(project(":instrumentation"))
compileOnly(project(":instrumentation:base"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
implementation("com.github.ajalt.clikt:clikt:4.2.2")
testImplementation("org.jetbrains.kotlin:kotlin-test")
Expand All @@ -28,10 +28,10 @@ tasks.named("build") {
}

tasks.withType<JavaExec> {
dependsOn(":jdk:build")
val instrumentationTask = evaluationDependsOn(":instrumentation-agent")
dependsOn(":instrumentation:jdk:build")
val instrumentationTask = evaluationDependsOn(":instrumentation:agent")
.tasks.named("shadowJar").get()
val jdk = project(":jdk")
val jdk = project(":instrumentation:jdk")
val jvmti = project(":jvmti")
val instrumentation = instrumentationTask.outputs.files.first().absolutePath
classpath += tasks.named("jar").get().outputs.files + files(configurations.runtimeClasspath)
Expand Down Expand Up @@ -74,7 +74,7 @@ tasks.register<JavaExec>("runFray") {

tasks.create("genRunner") {
doLast {
val instrumentationTask = evaluationDependsOn(":instrumentation-agent")
val instrumentationTask = evaluationDependsOn(":instrumentation:agent")
.tasks.named("shadowJar").get()
val instrumentation = instrumentationTask.outputs.files.first().absolutePath
val core = tasks.named("jar").get().outputs.files.first().absolutePath
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/org/pastalab/fray/core/RunContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.pastalab.fray.core.concurrency.locks.CountDownLatchManager
import org.pastalab.fray.core.concurrency.locks.LockManager
import org.pastalab.fray.core.concurrency.locks.SemaphoreManager
import org.pastalab.fray.core.concurrency.operations.*
import org.pastalab.fray.instrumentation.memory.VolatileManager
import org.pastalab.fray.instrumentation.base.memory.VolatileManager

@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
class RunContext(val config: Configuration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
add("shadow", gradleApi())
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
implementation(project(":instrumentation"))
implementation(project(":instrumentation:base"))
}

tasks.named<ShadowJar>("shadowJar") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.ClassWriter
import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.ClassNode
import org.pastalab.fray.instrumentation.visitors.*
import org.pastalab.fray.instrumentation.base.visitors.*

class ApplicationCodeTransformer : ClassFileTransformer {
override fun transform(
Expand Down
36 changes: 36 additions & 0 deletions instrumentation/base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
java
kotlin("jvm")
}

repositories {
mavenCentral()
}

dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
implementation("org.jetbrains.kotlin:kotlin-reflect")
api("org.ow2.asm:asm:9.7")
api("org.ow2.asm:asm-tree:9.7")
api("org.ow2.asm:asm-commons:9.7")
api("org.ow2.asm:asm-util:9.7")
implementation(project(":runtime"))
}

tasks.withType<JavaExec> {
jvmArgs("--patch-module", "org.pastalab.fray.instrumentation.base=${sourceSets["main"].output
.asPath}")
}

tasks.compileJava {
options.compilerArgumentProviders.add(CommandLineArgumentProvider {
// Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work
listOf("--patch-module", "org.pastalab.fray.instrumentation.base=${sourceSets["main"].output
.asPath}")
})
}


tasks.test {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module org.pastalab.fray.instrumentation {
exports org.pastalab.fray.instrumentation;
opens org.pastalab.fray.instrumentation;
module org.pastalab.fray.instrumentation.base {
exports org.pastalab.fray.instrumentation.base;
exports org.pastalab.fray.instrumentation.base.visitors;
opens org.pastalab.fray.instrumentation.base;
requires org.pastalab.fray.runtime;
requires kotlin.reflect;
requires org.objectweb.asm;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation;
package org.pastalab.fray.instrumentation.base;

// We need this dummy class to make sure
// the corresponding folders is also created in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation
package org.pastalab.fray.instrumentation.base

import java.io.File

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation
package org.pastalab.fray.instrumentation.base

import java.nio.file.Paths
import kotlin.io.path.ExperimentalPathApi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.memory
package org.pastalab.fray.instrumentation.base.memory

import java.lang.reflect.Field
import java.lang.reflect.Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.util.*
import java.util.concurrent.atomic.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.Opcodes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject
import org.objectweb.asm.ClassVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.util.concurrent.CountDownLatch
import org.objectweb.asm.ClassVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.util.concurrent.locks.ReentrantLock
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.util.concurrent.locks.LockSupport
import org.objectweb.asm.ClassVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import kotlin.reflect.KFunction
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import kotlin.reflect.KFunction
import org.objectweb.asm.Label
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.*
import org.objectweb.asm.Opcodes.ASM9
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.Label
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.util.concurrent.locks.ReentrantReadWriteLock
import org.objectweb.asm.ClassVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.util.concurrent.Semaphore
import org.objectweb.asm.ClassVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.AnnotationVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import java.io.PrintStream
import java.lang.invoke.CallSite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.*
import org.objectweb.asm.Opcodes.ASM9
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import kotlin.reflect.KFunction
import org.objectweb.asm.ClassVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.MethodVisitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import kotlin.reflect.KFunction
import kotlin.reflect.javaType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.pastalab.fray.instrumentation.visitors
package org.pastalab.fray.instrumentation.base.visitors

import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.FieldVisitor
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Opcodes.ASM9
import org.objectweb.asm.commons.AdviceAdapter
import org.pastalab.fray.instrumentation.memory.VolatileManager
import org.pastalab.fray.instrumentation.base.memory.VolatileManager

class VolatileFieldsInstrumenter(cv: ClassVisitor, private val instrumentingJdk: Boolean) :
ClassVisitor(ASM9, cv) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package visitors

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.pastalab.fray.instrumentation.visitors.Utils
import org.pastalab.fray.instrumentation.base.visitors.Utils

fun exampleMethod(param1: String, param2: Int): Long = 42L

Expand Down
Loading

0 comments on commit 997b6fb

Please sign in to comment.