Skip to content

Commit

Permalink
Applying review comments #1
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov-alexey committed Oct 12, 2020
1 parent f0884a5 commit 55e5f79
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions numba/core/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,13 +983,6 @@ def compile(self, sig):
flags = self.flags
args, return_type = sigutils.normalize_signature(sig)

# for objmode we should have ffi_forced_objects as args
# and no_rewrites flag can be set to avoid recompilation with and
# without rewrites in compile_ir
if isinstance(self, ObjModeLiftedWith):
args = [types.ffi_forced_object] * len(args)
flags.no_rewrites = True

# Don't recompile if signature already exists
# (e.g. if another thread compiled it before we got the lock)
existing = self.overloads.get(tuple(args))
Expand Down Expand Up @@ -1063,6 +1056,8 @@ def __init__(self, *args, **kwargs):
raise ValueError("expecting `flags.force_pyobject`")
if self.output_types is None:
raise TypeError('`output_types` must be provided')
# switch off rewrites, they have no effect
self.flags.no_rewrites = True

@property
def _numba_type_(self):
Expand Down Expand Up @@ -1107,6 +1102,12 @@ def _legalize_arg_types(self, args):
)
raise errors.TypingError(msg.format(i))

@global_compiler_lock
def compile(self, sig):
args, _ = sigutils.normalize_signature(sig)
sig = (types.ffi_forced_object,) * len(args)
return super().compile(sig)


# Initialize typeof machinery
_dispatcher.typeof_init(
Expand Down

0 comments on commit 55e5f79

Please sign in to comment.