perf: boxing a uint64 yields and object not a tobject (#12465)
This PR changes the boxed type of `uint64` from `tobject` to `object` to allow for more precise reference counting.
This commit is contained in:
parent
c8462354c6
commit
92aec45057
6 changed files with 12 additions and 11 deletions
|
|
@ -487,7 +487,8 @@ def Lean.Expr.isDefiniteRef : Expr → Bool
|
|||
The boxed version of types.
|
||||
-/
|
||||
def Lean.Expr.boxed : Expr → Expr
|
||||
| ImpureType.object | ImpureType.float | ImpureType.float32 => ImpureType.object
|
||||
| ImpureType.object | ImpureType.float | ImpureType.float32 | ImpureType.uint64 =>
|
||||
ImpureType.object
|
||||
| ImpureType.void | ImpureType.tagged | ImpureType.uint8 | ImpureType.uint16 => ImpureType.tagged
|
||||
| _ => ImpureType.tobject
|
||||
|
||||
|
|
|
|||
|
|
@ -240,10 +240,10 @@
|
|||
default →
|
||||
let x_4 : u64 := 42;
|
||||
ret x_4
|
||||
def Exp.hash._override._boxed (x_1 : tobj) : tobj :=
|
||||
def Exp.hash._override._boxed (x_1 : tobj) : obj :=
|
||||
let x_2 : u64 := Exp.hash._override x_1;
|
||||
dec x_1;
|
||||
let x_3 : tobj := box x_2;
|
||||
let x_3 : obj := box x_2;
|
||||
ret x_3
|
||||
[Compiler.IR] [result]
|
||||
def Exp.app._override (x_1 : tobj) (x_2 : tobj) : tobj :=
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
[Compiler.IR] [result]
|
||||
extern _private.lean.externBoxing.0.Foo.bar (x_1 : obj) (x_2 : u64) : u64
|
||||
def _private.lean.externBoxing.0.Foo.bar._boxed (x_1 : obj) (x_2 : tobj) : tobj :=
|
||||
def _private.lean.externBoxing.0.Foo.bar._boxed (x_1 : obj) (x_2 : obj) : obj :=
|
||||
let x_3 : u64 := unbox x_2;
|
||||
dec x_2;
|
||||
let x_4 : u64 := _private.lean.externBoxing.0.Foo.bar x_1 x_3;
|
||||
let x_5 : tobj := box x_4;
|
||||
let x_5 : obj := box x_4;
|
||||
ret x_5
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ trace: [Compiler.IR] [result]
|
|||
let x_2 : u64 := 9223372036854775808;
|
||||
let x_3 : u64 := UInt64.add x_2 x_1;
|
||||
ret x_3
|
||||
def mwe._boxed (x_1 : tobj) : tobj :=
|
||||
def mwe._boxed (x_1 : obj) : obj :=
|
||||
let x_2 : u64 := unbox x_1;
|
||||
dec x_1;
|
||||
let x_3 : u64 := mwe x_2;
|
||||
let x_4 : tobj := box x_3;
|
||||
let x_4 : obj := box x_3;
|
||||
ret x_4
|
||||
-/
|
||||
#guard_msgs in
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ trace: [Compiler.IR] [result]
|
|||
let x_2 : u64 := sproj[0, 0] x_1;
|
||||
dec x_1;
|
||||
ret x_2
|
||||
def get_unboxed._boxed (x_1 : obj) : tobj :=
|
||||
def get_unboxed._boxed (x_1 : obj) : obj :=
|
||||
let x_2 : u64 := get_unboxed x_1;
|
||||
let x_3 : tobj := box x_2;
|
||||
let x_3 : obj := box x_2;
|
||||
ret x_3
|
||||
-/
|
||||
#guard_msgs in
|
||||
|
|
|
|||
|
|
@ -322,11 +322,11 @@ true
|
|||
[Compiler.IR] [result]
|
||||
def _private.lean.sint_basic.0.myId64 (x_1 : u64) : u64 :=
|
||||
ret x_1
|
||||
def _private.lean.sint_basic.0.myId64._boxed (x_1 : tobj) : tobj :=
|
||||
def _private.lean.sint_basic.0.myId64._boxed (x_1 : obj) : obj :=
|
||||
let x_2 : u64 := unbox x_1;
|
||||
dec x_1;
|
||||
let x_3 : u64 := _private.lean.sint_basic.0.myId64 x_2;
|
||||
let x_4 : tobj := box x_3;
|
||||
let x_4 : obj := box x_3;
|
||||
ret x_4
|
||||
ISize : Type
|
||||
20
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue