forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidentical_subobjects_creation_deployed.yul
106 lines (99 loc) · 2.96 KB
/
identical_subobjects_creation_deployed.yul
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// 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
// optimizationPreset: full
// outputs: Assembly
// ----
// 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
// }