mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 10:41:11 +08:00
refactor: 拆分 Kernel 中可变 Session 与不可变 Core
This commit is contained in:
@@ -6,7 +6,7 @@ impl Vm {
|
||||
#[inline(always)]
|
||||
pub(crate) fn dispatch_and(&mut self, rd: usize, a: usize, b: usize) {
|
||||
let val = self.regs[a];
|
||||
if coercion::to_boolean(val, self.kernel.string_forge().as_ref()) {
|
||||
if coercion::to_boolean(val, self.kernel_core.string_forge().as_ref()) {
|
||||
self.regs[rd] = self.regs[b];
|
||||
} else {
|
||||
self.regs[rd] = val;
|
||||
@@ -16,7 +16,7 @@ impl Vm {
|
||||
#[inline(always)]
|
||||
pub(crate) fn dispatch_or(&mut self, rd: usize, a: usize, b: usize) {
|
||||
let val = self.regs[a];
|
||||
if coercion::to_boolean(val, self.kernel.string_forge().as_ref()) {
|
||||
if coercion::to_boolean(val, self.kernel_core.string_forge().as_ref()) {
|
||||
self.regs[rd] = val;
|
||||
} else {
|
||||
self.regs[rd] = self.regs[b];
|
||||
@@ -25,7 +25,7 @@ impl Vm {
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn dispatch_not(&mut self, rd: usize, a: usize) {
|
||||
let b = !coercion::to_boolean(self.regs[a], self.kernel.string_forge().as_ref());
|
||||
let b = !coercion::to_boolean(self.regs[a], self.kernel_core.string_forge().as_ref());
|
||||
self.regs[rd] = JsValue::bool(b);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user