-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
1,150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
test/libyul/objectCompiler/eof/identical_subobjects_creation_deployed.yul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// All objects have identical unoptimized code, but at 200 runs the creation objects will optimized | ||
// differently from deployed objects. | ||
|
||
/// @use-src 0:"A.sol" | ||
object "A" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
let x := add(shl(255, 1), shl(127, not(0))) | ||
sstore(load(x), load(1)) | ||
} | ||
|
||
/// @use-src 0:"B.sol" | ||
object "B_deployed" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
let x := add(shl(255, 1), shl(127, not(0))) | ||
sstore(load(x), load(1)) | ||
} | ||
|
||
/// @use-src 0:"A.sol" | ||
object "A" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
let x := add(shl(255, 1), shl(127, not(0))) | ||
sstore(load(x), load(1)) | ||
} | ||
|
||
/// @use-src 0:"B.sol" | ||
object "B_deployed" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
let x := add(shl(255, 1), shl(127, not(0))) | ||
sstore(load(x), load(1)) | ||
} | ||
} | ||
|
||
/// @use-src 0:"C.sol" | ||
object "C" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
let x := add(shl(255, 1), shl(127, not(0))) | ||
sstore(load(x), load(1)) | ||
} | ||
} | ||
} | ||
} | ||
|
||
/// @use-src 0:"C.sol" | ||
object "C_deployed" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
let x := add(shl(255, 1), shl(127, not(0))) | ||
sstore(load(x), load(1)) | ||
} | ||
} | ||
|
||
/// @use-src 0:"D.sol" | ||
object "D" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
let x := add(shl(255, 1), shl(127, not(0))) | ||
sstore(load(x), load(1)) | ||
} | ||
} | ||
} | ||
// ==== | ||
// EVMVersion: >=constantinople | ||
// bytecodeFormat: >=EOFv1 | ||
// optimizationPreset: full | ||
// ---- | ||
// Assembly: | ||
// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) | ||
// stop | ||
// stop | ||
// | ||
// sub_0: assembly { | ||
// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) | ||
// stop | ||
// stop | ||
// | ||
// sub_0: assembly { | ||
// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) | ||
// stop | ||
// stop | ||
// | ||
// sub_0: assembly { | ||
// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) | ||
// stop | ||
// } | ||
// | ||
// sub_1: assembly { | ||
// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) | ||
// stop | ||
// } | ||
// } | ||
// } | ||
// | ||
// sub_1: assembly { | ||
// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) | ||
// stop | ||
// } | ||
// | ||
// sub_2: assembly { | ||
// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) | ||
// stop | ||
// } | ||
// Bytecode: ef0001010004020001001104000000008000046001356001607f1b600160ff1b03355500 | ||
// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP GT DIV STOP STOP STOP STOP DUP1 STOP DIV PUSH1 0x1 CALLDATALOAD PUSH1 0x1 PUSH1 0x7F SHL PUSH1 0x1 PUSH1 0xFF SHL SUB CALLDATALOAD SSTORE STOP | ||
// SourceMappings: :::-:0;;;;;;;;;;; |
116 changes: 116 additions & 0 deletions
116
test/libyul/objectCompiler/eof/identical_subobjects_full_debug_info.yul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// All objects have identical unoptimized code, but with different debug annotations. | ||
// The optimized Yul will be identical only between objects that have identical debug info. | ||
|
||
/// @use-src 0:"A.sol" | ||
object "A" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
/// @src 0:10:20 | ||
sstore(load(0), load(1)) | ||
} | ||
|
||
/// @use-src 0:"B.sol" | ||
object "B" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
/// @src 0:10:20 | ||
sstore(load(0), load(1)) | ||
} | ||
|
||
/// @use-src 0:"A.sol" | ||
object "A" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
/// @src 0:10:20 | ||
sstore(load(0), load(1)) | ||
} | ||
|
||
/// @use-src 0:"B.sol" | ||
object "B" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
/// @src 0:10:20 | ||
sstore(load(0), load(1)) | ||
} | ||
} | ||
|
||
/// @use-src 0:"C.sol" | ||
object "C" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
/// @src 0:10:20 | ||
sstore(load(0), load(1)) | ||
} | ||
} | ||
} | ||
} | ||
|
||
/// @use-src 0:"C.sol" | ||
object "C" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
/// @src 0:10:20 | ||
sstore(load(0), load(1)) | ||
} | ||
} | ||
|
||
/// @use-src 0:"D.sol" | ||
object "D" { | ||
code { | ||
function load(i) -> r { r := calldataload(i) } | ||
/// @src 0:10:20 | ||
sstore(load(0), load(1)) | ||
} | ||
} | ||
} | ||
// ==== | ||
// EVMVersion: >=shanghai | ||
// bytecodeFormat: >=EOFv1 | ||
// optimizationPreset: full | ||
// ---- | ||
// Assembly: | ||
// /* "A.sol":10:20 */ | ||
// sstore(calldataload(0x00), calldataload(0x01)) | ||
// stop | ||
// stop | ||
// | ||
// sub_0: assembly { | ||
// /* "B.sol":10:20 */ | ||
// sstore(calldataload(0x00), calldataload(0x01)) | ||
// stop | ||
// stop | ||
// | ||
// sub_0: assembly { | ||
// /* "A.sol":10:20 */ | ||
// sstore(calldataload(0x00), calldataload(0x01)) | ||
// stop | ||
// stop | ||
// | ||
// sub_0: assembly { | ||
// /* "B.sol":10:20 */ | ||
// sstore(calldataload(0x00), calldataload(0x01)) | ||
// stop | ||
// } | ||
// | ||
// sub_1: assembly { | ||
// /* "C.sol":10:20 */ | ||
// sstore(calldataload(0x00), calldataload(0x01)) | ||
// stop | ||
// } | ||
// } | ||
// } | ||
// | ||
// sub_1: assembly { | ||
// /* "C.sol":10:20 */ | ||
// sstore(calldataload(0x00), calldataload(0x01)) | ||
// stop | ||
// } | ||
// | ||
// sub_2: assembly { | ||
// /* "D.sol":10:20 */ | ||
// sstore(calldataload(0x00), calldataload(0x01)) | ||
// stop | ||
// } | ||
// Bytecode: ef0001010004020001000704000000008000026001355f355500 | ||
// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SMOD DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH1 0x1 CALLDATALOAD PUSH0 CALLDATALOAD SSTORE STOP | ||
// SourceMappings: 10:10::-:0;-1:-1;10:10;-1:-1;10:10;-1:-1 |
Oops, something went wrong.