Merge pull request #6063 from ethereum/stackCompressorBuiltin

Take builtin functions into account in the compilability checker.
This commit is contained in:
chriseth
2019-02-21 14:40:56 +01:00
committed by GitHub
10 changed files with 123 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
--strict-assembly --optimize
+1
View File
@@ -0,0 +1 @@
0
@@ -0,0 +1,17 @@
object "MyContract" {
code {
// this is the constructor.
// store the creator in the first storage slot
sstore(0, caller())
// now return the runtime code using the special functions
datacopy(0, dataoffset("Runtime"), datasize("Runtime"))
return(0, datasize("Runtime"))
}
object "Runtime" {
code {
// runtime - just return the creator
mstore(0, sload(0))
return(0, 0x20)
}
}
}
+65
View File
@@ -0,0 +1,65 @@
======= object_compiler/input.sol (EVM) =======
Pretty printed source:
object "MyContract" {
code {
sstore(0, caller())
let _3 := datasize("Runtime")
datacopy(0, dataoffset("Runtime"), _3)
return(0, _3)
}
object "Runtime" {
code {
mstore(0, sload(0))
return(0, 0x20)
}
}
}
Binary representation:
33600055600b806012600039806000f350fe60005460005260206000f3
Text representation:
/* "object_compiler/input.sol":128:136 */
caller
/* "object_compiler/input.sol":125:126 */
0x00
/* "object_compiler/input.sol":118:137 */
sstore
dataSize(sub_0)
/* "object_compiler/input.sol":240:259 */
dup1
dataOffset(sub_0)
/* "object_compiler/input.sol":125:126 */
0x00
/* "object_compiler/input.sol":205:260 */
codecopy
/* "object_compiler/input.sol":275:294 */
dup1
/* "object_compiler/input.sol":125:126 */
0x00
/* "object_compiler/input.sol":265:295 */
return
/* "object_compiler/input.sol":29:299 */
pop
stop
sub_0: assembly {
/* "object_compiler/input.sol":397:398 */
0x00
/* "object_compiler/input.sol":391:399 */
sload
/* "object_compiler/input.sol":397:398 */
0x00
/* "object_compiler/input.sol":381:400 */
mstore
/* "object_compiler/input.sol":417:421 */
0x20
/* "object_compiler/input.sol":397:398 */
0x00
/* "object_compiler/input.sol":407:422 */
return
}