diff --git a/crates/oxide_compiler/src/compiler.rs b/crates/oxide_compiler/src/compiler.rs
index 86d5c5ab..6081b813 100644
--- a/crates/oxide_compiler/src/compiler.rs
+++ b/crates/oxide_compiler/src/compiler.rs
@@ -1286,14 +1286,7 @@ impl Compiler {
}
pub(crate) fn count_statement(&self, stmt: &Statement, ctx: &mut CompileCtx) {
- match stmt {
- Statement::WhileStatement(_)
- | Statement::DoWhileStatement(_)
- | Statement::ForStatement(_)
- | Statement::ForInStatement(_)
- | Statement::ForOfStatement(_) => self.count_iteration_domain(stmt, ctx),
- _ => {}
- }
+ let _ = (stmt, ctx);
}
pub(crate) fn count_expression(&self, expr: &Expression, ctx: &mut CompileCtx) {
diff --git a/crates/oxide_compiler/src/shared/binding.rs b/crates/oxide_compiler/src/shared/binding.rs
index dc9dc440..426c849a 100644
--- a/crates/oxide_compiler/src/shared/binding.rs
+++ b/crates/oxide_compiler/src/shared/binding.rs
@@ -7,51 +7,6 @@ use oxide_parser::{
};
impl Compiler {
- pub(crate) fn count_binding_pattern(&self, pattern: &BindingPattern, ctx: &mut CompileCtx) {
- match pattern {
- BindingPattern::BindingIdentifier(_) => {
- ctx.alloc_reg();
- ctx.projected_pc += 1;
- }
- BindingPattern::ArrayPattern(ap) => {
- ctx.count_instr(); // FOR_OF_INIT
- for elem in &ap.elements {
- ctx.alloc_reg();
- ctx.count_instr(); // FOR_OF_DONE
- ctx.alloc_reg();
- ctx.count_instr(); // FOR_OF_NEXT
- if let Some(inner) = elem {
- self.count_binding_pattern(inner, ctx);
- }
- }
- if let Some(rest) = &ap.rest {
- self.count_rest_array(ctx);
- self.count_binding_pattern(&rest.argument, ctx);
- }
- ctx.count_instr(); // FOR_OF_CLOSE
- }
- BindingPattern::ObjectPattern(op) => {
- for prop in &op.properties {
- self.count_object_property_read_key(&prop.key, prop.computed, ctx);
- self.count_binding_pattern(&prop.value, ctx);
- }
- if let Some(rest) = &op.rest {
- ctx.alloc_reg();
- ctx.count_instr_with_ext(1); // REST_OBJECT + excluded-keys ext
- self.count_binding_pattern(&rest.argument, ctx);
- }
- }
- BindingPattern::AssignmentPattern(ap) => {
- ctx.count_load_const(); // undefined
- ctx.count_instr(); // STRICT_EQ
- ctx.count_jump(); // JMP_IF_FALSE
- self.count_expression(&ap.right, ctx);
- ctx.count_instr(); // LOAD_VAR default
- self.count_binding_pattern(&ap.left, ctx);
- }
- }
- }
-
pub(crate) fn count_rest_array(&self, ctx: &mut CompileCtx) {
ctx.alloc_reg(); // rest
ctx.count_instr(); // NEW_ARRAY
diff --git a/crates/oxide_compiler/src/stmt/iteration/do_while.rs b/crates/oxide_compiler/src/stmt/iteration/do_while.rs
index 4f30af69..4b24cb4a 100644
--- a/crates/oxide_compiler/src/stmt/iteration/do_while.rs
+++ b/crates/oxide_compiler/src/stmt/iteration/do_while.rs
@@ -2,17 +2,6 @@ use crate::compiler::{CompileCtx, Compiler, Label};
use oxide_parser::Statement;
impl Compiler {
- pub(crate) fn count_do_while_statement(&self, stmt: &oxide_parser::DoWhileStatement<'_>, ctx: &mut CompileCtx) {
- let id = ctx.next_label_id();
- let start_label = Label::DoWhileStart(id);
- let end_label = Label::DoWhileEnd(id);
- ctx.labels.label_map.insert(start_label, ctx.projected_pc);
- self.count_statement(&stmt.body, ctx);
- self.count_expression(&stmt.test, ctx);
- ctx.projected_pc += 1;
- ctx.labels.label_map.insert(end_label, ctx.projected_pc);
- }
-
pub(crate) fn emit_do_while_statement(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result