rename io_cache -> io_trace

This commit is contained in:
Dmitry Vasilev
2023-06-27 15:03:03 +03:00
parent cd290ba1dd
commit d1de58fe1c
10 changed files with 110 additions and 110 deletions

View File

@@ -29,23 +29,23 @@ const gen_to_promise = gen_fn => {
}
}
const do_run = function*(module_fns, cxt, io_cache){
const do_run = function*(module_fns, cxt, io_trace){
let calltree
cxt = (io_cache == null || io_cache.length == 0)
// TODO group all io_cache_ properties to single object?
cxt = (io_trace == null || io_trace.length == 0)
// TODO group all io_trace_ properties to single object?
? {...cxt,
io_cache_is_recording: true,
io_cache: [],
io_trace_is_recording: true,
io_trace: [],
}
: {...cxt,
io_cache_is_recording: false,
io_cache,
io_cache_is_replay_aborted: false,
io_cache_resolver_is_set: false,
// Map of (index in io_cache) -> resolve
io_cache_resolvers: new Map(),
io_cache_index: 0,
io_trace_is_recording: false,
io_trace,
io_trace_is_replay_aborted: false,
io_trace_resolver_is_set: false,
// Map of (index in io_trace) -> resolve
io_trace_resolvers: new Map(),
io_trace_index: 0,
}
apply_promise_patch(cxt)
@@ -94,14 +94,14 @@ const do_run = function*(module_fns, cxt, io_cache){
}
}
export const run = gen_to_promise(function*(module_fns, cxt, io_cache) {
const result = yield* do_run(module_fns, cxt, io_cache)
export const run = gen_to_promise(function*(module_fns, cxt, io_trace) {
const result = yield* do_run(module_fns, cxt, io_trace)
if(result.eval_cxt.io_cache_is_replay_aborted) {
if(result.eval_cxt.io_trace_is_replay_aborted) {
// TODO test next line
result.eval_cxt.is_recording_deferred_calls = false
// run again without io cache
// run again without io trace
return yield* do_run(module_fns, cxt, null)
} else {
return result