スピーカー Yoshinori TAKESAKO (takesako) 応募者 Shibuya.pm
日付: 2009/09/10 11:40
期間: 20 分
言語: 日本語
How to make Perl-regex-based JIT x86 Compiler, only use DynaLoader.
package Acme::x86::CPUID;
use DynaLoader;
sub ProcessorBrandString {
my $cpu = "\0" x 48;
my $x86 = ""
. "S\xbf" . pack("P", $cpu)
. "\xb8\x02\x00\x00\x80"
. ("P\x0f\xa2\x89\x07\x89_\x04\x89O\x08\x89W\x0c\x8d\x7f\x10X\x8d\@\x01" x 3)
. "[\xc3"
;
DynaLoader::dl_install_xsub("X",unpack"L",pack"P",$x86);&X;
$cpu =~ s/\0+//g;
$cpu =~ s/^ +//;
$cpu;
}
print Acme::x86::CPUID::ProcessorBrandString, "\n";