YAPC::Asia 2009

Inline::x86 JIT Assembler

スピーカー 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";

Attended by:

Sponsors

主催

YAPC Sponsors

  • O'Reilly Japan
  • Contents One
  • Six Apart
  • Booking.com
  • Fractalist
  • 募集中

Media Sponsors (50音順)

  • @IT
  • O'Reilly Japan
  • gihyo.jp
  • Shoeisha
  • 募集中

JPA Platinum Sponsors

  • S2 Factory
  • endeworks
  • GaiaX
  • DeNA
  • mixi
  • livedoor

JPA Gold Sponsors

JPA Silver Sponsors

  • Adjust
  • ADWAYS CO., LTD.
  • Intfloat
  • KDDI Web Communications
  • Seesaa Co. Inc.
  • Six Apart
  • Paperboy & co
  • Plugin and Core
  • Mobile Factory

JPA Bronze Sponsors

  • Soffritto
  • wadit