- 18 Jun, 2015 10 commits
-
-
Chris Toshok authored
end the unwind session by setting the is_active flag to false. if the unwind session isn't active we don't mark through the ExcInfo, so exceptions/tracebacks should get gc'ed properly.
-
Chris Toshok authored
-
Chris Toshok authored
-
Chris Toshok authored
1. remove the BoxedTraceback** argument from maybeTracebackHere. the unwinding.cpp code can get it just as easily. 2. combine UNWIND_STATE_OSR and UNWIND_STATE_RERAISE into UNWIND_STATE_SKIPNEXT, since they share the same behavior. 3. put the SKIPNEXT behavior in the callers of unwindProcessFrame. Now unwindProcessFrame does nothing but create a PythonFrameIteratorImpl (if it can), and if it can calls its callback with it. 4. initialize the unwind state to NORMAL in raiseExc.
-
Chris Toshok authored
move unwind_state to ThreadStateInternal. move the class decl to threading.h and ensure the small/hot accessors are inlined
-
Chris Toshok authored
stop using 'WHY' just to be similar to cpython. 'STATE' is better. also, reduce duplicate code in unwindProcessFrame
-
Chris Toshok authored
store the exception ferry (as an ExcInfo, not ExcData) within our internal thread state, and explicit visit type/value/traceback at gc time. This allows the gc to run during an unwind (a necessity since we're allocating new BoxedTraceback instances)
-
Chris Toshok authored
-
Chris Toshok authored
Add a tb_next to the BoxedTraceback object, which during normal unwinding is how we add lines to a traceback. For getTraceback() we take advantage fo the fact that each BoxedTraceback can have multiple lines in it, and only create one. Also add BoxedTraceback::Here which is kinda like PyTraceback_Here, except that since we don't have access to the ExcInfo inside it, we have to pass a pointer to the BoxedTraceback*. three wrinkles in traceback generation while unwinding are: 1) if the previous frame was an osr frame (so we should skip the current frame) 2) if the traceback object was passed to raise3, or raise0 was used (treated as a re-raise by cpython) 3) the interpreter map 1 and 2 are fixed by keeping a per-thread interpreter state variable, "unwind_why" ("why" is probably a bad name to use in this context, but cpython's logic uses that word as well), to record if we're in either of those cases. Both cases have the same effect (skip the next traceback line, and reset state to NORMAL.) The interpreter map problem comes about because of the way c++ unwinding works. since ASTInterpreter::execute uses RAII for RegisterHelper, unwinding through the frame causes us to jump to a cleanup block and then resume unwinding (with the IP still in ASTInterpreter::execute). Since the IP is there, we assume the frame is valid and we can look up $rbp in the interpreter map. Given that we just cleaned up the RegisterHelper (and removed the $rbp mapping), we crash. The fix here is to keep the same RegisterHelper in ASTInterpreter::execute, but the ip checked for by the unwinder (and the $rbp in the mapping) correspond to ASTInterpreter::executeInner. Lastly, AST_Interpreter::invoke catches exceptions, so we won't make it to the top-most ASTInterpreter::execute, and so won't add the final line. We make use of BoxedTraceback::Here here as well to add the final line.
-
Kevin Modzelewski authored
Rewrite "a in b" expressions
-
- 17 Jun, 2015 12 commits
-
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
add a stat for the number of times we abort a callattr rewrite because we had to call into python
-
Kevin Modzelewski authored
-
Chris Toshok authored
-
Kevin Modzelewski authored
add per-python line exception stats
-
Kevin Modzelewski authored
Optimize creating tuples from lists
-
Chris Toshok authored
add logByCurrentPythonLine, and use it for skipped ics and exceptions (if the proper STAT_*_LOCATION #defines are enabled) also adds two scripts (tools/ic_stats.py and tools/exception_stats.py) make the stats a little more manageable for these cases.
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
small optimization to sre_compile._compile()
-
Kevin Modzelewski authored
Skip initializing exc fields inside JITed code
-
- 16 Jun, 2015 10 commits
-
-
Kevin Modzelewski authored
Switch from expensive old-style-class iteration to our faster iteration. We could/should probably make old-style iteration much faster than it currently is for us (10x slower than CPython), but this is a pretty targeted change and makes compiling regular expressions much faster: it cuts (non-LLVM) _compile() time by 2x.
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
cache + reuse 1-length strings
-
Kevin Modzelewski authored
Switch those to just calling 'new BoxedString' instead.
-
Kevin Modzelewski authored
Not sure how much it helps, but it's mostly just a wrapper around new boxedstring. Also, I don't think it needs to be in inline/ any more since we will always box strings during codegen rather than emit calls to boxString.
-
Kevin Modzelewski authored
CPython does this and seems like a good thing to do. Otherwise iterating over a string would cause lots of allocations. One difference between this implementation and cpython's is that cpython doesn't eagerly create them, and so it checks to see if they've been created or not.
-
Kevin Modzelewski authored
Even this is 2x slower
-
Kevin Modzelewski authored
Temporarily disable type speculation
-
Kevin Modzelewski authored
Unfortunately our type speculation strategy has bit-rot over time, to the point that it's not super helpful. Deopt (the flip side of the speculation) also has some bugs in it which I was starting to trigger, so just disable the whole thing for now. Turning it off should just be a temporary measure and I'll look soon into what we need to do to get it back on.
-
- 12 Jun, 2015 5 commits
-
-
Chris Toshok authored
-
Kevin Modzelewski authored
cmake change default build directory, configure script, Fedora support
-
Daniel Agar authored
-pyston build using the copied headers that include the generated pyconfig.h
-
Daniel Agar authored
Conflicts: .travis.yml
-
Kevin Modzelewski authored
New benchmarks
-
- 11 Jun, 2015 1 commit
-
-
Kevin Modzelewski authored
Use BoxedString in codegen
-
- 10 Jun, 2015 2 commits
-
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
Convert to BoxedString much sooner, and have any functions that might need to box a string take a BoxedString. This means that on some paths, we will need to box when previously we didn't, but for callsites that we control we can just intern the string and not have to box again. The much more common case is that we passed in unboxed string data, but then ran into a branch that required boxing. BoxedString shouldn't be that much more costly than std::string, and this should cut down on string allocations. For django-template.py, the number of strings allocated drops from 800k to 525k; for virtualenv_test.py, it goes from 1.25M to 1.0M A couple things made this not 100% mechanical: - taking advantage of places that we could eliminate unbox/rebox pairs - different null-termination assumptions between StringRef and the c api.
-