diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2023-12-31 17:56:30 -0800 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2023-12-31 17:56:30 -0800 |
commit | 72c54d3d6aefa7cd24501d6e8ee60350d7c73f5a (patch) | |
tree | 74c30ce6ca2358e4814fff00786bbce987591e4e /src/js.rs | |
parent | 38a3502c8478e66e19c6f85260fc4515ceea1d02 (diff) |
Add disassembler output to debug
Diffstat (limited to 'src/js.rs')
-rw-r--r-- | src/js.rs | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -24,6 +24,7 @@ use boa_interner::Sym; use ion_rs::SymbolTable; +use crate::disasm::print_disassembly; use crate::ion::IonValue; use crate::runtime::Function; use crate::runtime::OpCode; @@ -460,12 +461,12 @@ impl JsCompiler { }, Expression::Parenthesized(expr) => self.get_static_expression(expr.expression()), - + // TODO: Add static evaluation to these. - Expression::Assign(assignment) => None, + Expression::Assign(_) => None, Expression::Unary(_) => None, Expression::Update(_) => None, - Expression::Binary(binary) => None, + Expression::Binary(_) => None, Expression::BinaryInPrivate(_) => None, Expression::Conditional(_) => None, Expression::Call(_) => None, @@ -572,7 +573,6 @@ impl JsCompiler { }, PropertyAccessField::Expr(expr) => { self.compile_expression(expr); - todo!("cast to symbol") }, } let jump_found = self.push_ifeq2(); @@ -630,7 +630,7 @@ impl JsCompiler { } } } - + fn compile_statement(&mut self, statement: &Statement) { match statement { boa_ast::Statement::Block(block) => { @@ -768,6 +768,11 @@ impl JsCompiler { println!(); } println!(); + + println!("Disassembly"); + println!("--------"); + print_disassembly(&self.bytecode); + println!(); } pub fn compile_script(&mut self, script: Script) { |