feat: JIT (WIP)
This commit is contained in:
@@ -88,10 +88,7 @@ impl JITCompile for BinOp {
|
||||
ctx.builder
|
||||
.build_store(
|
||||
res,
|
||||
ctx.helpers.value_type.const_named_struct(&[
|
||||
ctx.helpers.const_int(Int as i64).into(),
|
||||
val.into(),
|
||||
]),
|
||||
ctx.helpers.new_value(Int, val.into())
|
||||
)
|
||||
.unwrap();
|
||||
ctx.builder.position_at_end(int_float);
|
||||
@@ -112,10 +109,7 @@ impl JITCompile for BinOp {
|
||||
ctx.builder
|
||||
.build_store(
|
||||
res,
|
||||
ctx.helpers.value_type.const_named_struct(&[
|
||||
ctx.helpers.const_int(Float as i64).into(),
|
||||
val.into(),
|
||||
]),
|
||||
ctx.helpers.new_value(Float, val.into())
|
||||
)
|
||||
.unwrap();
|
||||
ctx.builder.position_at_end(float_int);
|
||||
@@ -136,10 +130,7 @@ impl JITCompile for BinOp {
|
||||
ctx.builder
|
||||
.build_store(
|
||||
res,
|
||||
ctx.helpers.value_type.const_named_struct(&[
|
||||
ctx.helpers.const_int(Float as i64).into(),
|
||||
val.into(),
|
||||
]),
|
||||
ctx.helpers.new_value(Float, val.into())
|
||||
)
|
||||
.unwrap();
|
||||
ctx.builder.position_at_end(int_int);
|
||||
@@ -150,10 +141,7 @@ impl JITCompile for BinOp {
|
||||
ctx.builder
|
||||
.build_store(
|
||||
res,
|
||||
ctx.helpers.value_type.const_named_struct(&[
|
||||
ctx.helpers.const_int(Float as i64).into(),
|
||||
val.into(),
|
||||
]),
|
||||
ctx.helpers.new_value(Float, val.into())
|
||||
)
|
||||
.unwrap();
|
||||
ctx.builder.position_at_end(fallback);
|
||||
@@ -179,10 +167,7 @@ impl JITCompile for BinOp {
|
||||
ctx.builder
|
||||
.build_store(
|
||||
res,
|
||||
ctx.helpers.value_type.const_named_struct(&[
|
||||
ctx.helpers.const_int(Bool as i64).into(),
|
||||
val.into(),
|
||||
]),
|
||||
ctx.helpers.new_value(Bool, val.into())
|
||||
)
|
||||
.unwrap();
|
||||
ctx.builder.position_at_end(fallback);
|
||||
@@ -233,8 +218,8 @@ impl JITCompile for If {
|
||||
}
|
||||
|
||||
impl JITCompile for LoadFunc {
|
||||
fn compile<'gc>(&self, ctx: &JITContext<'gc>, func: FunctionValue<'gc>) -> StructValue<'gc> {
|
||||
todo!()
|
||||
fn compile<'gc>(&self, ctx: &JITContext<'gc>, _: FunctionValue<'gc>) -> StructValue<'gc> {
|
||||
ctx.helpers.new_value(ValueTag::Function, ctx.helpers.const_int(self.idx as i64).into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,8 +290,8 @@ impl JITCompile for LetVar {
|
||||
}
|
||||
|
||||
impl JITCompile for Thunk {
|
||||
fn compile<'gc>(&self, ctx: &JITContext<'gc>, func: FunctionValue<'gc>) -> StructValue<'gc> {
|
||||
todo!()
|
||||
fn compile<'gc>(&self, ctx: &JITContext<'gc>, _: FunctionValue<'gc>) -> StructValue<'gc> {
|
||||
ctx.helpers.new_value(ValueTag::Thunk, ctx.helpers.const_int(self.idx as i64).into())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user