Skip to content

Commit

Permalink
Add Instruction and InstructionIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Aug 5, 2023
1 parent c2df31b commit b952db4
Show file tree
Hide file tree
Showing 7 changed files with 1,022 additions and 846 deletions.
4 changes: 2 additions & 2 deletions boa_engine/src/bytecompiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ impl<'ctx, 'host> ByteCompiler<'ctx, 'host> {
let index = self.next_opcode_location();
self.emit(
Opcode::JumpTable,
&[Operand::U32(count), Operand::U32(Self::DUMMY_ADDRESS)],
&[Operand::U32(Self::DUMMY_ADDRESS), Operand::U32(count)],
);
let default = Label { index: index + 4 };
let default = Label { index };
let mut labels = Vec::with_capacity(count as usize);
for i in 0..count {
labels.push(Label {
Expand Down
5 changes: 3 additions & 2 deletions boa_engine/src/vm/call_frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ impl CallFrame {
}

/// Indicates how a generator function that has been called/resumed should return.
#[derive(Copy, Clone, Debug, PartialEq, Default)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]
#[repr(u8)]
pub(crate) enum GeneratorResumeKind {
#[allow(missing_docs)]
pub enum GeneratorResumeKind {
#[default]
Normal = 0,
Throw,
Expand Down
Loading

0 comments on commit b952db4

Please sign in to comment.