提交 9f4e6b56 authored 作者: Frederic's avatar Frederic

Fix profiler with allow_gc=False.

上级 a9fc84a6
...@@ -728,9 +728,8 @@ class VM_Linker(link.LocalLinker): ...@@ -728,9 +728,8 @@ class VM_Linker(link.LocalLinker):
if self.use_cloop and config.profile_memory: if self.use_cloop and config.profile_memory:
warnings.warn( warnings.warn(
'CVM does not support memory profile, using Stack VM.') 'CVM does not support memory profile, using Stack VM.')
deps = None # Needed when allow_gc=True and profiling
if self.allow_gc: deps = self.compute_gc_dependencies(storage_map)
deps = self.compute_gc_dependencies(storage_map)
vm = Stack( vm = Stack(
nodes, thunks, pre_call_clear, nodes, thunks, pre_call_clear,
storage_map, compute_map, storage_map, compute_map,
...@@ -765,13 +764,11 @@ class VM_Linker(link.LocalLinker): ...@@ -765,13 +764,11 @@ class VM_Linker(link.LocalLinker):
assert type(storage_map_list[0]) is list assert type(storage_map_list[0]) is list
assert type(compute_map_list[0]) is list assert type(compute_map_list[0]) is list
if self.allow_gc: # Needed when allow_gc=True and profiling
dependency_map = self.compute_gc_dependencies(storage_map) dependency_map = self.compute_gc_dependencies(storage_map)
dependency_map_list = [ dependency_map_list = [
[vars_idx[d] for d in dependency_map[vars_idx_inv[i]]] [vars_idx[d] for d in dependency_map[vars_idx_inv[i]]]
for i in xrange(len(vars_idx_inv))] for i in xrange(len(vars_idx_inv))]
else:
dependency_map_list = None
# build the pointers to node inputs and offsets # build the pointers to node inputs and offsets
base_input_output_list = [] base_input_output_list = []
...@@ -869,9 +866,8 @@ class VM_Linker(link.LocalLinker): ...@@ -869,9 +866,8 @@ class VM_Linker(link.LocalLinker):
thunks, thunks,
pre_call_clear) pre_call_clear)
else: else:
deps = None # Needed when allow_gc=True and profiling
if self.allow_gc: deps = self.compute_gc_dependencies(storage_map)
deps = self.compute_gc_dependencies(storage_map)
vm = Stack( vm = Stack(
nodes, thunks, pre_call_clear, nodes, thunks, pre_call_clear,
storage_map, compute_map, storage_map, compute_map,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论