Show enters and exits. Hide enters and exits.
| 00:01:40 | headius | I was afraid of that |
| 00:22:54 | boyscout | Quick fixes to several debugger commands - a08f2f3 - Adam Gardiner |
| 00:24:21 | boyscout | CI: a08f2f3 success. 1502 files, 7234 examples, 23646 expectations, 0 failures, 0 errors |
| 09:20:53 | boyscout | Fixed bigdecimal to not make assumptions about VALUEs. - 0d69f42 - Brian Ford |
| 09:20:53 | boyscout | Fixes for capi numeric conversions. - 8221f5b - Brian Ford |
| 09:20:53 | boyscout | Fixed bigdecimal divmod variants. - 44c8783 - Brian Ford |
| 09:20:53 | boyscout | Correctly mimic crazy MRI coerce functions. - 89423a1 - Brian Ford |
| 09:20:53 | boyscout | Updated CI tags for bigdecimal. - a3ebdd1 - Brian Ford |
| 09:25:48 | boyscout | CI: a3ebdd1 success. 1503 files, 7142 examples, 23495 expectations, 0 failures, 7 errors |
| 09:51:25 | boyscout | Recompile capi exts for specs if ruby.h changes. - ab57598 - Brian Ford |
| 09:53:00 | boyscout | CI: ab57598 success. 1503 files, 7244 examples, 23658 expectations, 0 failures, 0 errors |
| 15:49:00 | macournoyer | evan: you there? |
| 16:00:05 | rue | Probably not quite yet |
| 16:41:22 | evan | macournoyer: yo |
| 16:41:37 | macournoyer | hey! |
| 16:41:39 | evan | macournoyer: what can I do ya for? |
| 16:42:00 | rue | Wow, did I not miss reading MRI source |
| 16:42:01 | macournoyer | I just have a small Q re the raise thin we talked about |
| 16:42:08 | macournoyer | exception,non local return and break |
| 16:42:21 | macournoyer | works pretty well for me btw |
| 16:42:29 | macournoyer | just: how do you build the backtrace? |
| 16:42:34 | evan | cool |
| 16:42:37 | evan | ah ha |
| 16:42:41 | evan | the all important question. |
| 16:43:03 | macournoyer | I don't see how this is done in VMMethod::run_interpreter |
| 16:43:16 | evan | thats because it's not done there |
| 16:43:22 | macournoyer | ah :/ |
| 16:43:32 | rue | Parallel universe of CallFrames :) |
| 16:43:38 | evan | check out system.cpp |
| 16:43:43 | evan | specificly, vm_backtrace |
| 16:43:50 | evan | you know that CallFrame argument you see passed down? |
| 16:44:04 | evan | those for a linked list of CallFrame structures that live on the C stack |
| 16:44:04 | macournoyer | yes |
| 16:44:09 | evan | because they're allocated with alloca |
| 16:44:24 | evan | so they just have to be walked to generate a backtrace |
| 16:44:37 | evan | basicly, you have to introduce some kind of simple data structure |
| 16:45:02 | macournoyer | but where do you keep ref of the original calling frame, the one where the exception occured |
| 16:45:09 | macournoyer | cause you're unwindinw in run_interpreter |
| 16:45:13 | macournoyer | *unwinding |
| 16:45:30 | evan | ah. |
| 16:45:34 | evan | I don'.t |
| 16:45:46 | evan | in rubinius, backtraces are totally decoupled from exceptions |
| 16:46:02 | rue | Although, some fellow posited that by caller-allocating the stack it would be possible to do without a parallel frame structure |
| 16:46:04 | evan | rather, decoupled from the exception raising mechanism |
| 16:46:32 | evan | rue: parallel with what? |
| 16:46:51 | macournoyer | so you save it somewhere before unwindwing in VMMethod::run_interpreter? |
| 16:47:06 | evan | the backtrace is generated, put into an Exception object |
| 16:47:10 | evan | then than exception is raised |
| 16:47:17 | macournoyer | aaah |
| 16:47:20 | macournoyer | ok ok |
| 16:47:40 | evan | check out raise in kernel/delta/kernel.rb |
| 16:47:43 | evan | you'll see we do |
| 16:47:50 | evan | exc.locations = Rubinius::VM.backtrace |
| 16:48:10 | macournoyer | aaaaaaaah! |
| 16:48:15 | macournoyer | makes sense now |
| 16:48:37 | macournoyer | also, why you're allocating the call frames on the stack w/ alloca? |
| 16:48:44 | macournoyer | what's the advantages of this? |
| 16:48:47 | macournoyer | so you don't have to free? |
| 16:48:51 | evan | exactly |
| 16:48:56 | evan | if you allocate them in the heap |
| 16:48:58 | evan | you have to free them |
| 16:49:09 | evan | which means management of them |
| 16:49:11 | evan | but also |
| 16:49:17 | evan | there are SO many of them |
| 16:49:27 | macournoyer | is alloca part of posix? |
| 16:49:28 | evan | it overwhelms the allocator |
| 16:49:31 | evan | yes. |
| 16:49:42 | evan | i thought you were already using alloca |
| 16:49:49 | evan | how do you allocate the register file? |
| 16:49:50 | macournoyer | no |
| 16:50:13 | macournoyer | I have a fixed size array of frame and registers |
| 16:50:22 | rue | Hm, might add the option to get the VM backtrace when generating backtrace too |
| 16:50:33 | evan | rue: not a bad idea. |
| 16:50:39 | rue | Need to futz with execinfo workarounds again I guess |
| 16:51:02 | evan | rue: check out libunwind |
| 16:51:11 | evan | i've thought about how we could use that |
| 16:51:13 | macournoyer | struct { TrFrame frames[MAX_FRAMES] } TrVm; |
| 16:51:18 | macournoyer | is what I have right now |
| 16:51:23 | evan | well |
| 16:51:24 | macournoyer | I didn;t know about alloca |
| 16:51:29 | evan | sur |
| 16:51:40 | evan | but each method needs a different number of registers, yes? |
| 16:52:12 | macournoyer | yes, but can't be more the the max size of A,B,C registers in an instruction |
| 16:52:15 | macournoyer | which is 255 |
| 16:52:30 | evan | so every frame gets 255 registers? |
| 16:52:34 | macournoyer | yeah :/ |
| 16:52:39 | evan | yikes! |
| 16:52:40 | macournoyer | I have a TODO for that |
| 16:52:45 | macournoyer | :) |
| 16:52:46 | evan | let me tell ya about alloca :D |
| 16:53:04 | evan | it's like malloc, but the pointer is on the current stack |
| 16:53:10 | evan | and when you return, it goes away. |
| 16:53:28 | evan | currently, I use alloca to allocate the stk, CallFrame, and VariableScope |
| 16:53:29 | evan | on the C stack |
| 16:53:39 | macournoyer | what is alloca(0) for? |
| 16:53:47 | macournoyer | to get the address of the stack? |
| 16:53:49 | evan | thats a hack. |
| 16:53:51 | evan | yes. |
| 16:54:07 | macournoyer | ok |
| 16:54:40 | evan | thats the same as |
| 16:54:42 | evan | int a; |
| 16:54:45 | evan | void* addr = &a; |
| 16:54:53 | macournoyer | is it efficient? like should I do this before each method call? |
| 16:55:03 | evan | it's very efficient |
| 16:55:10 | macournoyer | okok |
| 16:55:14 | evan | yes, you can do it before every method call |
| 16:56:11 | macournoyer | well, how did I miss that |
| 16:56:13 | macournoyer | thx |
| 17:09:45 | macournoyer | allocation the stack before each call makes it almost twice slower |
| 17:12:37 | evan | macournoyer: what did you change? |
| 17:12:42 | evan | could ya show me a diff? |
| 17:13:31 | macournoyer | http://gist.github.com/96496 |
| 17:13:43 | macournoyer | f->stack is the pointer to the array |
| 17:13:50 | macournoyer | stack[MAX_REG] |
| 17:14:23 | macournoyer | w/ bm_vm2_method.rb I get 0m2.880s before and 0m4.002s w/ this |
| 17:17:35 | evan | hm. |
| 17:17:35 | evan | ok. |
| 17:17:48 | evan | well, i guess that makes sense a little |
| 17:17:58 | evan | the old mechanism didn't require any extra work per method call |
| 17:18:05 | evan | but it uses a lot of extra memory |
| 17:18:08 | macournoyer | yeah, probably |
| 17:18:20 | macournoyer | tradeoffs, life is full of |
| 17:18:23 | evan | :D |
| 17:19:13 | macournoyer | on that note, I'm out for lunch |
| 19:27:48 | rue | evan: libunwind seems likely to be portable, I will poke it. |
| 19:28:01 | evan | dope |
| 19:28:06 | evan | new jit awesomeness: http://gist.github.com/96579 |
| 19:28:12 | evan | complete call frame elimination |
| 19:28:19 | evan | for the motherfucking win |
| 19:28:52 | rue | Excellent |
| 19:29:01 | rue | You are pushing it through LLVM? |
| 19:29:07 | evan | yeah |
| 19:29:17 | evan | that lowers my time to market for now. |
| 19:29:26 | evan | plus the macruby guys are pushing on the LLVM guys |
| 19:29:34 | evan | to fix some of the JIT slowness |
| 19:29:35 | rue | Yep, sure |
| 19:29:41 | evan | they've fixed it a bit actually |
| 19:29:51 | evan | plus, it's delayed, unlike our initial experiment |
| 19:30:02 | rue | I think the self-assembling did its job anyway |
| 19:30:17 | evan | which was? |
| 19:30:39 | rue | To figure out how to restructure the rest of the VM |
| 19:30:45 | evan | yep |
| 19:30:53 | rue | Forest, trees etc. |
| 19:30:54 | evan | the JIT is now structured like you'd imagine |
| 19:31:08 | evan | ie, the entire body of work to execute a method is JITd |
| 19:31:19 | evan | unlike our previous attempts |
| 19:31:24 | rue | Exactly |
| 19:31:33 | evan | which means a lot more optimization can occur, intra-method |
| 19:47:05 | rue | Have you tested the primitive callpath with JIT? |
| 19:49:31 | evan | not yet |
| 19:49:39 | evan | think we'll run into problems? |
| 19:53:12 | rue | Probably not, but there is likely some streamlining possible there |
| 19:56:57 | rue | And the "performance primitives" should migrate back to Ruby in that process |
| 19:58:52 | evan | agreed. |
| 20:27:03 | evan | woop. |
| 20:27:20 | evan | why i've always wanted to be using LLVM: http://gist.github.com/96607 |
| 20:27:33 | evan | contrived, yes |
| 20:27:47 | evan | but it constant collapsed the fixnum comparison |
| 20:27:50 | evan | directly into false |
| 20:28:38 | tilman | i guess it's time to get excited now? :D |
| 20:28:44 | evan | heh |
| 20:36:54 | rue | breaks out the flag |
| 20:37:04 | evan | woo |
| 20:37:07 | evan | another awesome thing |
| 20:37:12 | evan | there are so many passes to do shit |
| 20:37:55 | evan | I added another pass, and here's what I got: http://gist.github.com/96607 |
| 20:37:57 | evan | last file |
| 20:44:15 | rue | Generating by hand or transforming it? |
| 20:44:24 | evan | transformed |
| 20:44:28 | evan | no hand optimization |
| 20:44:31 | evan | just added |
| 20:45:38 | evan | passes_->add(createDeadStoreEliminationPass()); |
| 20:45:42 | evan | boom. |
| 20:57:08 | rue | Boom! or Ka-boom |
| 21:12:36 | rue | Delay indicative of ka-boom |
| 21:21:48 | macournoyer | nice! |
| 21:21:51 | macournoyer | llvm is magic |
| 21:27:29 | evan | :D |
| 22:21:10 | rue | No matter what we do, it always comes down to reading assembly |
| 22:21:36 | evan | i know |
| 22:29:38 | rue | Hm, LLVM uses assembly and IR interchangeably in doc? |
| 22:30:27 | evan | eh? |
| 22:33:00 | rue | Ah, no, they do distinguish it, right at the top. The doc sometimes refers to IR and sometimes to assembly |
| 22:33:07 | rue | (LLVM assembly) |
| 22:33:12 | evan | ah ah |
| 22:33:17 | evan | the words, gotcha. |
| 22:33:36 | rue | Yeh |