Bases: numba.visitors.NumbaTransformer
Rewrite cascaded ast.Compare nodes to a sequence of boolean operations ANDed together:
a < b < c
becomes
a < b and b < c
Reduce cascaded comparisons into single comparisons
Bases: numba.visitors.NumbaTransformer
Specialize exception handling. Handle error checking and raising.
Bases: numba.visitors.NumbaTransformer
Resolve the ‘raise’ statement.
Bases: object
Use a C utility function from numba/utility/utilities/virtuallookup.c to look up virtual methods in a hash table.
Use for debugging.
Bases: object
Handle attribute lookup and method calls for autojit extensions with dynamic perfect-hash-based virtual method tables and dynamic object layouts.
Resolve an extension method of a dynamic hash-based vtable:
We may cache (*vtab_slot), but we may not cache (**vtab_slot), since compilations may regenerate the table.
However, we could preload (**vtab_slot), where function calls invalidate the preload, if we were so inclined.
Bases: numba.visitors.NumbaTransformer
Lower extension type attribute accesses and method calls.
Resolve an extension attribute.
Resolve an extension method. We currently only support immediate calls of extension methods.
Bases: object
Use a numba function from numba.utility.virtuallookup to look up virtual methods in a hash table.
Parameters: |
|
---|---|
Returns: | The virtual method as a Node |
Bases: object
Handle attribute lookup and method calls for static extensions with C++/Cython-like virtual method tables and static object layouts.
Resolve an extension attribute for a static object layout.
Node : | ExtTypeAttribute AST node |
---|
Bases: numba.visitors.NumbaTransformer, numba.visitors.NoPythonContextMixin
Define various loop implementations.
Bases: numba.specialize.loopimpl.IteratorImpl
Implement iteration using indexing.
Length of the iterable
Index element and update index
Bases: object
Implementation of an iterator over a value of a certain type
Get the loop body as a list of statements
Set up an iterator (statement or None)
Get the next iterator element (ExprNode)
Bases: numba.specialize.loopimpl.IteratorImpl
Implement iteration over an iterator which has externally callable functions for the getiter and next operations.
Find a suitable iterator type for which we have an implementation
Bases: numba.visitors.NumbaTransformer
This transforms for loops over objects.
Bases: numba.visitors.NumbaTransformer
Rewrite a loop like
into
_arr = array [_s = start] for _i in range(len(_arr)):
i = _i [+ _s] x = _arr[_i] ...
Rewrite a loop like
into
_xs = xs; _ys = ys... for _i in range(min(len(_xs), len(_ys)...)):
x = _xs[_i]; y = _ys[_i]... ...
Bases: numba.visitors.NumbaTransformer
This transforms loops over 1D arrays and loops over range().
Convert 1D array iteration to for-range and indexing:
- for value in my_array:
- ...
becomes
- for i in my_array.shape[0]:
- value = my_array[i] ...
Handle range iteration:
- for i in range(start, stop, step):
- ...
becomes
nsteps = compute_nsteps(start, stop, step) temp = 0
- while temp < nsteps:
- target = start + temp * step ... temp += 1
Copy cfg basic blocks from one flow node to another
Create a While from a For. The ‘test’ (loop condition) must still be set.
Create a while loop from a flow node (a While or If node)
Temp node with a yet unknown type