Skip to content

Instantly share code, notes, and snippets.

View playXE's full-sized avatar
🐢
Keep Rollin' Rollin' Rollin'

playX playXE

🐢
Keep Rollin' Rollin' Rollin'
  • VDX.tv
  • Da Nang, Vietnam
  • 08:59 (UTC +07:00)
View GitHub Profile
(define dsl-run #f)
(let ()
(define (map* f lst)
(let loop ([lst lst] [res '()])
(if (null? lst)
(reverse res)
use std::rc::Rc;
use b3::{ValueRep, Reg, BasicBlockBuilder};
use macroassembler::{jit::{gpr_info::*, helpers::AssemblyHelpers}, assembler::{abstract_macro_assembler::Address, TargetMacroAssembler}};
pub fn tail_call(bb: &mut b3::BasicBlockBuilder, callee: b3::ValueId, args: &[b3::ValueId]) {
let patchpoint = bb.patchpoint(b3::Type::Void);
bb.procedure.patchpoint_effects_mut(patchpoint).terminal = true;
bb.procedure.patchpoint_effects_mut(patchpoint).exit_sideways = true;
waffle::val::fadd:
sub sp, sp, #64
stp x22, x21, [sp, #16]
stp x20, x19, [sp, #32]
stp x29, x30, [sp, #48]
add x29, sp, #48
mov x20, x1
mov x19, x0
mov x21, #2
movk x21, #65534, lsl, #48
function min(left, right) {
if (left < right) {
return left;
}
return right;
}
function sortMerge(dst, src, srcIndex, srcEnd, width, comparator) {
"use strict";
var left = srcIndex;
Benchmarking gc vs rc/Immix(30% threshold)/0: Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 5.1s.
gc vs rc/Immix(30% threshold)/0
time: [440.09 ms 465.06 ms 487.66 ms]
change: [-4.5483% +1.5499% +6.8789%] (p = 0.62 > 0.05)
No change in performance detected.
Finished 30% threshold benchmark with total 614.4M threshold
gc vs rc/Immix(30% threshold) after first bench/0
time: [456.78 ms 472.31 ms 487.89 ms]
change: [-1.1698% +3.2781% +7.4036%] (p = 0.18 > 0.05)
pub const ALIGN: usize = 2 * core::mem::size_of::<usize>();
pub fn align_usize(value: usize, align: usize) -> usize {
if align == 0 {
return value;
}
((value + align - 1) / align) * align
}
use std::cell::UnsafeCell;
func swap(x: *i32,y: *i32) void {
if x == y {
return;
}
*x = *x ^ *y;
*y = *y ^ *x;
*x = *x ^ *y;
return;
}
@playXE
playXE / IncrementalMark.rs
Created January 23, 2020 13:52
Incremental mark&sweep in Rus
#[derive(Clone, PartialEq, Eq, Copy, Debug)]
#[repr(u8)]
pub enum IncrementalState {
Done,
Mark,
Sweep,
Roots,
}
pub struct IncrementalMarkAndSweep<'a> {
@playXE
playXE / IncrementalMark.rs
Created January 23, 2020 13:52
Incremental mark&sweep in Rus
#[derive(Clone, PartialEq, Eq, Copy, Debug)]
#[repr(u8)]
pub enum IncrementalState {
Done,
Mark,
Sweep,
Roots,
}
pub struct IncrementalMarkAndSweep<'a> {
Codegen irGenerator;
for (auto* module : Module::getAllImportedModules()) {
irGenerator.compile(*module);
}
auto& mainModule = irGenerator.compile(module);