Skip to content

Add abi offset#219

Merged
lightszero merged 48 commits intoneo-project:masterfrom
ShawnYun:add-abi-offset
Apr 26, 2020
Merged

Add abi offset#219
lightszero merged 48 commits intoneo-project:masterfrom
ShawnYun:add-abi-offset

Conversation

@ShawnYun
Copy link
Copy Markdown
Contributor

@ShawnYun ShawnYun commented Mar 24, 2020

close #207

  1. Modify the optimizer to record the method entry offset when optimizing code.
  2. Offset of method entry is added when generating abi file.
  3. Remove the auto-insert main method when generating abi file.

@lightszero @shargon @Tommo-L Could you help review the code?

@ShawnYun ShawnYun marked this pull request as ready for review March 24, 2020 08:00
@erikzhang erikzhang requested a review from lightszero March 24, 2020 08:28
@shargon shargon self-requested a review March 24, 2020 10:41
Copy link
Copy Markdown
Member

@lightszero lightszero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this codes make people confused,
we could do better.

we could let optimizer ouput a label addrConvTable.do not let optimizer to parse module direct.

@lightszero
Copy link
Copy Markdown
Member

lightszero commented Mar 24, 2020

@ShawnYun I just clear optimizer, check it please and continue.
I think we need a unittest for it too.

@lightszero
Copy link
Copy Markdown
Member

sorry addrconvtable has bug,only convert labels,I will fix it.

@ShawnYun
Copy link
Copy Markdown
Contributor Author

@lightszero Thanks, It's better now.

Tommo-L
Tommo-L previously approved these changes Mar 26, 2020
@shargon shargon mentioned this pull request Apr 23, 2020
Tommo-L
Tommo-L previously approved these changes Apr 24, 2020
Copy link
Copy Markdown
Contributor

@Tommo-L Tommo-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ready for review, @lightszero @shargon could help review it.

lightszero
lightszero previously approved these changes Apr 26, 2020
Copy link
Copy Markdown
Member

@lightszero lightszero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good for me,

but conflict by #253

please fix it

@ShawnYun ShawnYun dismissed stale reviews from lightszero and Tommo-L via 575c3d7 April 26, 2020 06:35
@ShawnYun
Copy link
Copy Markdown
Contributor Author

@lightszero Thanks, Have fixed it.

@lightszero lightszero merged commit 0c68a4f into neo-project:master Apr 26, 2020
return new byte[1] { (byte)value };
}
//[TestMethod]
//public void Test_Optimize_Recalculate_Positive_PUSHA()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these tests was removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/neo-project/neo-devpack-dotnet/pull/252/files#r415749579

This should not have been merged if it didn't work with the unit test, the solution is not to comment the code that doesn't work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shargon Sorry, I will restore them after I fix the Parser_DeleteDeadCode.

Jim8y pushed a commit that referenced this pull request Aug 3, 2025
* add abi offset
* fix
* clean optimizer
* Clean code
* Update NefOptimizeTool.cs
* fix GetAddrConvertTable bug,return all offsets now
* format
* format
* Clean code
* add abi-offset-unitTest
* Rename Contract_AbiOffset.cs to Contract_ABIOffset.cs
* fix
* Clean code
* Optimize
* Fix
* fix NDEBUG
* Fix NDEBUG
* modify abi offset uintTest
* add initializing static variables
* format
* format
* modify UTs
* fix and rename
* modify ContractTest
* format
* fix
* fix TestEngine and modify _initialize
* fix
* format
* fix void return
* Update Opcodes
* resolve review issues
* fix
* fix
* fix
Co-authored-by: lights <lightsever@hotmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Erik Zhang <erik@neo.org>
Jim8y pushed a commit that referenced this pull request Aug 18, 2025
* add abi offset

* fix

* clean optimizer

* Clean code

* Update NefOptimizeTool.cs

* fix GetAddrConvertTable bug,return all offsets now

* format

* format

* Clean code

* add abi-offset-unitTest

* Rename Contract_AbiOffset.cs to Contract_ABIOffset.cs

* fix

* Clean code

* Optimize

* Fix

* fix NDEBUG

* Fix NDEBUG

* modify abi offset uintTest

* add initializing static variables

* format

* format

* modify UTs

* fix and rename

* modify ContractTest

* format

* fix

* fix TestEngine and modify _initialize

* fix

* format

* fix void return

* Update Opcodes

* resolve review issues

* fix

* fix

* fix

Co-authored-by: lights <lightsever@hotmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Erik Zhang <erik@neo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjust abi and manifest file

7 participants