Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM - Jump table #3120

Merged
merged 48 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5e05c82
Jump table
shargon Feb 6, 2024
4537325
Types
shargon Feb 6, 2024
4e9aead
Merge branch 'master' into vm-jumptable
shargon Feb 6, 2024
d12b011
Splice
shargon Feb 6, 2024
02c2aae
Merge branch 'vm-jumptable' of https://github.com/neo-project/neo int…
shargon Feb 6, 2024
23d4be4
revert partial
shargon Feb 6, 2024
2e41b1e
More control
shargon Feb 6, 2024
8f7809b
Remove attribute
shargon Feb 6, 2024
5ca380d
Merge branch 'master' into vm-jumptable
Jim8y Feb 7, 2024
957e1d2
ApplicationEngine logic
shargon Feb 7, 2024
9aa22c3
Merge branch 'vm-jumptable' of https://github.com/neo-project/neo int…
shargon Feb 7, 2024
8aa78dc
Merge branch 'master' into core-jumptable
shargon Feb 7, 2024
21d3e5d
Merge branch 'master' into core-jumptable
shargon Feb 8, 2024
6c2a9d1
Stack
shargon Feb 8, 2024
e0dd24b
Bitwisee
shargon Feb 8, 2024
8f9b160
clean using
shargon Feb 8, 2024
b72cb14
Numeric
shargon Feb 8, 2024
c8e69c3
Prepare
shargon Feb 8, 2024
f218d2a
AggressiveInlining
shargon Feb 8, 2024
d495868
one left
shargon Feb 8, 2024
c4fd26b
Compound
shargon Feb 8, 2024
101d158
Slot
shargon Feb 8, 2024
31d8246
Allow to override invalid opcode
shargon Feb 8, 2024
e3d79e1
Specify jumpTable according to block
shargon Feb 8, 2024
b0e8199
Fix syscall
shargon Feb 8, 2024
5a551da
Rename to UnloadContext
shargon Feb 8, 2024
87a1aee
Revert "Rename to UnloadContext"
shargon Feb 8, 2024
9f78ef1
Rename
shargon Feb 8, 2024
0546304
Merge branch 'master' into core-jumptable
shargon Feb 8, 2024
d5da406
Update JumpTable.Control.cs
Jim8y Feb 9, 2024
ecc1e35
Update src/Neo.VM/JumpTable/JumpTable.cs
shargon Feb 9, 2024
50fc4a2
Rename methods
shargon Feb 9, 2024
3204a68
Merge branch 'master' into core-jumptable
Jim8y Feb 11, 2024
4cbb548
Update src/Neo.VM/JumpTable/JumpTable.Push.cs
shargon Feb 11, 2024
1b9df1b
Merge branch 'master' into core-jumptable
shargon Feb 11, 2024
2435666
Update src/Neo.VM/ExecutionEngine.cs
shargon Feb 12, 2024
fea8fac
Update src/Neo.VM/ExecutionEngine.cs
shargon Feb 12, 2024
ff74455
Update src/Neo.VM/ExecutionEngine.cs
shargon Feb 12, 2024
68a9367
Update src/Neo/SmartContract/ApplicationEngine.cs
shargon Feb 12, 2024
1e86bf4
use internal
shargon Feb 13, 2024
cffab43
Allow previous constructor
shargon Feb 13, 2024
7d4836e
prevent new jumptTable if default
shargon Feb 13, 2024
d445a8d
Update src/Neo.VM/JumpTable/JumpTable.cs
shargon Feb 13, 2024
6a395e4
Merge branch 'master' into core-jumptable
Jim8y Feb 15, 2024
37df5ee
Merge branch 'master' into core-jumptable
Jim8y Feb 15, 2024
8d42a9d
Merge branch 'master' into core-jumptable
shargon Feb 16, 2024
f57186d
Merge branch 'master' into core-jumptable
vncoelho Feb 22, 2024
2af4f03
Merge branch 'master' into core-jumptable
shargon Feb 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,476 changes: 34 additions & 1,442 deletions src/Neo.VM/ExecutionEngine.cs

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions src/Neo.VM/JumpTable/JumpTable.Bitwisee.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// JumpTable.Bitwisee.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using System.Runtime.CompilerServices;

namespace Neo.VM
{
public partial class JumpTable
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void Invert(ExecutionEngine engine, Instruction instruction)
{
var x = engine.Pop().GetInteger();
engine.Push(~x);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void And(ExecutionEngine engine, Instruction instruction)
{
var x2 = engine.Pop().GetInteger();
var x1 = engine.Pop().GetInteger();
engine.Push(x1 & x2);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void Or(ExecutionEngine engine, Instruction instruction)
{
var x2 = engine.Pop().GetInteger();
var x1 = engine.Pop().GetInteger();
engine.Push(x1 | x2);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void XOr(ExecutionEngine engine, Instruction instruction)
{
var x2 = engine.Pop().GetInteger();
var x1 = engine.Pop().GetInteger();
engine.Push(x1 ^ x2);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void Equal(ExecutionEngine engine, Instruction instruction)
{
var x2 = engine.Pop();
var x1 = engine.Pop();
engine.Push(x1.Equals(x2, engine.Limits));
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual void NotEqual(ExecutionEngine engine, Instruction instruction)
{
var x2 = engine.Pop();
var x1 = engine.Pop();
engine.Push(!x1.Equals(x2, engine.Limits));
}
}
}
Loading
Loading