Skip to content

Commit

Permalink
Merge branch 'master' into standardize-exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim8y authored Jul 29, 2024
2 parents 25afa01 + c2141e8 commit 3625988
Show file tree
Hide file tree
Showing 62 changed files with 2,875 additions and 1,074 deletions.
3 changes: 2 additions & 1 deletion src/Neo.VM/JumpTable/JumpTable.Compound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public virtual void NewMap(ExecutionEngine engine, Instruction instruction)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void Size(ExecutionEngine engine, Instruction instruction)
{
// TODO: we should be able to optimize by using peek instead of dup and pop
var x = engine.Pop();
switch (x)
{
Expand Down Expand Up @@ -410,7 +411,7 @@ public virtual void PickItem(ExecutionEngine engine, Instruction instruction)
/// </summary>
/// <param name="engine">The execution engine.</param>
/// <param name="instruction">The instruction being executed.</param>
/// <remarks>Pop 1, Push 1</remarks>
/// <remarks>Pop 2, Push 0</remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void Append(ExecutionEngine engine, Instruction instruction)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Neo.VM/JumpTable/JumpTable.Numeric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public virtual void Div(ExecutionEngine engine, Instruction instruction)
}

/// <summary>
/// Computes the result of raising a number to the specified power.
/// Computes the remainder after dividing a by b.
/// <see cref="OpCode.MOD"/>
/// </summary>
/// <param name="engine">The execution engine.</param>
Expand All @@ -170,7 +170,7 @@ public virtual void Mod(ExecutionEngine engine, Instruction instruction)
}

/// <summary>
/// Computes the square root of the specified integer.
/// Computes the result of raising a number to the specified power.
/// <see cref="OpCode.POW"/>
/// </summary>
/// <param name="engine">The execution engine.</param>
Expand All @@ -186,7 +186,7 @@ public virtual void Pow(ExecutionEngine engine, Instruction instruction)
}

/// <summary>
///
/// Returns the square root of a specified number.
/// <see cref="OpCode.SQRT"/>
/// </summary>
/// <param name="engine">The execution engine.</param>
Expand Down
1 change: 1 addition & 0 deletions src/Neo.VM/JumpTable/JumpTable.Splice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public virtual void Memcpy(ExecutionEngine engine, Instruction instruction)
Types.Buffer dst = engine.Pop<Types.Buffer>();
if (checked(di + count) > dst.Size)
throw new InvalidOperationException($"The value {count} is out of range.");
// TODO: check if we can optimize the memcpy by using peek instead of dup then pop
src.Slice(si, count).CopyTo(dst.InnerBuffer.Span[di..]);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Neo.VM/JumpTable/JumpTable.Stack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public virtual void Drop(ExecutionEngine engine, Instruction instruction)
}

/// <summary>
///
/// Removes the second-to-top stack item.
/// <see cref="OpCode.NIP"/>
/// </summary>
/// <param name="engine">The execution engine.</param>
Expand All @@ -59,7 +59,7 @@ public virtual void Nip(ExecutionEngine engine, Instruction instruction)
}

/// <summary>
/// Removes the nth item from the top of the evaluation stack.
/// Removes the n-th item from the top of the evaluation stack.
/// <see cref="OpCode.XDROP"/>
/// </summary>
/// <param name="engine">The execution engine.</param>
Expand Down
Loading

0 comments on commit 3625988

Please sign in to comment.