Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <match path="project"> rubinius </match> | |
| <formatter medium="irc"> | |
| <lineLimit>1</lineLimit> | |
| <wrapWidth>150</wrapWidth> | |
| <widthLimit>150</widthLimit> | |
| <crunchWhitespace/> | |
| <format appliesTo="CommitToIRC"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hoshi :: /var/log> | |
| Message from syslogd@hoshi at Fri Aug 1 10:02:17 2008 ... | |
| hoshi kernel: [172392.427177] Uhhuh. NMI received for unknown reason 3c on CPU 0. | |
| Message from syslogd@hoshi at Fri Aug 1 10:02:17 2008 ... | |
| hoshi kernel: [172392.431038] Do you have a strange power saving mode enabled? | |
| Message from syslogd@hoshi at Fri Aug 1 10:02:17 2008 ... | |
| hoshi kernel: [172392.431038] Dazed and confused, but trying to continue | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sark :: git/rbx » rake 'compile_ruby[suck.rb]' | |
| (in /Users/evanphx/git/rbx) | |
| Compiling suck.rb | |
| :push_nil [1, 0, 0] | |
| [:set_local, 0] [0, 1, 1] | |
| :pop [-1, 1, 1] | |
| [:push_local, 0] [1, 0, 1] | |
| [:send_method, 0] [0, 1, 1] | |
| :meta_push_0 [1, 1, 1] | |
| [:send_stack, 1, 1] [-1, 2, 2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sark :: git/rbx » cat scratch/hello.rb | |
| puts "hello world" | |
| sark :: git/rbx » ./vm/jit-test scratch/hello.rbc | |
| 0x800800 push %ebp | |
| 0x800801 mov %esp, %ebp | |
| 0x800803 sub $0xc, %esp | |
| 0x800809 push %edi | |
| 0x80080a push %esi | |
| 0x80080b push %ebx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| cm = def blah | |
| i = 0 | |
| while i < 10 | |
| j = 0 | |
| while j < 20000000 | |
| j += 1 | |
| end | |
| i += 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Compiler::Plugins | |
| class StaticConstantSet < Compiler::Plugin | |
| register Compiler::Node::Call | |
| def self.run(compiler, call) | |
| if !call.object and | |
| call.method == :static and | |
| call.arguments.size == 1 and | |
| call.arguments.first.is? Compiler::Node::ConstSet | |
| cf = call.arguments.first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def blah | |
| :works | |
| end | |
| [:broken].each do |blah| | |
| puts "setup" | |
| end | |
| p blah |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TrySink | |
| def initialize(obj) | |
| @object = obj | |
| end | |
| undef class | |
| def method_missing(meth, *a) | |
| if @object.respond_to? meth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct closure { | |
| int a; | |
| }; | |
| void show(int i); | |
| typedef void (*block)(struct closure* data); | |
| void block_code(struct closure* data) { | |
| data->a += 1; |
OlderNewer