Skip to content

Instantly share code, notes, and snippets.

View rednaxelafx's full-sized avatar

Kris Mok rednaxelafx

View GitHub Profile

Building MLVM version of OpenJDK (Java 1.8) on Mac OS X

Take a look at the comments and code in update.sh.

Requires a working version of Java 1.8.

I use create_tarball.sh to make a copy of the build to share.

OpenJDK 1.7 builds for Mac OS X:

@authorNari
authorNari / gist:875822
Created March 18, 2011 09:36
CRuby's Parallel Marking (Draft)
CRuby's Parallel Marking (Draft)(Ja)
ソースコード: https://github.com/authorNari/ruby
※まだ実装中
1 Abstract
並列スレッドの仕事分配には「Arora's Task Stealing Deque」のアルゴリズムを利用する。
http://doi.acm.org/10.1145/277651.277678
また、並列マークの実装の大部分はOpenJDK7のコードを参考に独自改良したものである。
anonymous
anonymous / gist:878653
Created March 20, 2011 20:37
import java.util.Collections
import java.util.ArrayList
list = ArrayList.new [ "one", "two", "three", "four" ]
puts "unsorted: #{list}"
Collections.sort(list) do |s1, s2|
l1 = dynamic(s1).length
l2 = dynamic(s2).length
@mastbaum
mastbaum / ftrapv.cpp
Created June 2, 2011 16:38
A demonstration of GCC's ftrapv flag for C++ integer overflow debugging
#include<iostream>
#include<signal.h>
#include<limits.h>
/** g++'s -ftrapv flag provides some protection against integer overflows. It
* is a little awkward to use, though. All it will do is "trap" -- you must
* provide a signal handler to deal with it.
*
* (You must compile with -ftrapv for this to work)
*/
let inline name (x : ^T) = (^T : (member Name : string) (x))
let inline age (x : ^T) = (^T : (member Age : int) (x))
let inline nameAndAge x = (name x, age x)
type Person(name : string, age : int) =
member __.Name = name
member __.Age = age
type Employee(name : string, age : int, employeeId : string) =
member __.Name = name
anonymous
anonymous / gist:1108283
Created July 26, 2011 22:47
package com.headius.indy.examples;
import java.lang.invoke.MethodHandle;
import static java.lang.invoke.MethodHandles.*;
import static java.lang.invoke.MethodType.*;
import java.lang.invoke.MutableCallSite;
public class IndyLoop {
public static void main(String[] args) throws Throwable {
// method handle loop adds up numbers from 1 to args[0].to_i
@headius
headius / build.sh
Created August 16, 2011 02:27
Building the Hotspot compiler team's Hotspot branch alone
#!/bin/sh
# This script is for building the hsx/hotspot-comp branch in isolation.
#
# Prerequisites:
# * appropriate build tools
# * a working Sun Java 6 build (i.e. JDK6) is available at:
# HOME/java/re/j2se/1.6.0/latest/binaries/linux-[i586/amd64]
# * a working Sun Java 7 build (i.e. JDK7) is available at:
# HOME/java/re/j2se/1.7.0/latest/binaries/linux-[i586/amd64]
# HOME/java/re/j2se/1.7.0/promoted/latest/binaries/linux-[i586/amd64]
@ytoshima
ytoshima / interp.dump.txt
Created October 22, 2011 01:06
A gdb macro which dumps java7 HotSpot JVM linux/32-bit interpreter codelets and an output
AbstractInterpreter::_code : StubQueue * = 0xb49150c0
_stub_buffer : 0xb6f7a6c0
_number_of_stubs: 0x103
Codelet @ 0xb6f7a6c0 128 -1 0xffffffff 0x10c81a1: "slow signature handler"
Dump of assembler code from 0xb6f7a6e0 to 0xb6f7a740:
0xb6f7a6e0: mov %esp,%ecx
0xb6f7a6e2: call 0xb6f7a6ec
0xb6f7a6e7: jmp 0xb6f7a73f
0xb6f7a6ec: push %ecx
0xb6f7a6ed: push %edi
@szegedi
szegedi / memoryPoolsHotSpot
Created December 13, 2011 23:03
names of MemoryManagerMXBean and MemoryPoolMXBean instances in HotSpot JVM
Table of names of MemoryManagerMXBean and MemoryPoolMXBean instances under
different GC algorithms in Oracle HotSpot VM. Memory managers list the pools
they manage in square brackets; memory pools show their maximum sizes for -Xmx200M setting.
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
SerialGC:

CRubyのGCの構造改革

やりたいこと

以下の6つの機能を分離し、簡単に切り替えられるようにしたい。

  1. OSからのメモリアロケータ
  • OSからメモリアロケートする部分のAPI
  1. Rubyのヒープ管理
  • ヒープの設定を保持