feat: notify Endor objects of mount lifecycle transitions
Verify Tessera GUI / verify (push) Failing after 7m23s
Verify Tessera GUI / verify (push) Failing after 7m23s
This commit is contained in:
+3
-23
@@ -2,9 +2,8 @@
|
||||
//! function sequences calls, so all handlers share one execution budget.
|
||||
use crate::{block, mount::Mount, ui_bridge::attach_desktop_type};
|
||||
use endor_core::{
|
||||
CodeLayout, ContextNativeFunction, EndorCode, EndorCodeObject, Instruction, NativeCallable,
|
||||
NativeContext, NativeResult, ObjectPayload, ObjectRef, Opcode, Value, Vm, VmError,
|
||||
WeakObjectRef,
|
||||
ContextNativeFunction, NativeCallable, NativeContext, NativeResult, ObjectPayload, ObjectRef,
|
||||
Value, Vm, VmError, WeakObjectRef,
|
||||
};
|
||||
|
||||
const MAX_DELIVERIES: usize = 10_000;
|
||||
@@ -407,26 +406,7 @@ pub fn dispatch(
|
||||
vec![event_ref, guard],
|
||||
))?;
|
||||
calls.push(finish);
|
||||
let mut instructions = Vec::with_capacity(calls.len() * 4 + 1);
|
||||
for index in 0..calls.len() {
|
||||
instructions.push(Instruction::new(Opcode::LoadConst, index as u32));
|
||||
instructions.push(Instruction::simple(Opcode::PushNull));
|
||||
instructions.push(Instruction::new(Opcode::Call, 0));
|
||||
if index + 1 != calls.len() {
|
||||
instructions.push(Instruction::simple(Opcode::PopTop));
|
||||
}
|
||||
}
|
||||
instructions.push(Instruction::simple(Opcode::ReturnValue));
|
||||
let code = EndorCode::from_instructions(
|
||||
&instructions,
|
||||
calls.into_iter().map(Value::Object).collect(),
|
||||
CodeLayout::default(),
|
||||
)?
|
||||
.with_location("<event dispatch>", "<tessera>", 1);
|
||||
let code = cx.allocate(EndorCodeObject::new(code))?;
|
||||
let globals = cx.new_dict()?;
|
||||
let driver = cx.new_function("event dispatch", code, globals)?;
|
||||
attach_desktop_type(cx, driver, "Function", desktop)?;
|
||||
let driver = crate::vm_sequence::build(cx, calls, "<event dispatch>", desktop)?;
|
||||
event.dispatch = Some(cx.store().downgrade(guard)?);
|
||||
event.group = 0;
|
||||
event.stopped_at = None;
|
||||
|
||||
Reference in New Issue
Block a user