diff options
-rw-r--r-- | luxc/src/lux/compiler/jvm/function.clj | 6 | ||||
-rw-r--r-- | new-luxc/source/luxc/generator/host/jvm/def.lux | 20 |
2 files changed, 14 insertions, 12 deletions
diff --git a/luxc/src/lux/compiler/jvm/function.clj b/luxc/src/lux/compiler/jvm/function.clj index 83c1fb95c..14ad9884f 100644 --- a/luxc/src/lux/compiler/jvm/function.clj +++ b/luxc/src/lux/compiler/jvm/function.clj @@ -106,7 +106,7 @@ (.visitMaxs 0 0) (.visitEnd)))) -(let [impl-flags (+ Opcodes/ACC_PUBLIC Opcodes/ACC_FINAL)] +(let [impl-flags (+ Opcodes/ACC_PUBLIC Opcodes/ACC_FINAL Opcodes/ACC_STRICT)] (defn ^:private add-function-impl [^ClassWriter class class-name compile arity impl-body] (let [$begin (new Label)] (&/with-writer (doto (.visitMethod class impl-flags "impl" (function-impl-signature arity) nil nil) @@ -165,7 +165,7 @@ $labels* (map (fn [_] (new Label)) (repeat num-partials nil)) $labels (vec (concat $labels* (list $default))) $end (new Label) - method-writer (.visitMethod class-writer Opcodes/ACC_PUBLIC &&/apply-method (&&/apply-signature +degree+) nil nil) + method-writer (.visitMethod class-writer (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STRICT) &&/apply-method (&&/apply-signature +degree+) nil nil) frame-locals (to-array (list class-name "java/lang/Object" "java/lang/Object")) frame-stack (to-array [Opcodes/INTEGER]) arity-over-extent (- arity +degree+)] @@ -221,7 +221,7 @@ (.visitEnd)) (return nil))) (let [$begin (new Label)] - (&/with-writer (doto (.visitMethod ^ClassWriter class-writer Opcodes/ACC_PUBLIC &&/apply-method (&&/apply-signature 1) nil nil) + (&/with-writer (doto (.visitMethod ^ClassWriter class-writer (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STRICT) &&/apply-method (&&/apply-signature 1) nil nil) (.visitCode) (.visitLabel $begin)) (|do [^MethodVisitor *writer* &/get-writer diff --git a/new-luxc/source/luxc/generator/host/jvm/def.lux b/new-luxc/source/luxc/generator/host/jvm/def.lux index 42cfa2d68..8931db940 100644 --- a/new-luxc/source/luxc/generator/host/jvm/def.lux +++ b/new-luxc/source/luxc/generator/host/jvm/def.lux @@ -25,6 +25,7 @@ (#static ACC_FINAL int) (#static ACC_STATIC int) (#static ACC_SYNCHRONIZED int) + (#static ACC_STRICT int) (#static ACC_SUPER int) (#static ACC_INTERFACE int) @@ -91,19 +92,20 @@ #$;Private Opcodes.ACC_PRIVATE #$;Default 0)) -(def: (class-flag config) +(def: (class-flags config) (-> $;Class-Config Int) ($_ i.+ (if (get@ #$;finalC config) Opcodes.ACC_FINAL 0))) -(def: (method-flag config) +(def: (method-flags config) (-> $;Method-Config Int) ($_ i.+ + Opcodes.ACC_STRICT (if (get@ #$;staticM config) Opcodes.ACC_STATIC 0) (if (get@ #$;finalM config) Opcodes.ACC_FINAL 0) (if (get@ #$;synchronizedM config) Opcodes.ACC_SYNCHRONIZED 0))) -(def: (field-flag config) +(def: (field-flags config) (-> $;Field-Config Int) ($_ i.+ (if (get@ #$;staticF config) Opcodes.ACC_STATIC 0) @@ -154,7 +156,7 @@ Opcodes.ACC_SUPER <flag> (visibility-flag visibility) - (class-flag config)) + (class-flags config)) ($t;binary-name name) (parameters-signature parameters super interfaces) (|> super product;left $t;binary-name) @@ -181,7 +183,7 @@ Opcodes.ACC_SUPER Opcodes.ACC_INTERFACE (visibility-flag visibility) - (class-flag config)) + (class-flags config)) ($t;binary-name name) (parameters-signature parameters $Object interfaces) (|> $Object product;left $t;binary-name) @@ -198,7 +200,7 @@ (function [writer] (let [=method (ClassWriter.visitMethod [($_ i.+ (visibility-flag visibility) - (method-flag config)) + (method-flags config)) ($t;binary-name name) ($t;method-descriptor type) ($t;method-signature type) @@ -216,7 +218,7 @@ (function [writer] (let [=method (ClassWriter.visitMethod [($_ i.+ (visibility-flag visibility) - (method-flag config) + (method-flags config) Opcodes.ACC_ABSTRACT) ($t;binary-name name) ($t;method-descriptor type) @@ -231,7 +233,7 @@ (function [writer] (let [=field (do-to (ClassWriter.visitField [($_ i.+ (visibility-flag visibility) - (field-flag config)) + (field-flags config)) ($t;binary-name name) ($t;descriptor type) ($t;signature type) @@ -245,7 +247,7 @@ (function [writer] (let [=field (do-to (ClassWriter.visitField [($_ i.+ (visibility-flag visibility) - (field-flag config)) + (field-flags config)) ($t;binary-name name) ($t;descriptor <jvm-type>) ($t;signature <jvm-type>) |