Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Very preliminary relaxed mode draft.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Igotti committed Jul 2, 2019
1 parent 60fb50a commit a8f1e8b
Show file tree
Hide file tree
Showing 14 changed files with 564 additions and 367 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ internal class FunctionGenerationContext(val function: LLVMValueRef,
}

fun checkMainThread(exceptionHandler: ExceptionHandler) {
call(context.llvm.checkMainThread, emptyList(), Lifetime.IRRELEVANT, exceptionHandler)
if (context.memoryModel == MemoryModel.STRICT)
call(context.llvm.checkMainThread, emptyList(), Lifetime.IRRELEVANT, exceptionHandler)
}

private fun updateReturnRef(value: LLVMValueRef, address: LLVMValueRef) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ internal class Llvm(val context: Context, val llvmModule: LLVMModuleRef) {
val allocArrayFunction = importModelSpecificRtFunction("AllocArrayInstance")
val initInstanceFunction = importModelSpecificRtFunction("InitInstance")
val initSharedInstanceFunction = importModelSpecificRtFunction("InitSharedInstance")
val updateHeapRefFunction = importRtFunction("UpdateHeapRef")
val updateStackRefFunction = importRtFunction("UpdateStackRef")
val updateReturnRefFunction = importRtFunction("UpdateReturnRef")
val enterFrameFunction = importRtFunction("EnterFrame")
val leaveFrameFunction = importRtFunction("LeaveFrame")
val updateHeapRefFunction = importModelSpecificRtFunction("UpdateHeapRef")
val updateStackRefFunction = importModelSpecificRtFunction("UpdateStackRef")
val updateReturnRefFunction = importModelSpecificRtFunction("UpdateReturnRef")
val enterFrameFunction = importModelSpecificRtFunction("EnterFrame")
val leaveFrameFunction = importModelSpecificRtFunction("LeaveFrame")
val lookupOpenMethodFunction = importRtFunction("LookupOpenMethod")
val isInstanceFunction = importRtFunction("IsInstance")
val checkInstanceFunction = importRtFunction("CheckInstance")
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/main/cpp/Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ KNativePtr Kotlin_AtomicNativePtr_get(KRef thiz) {
}

void Kotlin_AtomicReference_checkIfFrozen(KRef value) {
if (value != nullptr && !PermanentOrFrozen(value)) {
if (value != nullptr && !isPermanentOrFrozen(value)) {
ThrowInvalidMutabilityException(value);
}
}
Expand Down
Loading

0 comments on commit a8f1e8b

Please sign in to comment.