mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into breaking
This commit is contained in:
@@ -60,10 +60,10 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test_bytes() ->
|
||||
// gas irOptimized: 373483
|
||||
// gas irOptimized: 371919
|
||||
// gas legacy: 418955
|
||||
// gas legacyOptimized: 326783
|
||||
// test_uint256() ->
|
||||
// gas irOptimized: 524664
|
||||
// gas irOptimized: 523001
|
||||
// gas legacy: 586784
|
||||
// gas legacyOptimized: 451529
|
||||
|
||||
@@ -26,6 +26,6 @@ contract C {
|
||||
// ----
|
||||
// library: L
|
||||
// f() -> 8, 7, 1, 2, 7, 12
|
||||
// gas irOptimized: 167446
|
||||
// gas irOptimized: 167696
|
||||
// gas legacy: 169347
|
||||
// gas legacyOptimized: 167269
|
||||
|
||||
@@ -61,10 +61,10 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test_bytes() ->
|
||||
// gas irOptimized: 373483
|
||||
// gas irOptimized: 371919
|
||||
// gas legacy: 418955
|
||||
// gas legacyOptimized: 326783
|
||||
// test_uint256() ->
|
||||
// gas irOptimized: 524664
|
||||
// gas irOptimized: 523001
|
||||
// gas legacy: 586784
|
||||
// gas legacyOptimized: 451529
|
||||
|
||||
@@ -53,6 +53,6 @@ contract C {
|
||||
// f2() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
|
||||
// f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
|
||||
// f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3
|
||||
// gas irOptimized: 113361
|
||||
// gas irOptimized: 113299
|
||||
// gas legacy: 114900
|
||||
// gas legacyOptimized: 112606
|
||||
|
||||
+1
-1
@@ -32,6 +32,6 @@ contract C is B {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 77
|
||||
// gas irOptimized: 119931
|
||||
// gas irOptimized: 119919
|
||||
// gas legacy: 155093
|
||||
// gas legacyOptimized: 111550
|
||||
|
||||
@@ -21,6 +21,6 @@ contract C {
|
||||
// f(uint256[][1]): 32, 32, 0 -> true
|
||||
// f(uint256[][1]): 32, 32, 1, 42 -> true
|
||||
// f(uint256[][1]): 32, 32, 8, 421, 422, 423, 424, 425, 426, 427, 428 -> true
|
||||
// gas irOptimized: 171964
|
||||
// gas irOptimized: 171842
|
||||
// gas legacy: 141644
|
||||
// gas legacyOptimized: 121532
|
||||
|
||||
@@ -19,10 +19,10 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324
|
||||
// gas irOptimized: 180925
|
||||
// gas irOptimized: 180931
|
||||
// gas legacy: 184929
|
||||
// gas legacyOptimized: 181504
|
||||
// i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224
|
||||
// gas irOptimized: 112535
|
||||
// gas irOptimized: 112539
|
||||
// gas legacy: 115468
|
||||
// gas legacyOptimized: 112988
|
||||
|
||||
@@ -14,7 +14,7 @@ contract Test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06
|
||||
// gas irOptimized: 189910
|
||||
// gas irOptimized: 189871
|
||||
// gas legacy: 211149
|
||||
// gas legacyOptimized: 206054
|
||||
// data(uint256,uint256): 0x02, 0x02 -> 0x09
|
||||
|
||||
@@ -15,7 +15,7 @@ contract c {
|
||||
// ----
|
||||
// getLength() -> 0
|
||||
// set(): 1, 2 -> true
|
||||
// gas irOptimized: 110433
|
||||
// gas irOptimized: 110439
|
||||
// gas legacy: 110726
|
||||
// gas legacyOptimized: 110567
|
||||
// getLength() -> 68
|
||||
|
||||
@@ -22,7 +22,7 @@ contract c {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// store(uint256[9],uint8[3][]): 21, 22, 23, 24, 25, 26, 27, 28, 29, 0x140, 4, 1, 2, 3, 11, 12, 13, 21, 22, 23, 31, 32, 33 -> 32
|
||||
// gas irOptimized: 650669
|
||||
// gas irOptimized: 650647
|
||||
// gas legacy: 694515
|
||||
// gas legacyOptimized: 694013
|
||||
// retrieve() -> 9, 28, 9, 28, 4, 3, 32
|
||||
|
||||
@@ -37,12 +37,12 @@ contract c {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 0x02000202
|
||||
// gas irOptimized: 4652092
|
||||
// gas irOptimized: 4652058
|
||||
// gas legacy: 4578341
|
||||
// gas legacyOptimized: 4548354
|
||||
// storageEmpty -> 1
|
||||
// clear() -> 0, 0
|
||||
// gas irOptimized: 4483169
|
||||
// gas irOptimized: 4483175
|
||||
// gas legacy: 4410769
|
||||
// gas legacyOptimized: 4382531
|
||||
// storageEmpty -> 1
|
||||
|
||||
@@ -17,7 +17,7 @@ contract c {
|
||||
// ----
|
||||
// setData1(uint256,uint256,uint256): 10, 5, 4 ->
|
||||
// copyStorageStorage() ->
|
||||
// gas irOptimized: 111426
|
||||
// gas irOptimized: 111406
|
||||
// gas legacy: 109278
|
||||
// gas legacyOptimized: 109268
|
||||
// getData2(uint256): 5 -> 10, 4
|
||||
|
||||
@@ -38,10 +38,10 @@ contract c {
|
||||
// compileViaYul: true
|
||||
// ----
|
||||
// test1(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 23, 42 -> 2, 65
|
||||
// gas irOptimized: 181308
|
||||
// gas irOptimized: 181298
|
||||
// test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65
|
||||
// gas irOptimized: 157901
|
||||
// gas irOptimized: 157936
|
||||
// test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65
|
||||
// gas irOptimized: 135108
|
||||
// gas irOptimized: 135098
|
||||
// test4(uint256[2][2]): 23, 42, 23, 42 -> 65
|
||||
// gas irOptimized: 111428
|
||||
// gas irOptimized: 111362
|
||||
|
||||
@@ -40,12 +40,12 @@ contract Test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 24
|
||||
// gas irOptimized: 227167
|
||||
// gas irOptimized: 227133
|
||||
// gas legacy: 227133
|
||||
// gas legacyOptimized: 226547
|
||||
// test1() -> 3
|
||||
// test2() -> 6
|
||||
// test3() -> 24
|
||||
// gas irOptimized: 133621
|
||||
// gas irOptimized: 133597
|
||||
// gas legacy: 134295
|
||||
// gas legacyOptimized: 133383
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// copyExternalStorageArrayOfFunctionType() -> true
|
||||
// gas irOptimized: 104701
|
||||
// gas irOptimized: 104669
|
||||
// gas legacy: 108725
|
||||
// gas legacyOptimized: 102441
|
||||
// copyInternalArrayOfFunctionType() -> true
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// copyExternalStorageArraysOfFunctionType() -> true
|
||||
// gas irOptimized: 104372
|
||||
// gas irOptimized: 104342
|
||||
// gas legacy: 108462
|
||||
// gas legacyOptimized: 102174
|
||||
// copyInternalArrayOfFunctionType() -> true
|
||||
|
||||
@@ -7,11 +7,11 @@ contract c {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(uint256): 1, 2 -> true
|
||||
// gas irOptimized: 110699
|
||||
// gas irOptimized: 110604
|
||||
// gas legacy: 111091
|
||||
// gas legacyOptimized: 110736
|
||||
// set(uint256): 2, 2, 3, 4, 5 -> true
|
||||
// gas irOptimized: 177659
|
||||
// gas irOptimized: 177564
|
||||
// gas legacy: 178021
|
||||
// gas legacyOptimized: 177666
|
||||
// storageEmpty -> 0
|
||||
|
||||
+2
-2
@@ -37,11 +37,11 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000
|
||||
// gas irOptimized: 179952
|
||||
// gas irOptimized: 179899
|
||||
// gas legacy: 180694
|
||||
// gas legacyOptimized: 180088
|
||||
// g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000
|
||||
// gas irOptimized: 107332
|
||||
// gas irOptimized: 107274
|
||||
// gas legacy: 107895
|
||||
// gas legacyOptimized: 107254
|
||||
// h() -> 0x40, 0x60, 0x00, 0x00
|
||||
|
||||
+1
-1
@@ -18,6 +18,6 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 7
|
||||
// gas irOptimized: 124080
|
||||
// gas irOptimized: 124041
|
||||
// gas legacy: 205196
|
||||
// gas legacyOptimized: 204987
|
||||
|
||||
@@ -9,7 +9,7 @@ contract c {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(): 1, 2, 3, 4, 5 -> true
|
||||
// gas irOptimized: 177417
|
||||
// gas irOptimized: 177390
|
||||
// gas legacy: 177656
|
||||
// gas legacyOptimized: 177496
|
||||
// storageEmpty -> 0
|
||||
|
||||
@@ -21,7 +21,7 @@ contract sender {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// (): 7 ->
|
||||
// gas irOptimized: 110941
|
||||
// gas irOptimized: 110954
|
||||
// gas legacy: 111082
|
||||
// gas legacyOptimized: 111027
|
||||
// val() -> 0
|
||||
|
||||
@@ -16,7 +16,7 @@ contract c {
|
||||
// ----
|
||||
// storageEmpty -> 1
|
||||
// fill() ->
|
||||
// gas irOptimized: 519848
|
||||
// gas irOptimized: 519886
|
||||
// gas legacy: 521773
|
||||
// gas legacyOptimized: 517048
|
||||
// storageEmpty -> 0
|
||||
|
||||
@@ -44,7 +44,7 @@ contract c {
|
||||
// ----
|
||||
// getLengths() -> 0, 0
|
||||
// setLengths(uint256,uint256): 48, 49 ->
|
||||
// gas irOptimized: 104355
|
||||
// gas irOptimized: 111304
|
||||
// gas legacy: 108571
|
||||
// gas legacyOptimized: 100417
|
||||
// getLengths() -> 48, 49
|
||||
|
||||
@@ -18,7 +18,7 @@ contract c {
|
||||
// ----
|
||||
// storageEmpty -> 1
|
||||
// fill() -> 8
|
||||
// gas irOptimized: 122528
|
||||
// gas irOptimized: 122534
|
||||
// gas legacy: 121756
|
||||
// gas legacyOptimized: 120687
|
||||
// storageEmpty -> 0
|
||||
|
||||
@@ -13,7 +13,7 @@ contract c {
|
||||
// ----
|
||||
// storageEmpty -> 1
|
||||
// fill() ->
|
||||
// gas irOptimized: 465585
|
||||
// gas irOptimized: 465544
|
||||
// gas legacy: 471460
|
||||
// gas legacyOptimized: 467520
|
||||
// storageEmpty -> 0
|
||||
|
||||
@@ -21,6 +21,6 @@ contract B {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004
|
||||
// gas irOptimized: 130097
|
||||
// gas irOptimized: 130152
|
||||
// gas legacy: 234943
|
||||
// gas legacyOptimized: 132863
|
||||
|
||||
@@ -11,7 +11,7 @@ contract Creator {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): 1, 2, 3, 4 ->
|
||||
// gas irOptimized: 132278
|
||||
// gas irOptimized: 129908
|
||||
// gas legacy: 176789
|
||||
// gas legacyOptimized: 129585
|
||||
// r() -> 4
|
||||
|
||||
@@ -45,6 +45,6 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 5, 6, 7
|
||||
// gas irOptimized: 290947
|
||||
// gas irOptimized: 298983
|
||||
// gas legacy: 452172
|
||||
// gas legacyOptimized: 285017
|
||||
|
||||
@@ -18,6 +18,6 @@ contract c {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test((uint16,uint16,uint16[3],uint16[])): 0x20, 2, 3, 0, 0, 4, 0xC0, 4, 0, 0, 5, 0, 0 -> 2, 3, 4, 5
|
||||
// gas irOptimized: 138785
|
||||
// gas irOptimized: 138732
|
||||
// gas legacy: 145150
|
||||
// gas legacyOptimized: 139171
|
||||
|
||||
@@ -29,14 +29,14 @@ contract C {
|
||||
// ----
|
||||
// l() -> 0
|
||||
// f(uint256,uint256): 42, 64 ->
|
||||
// gas irOptimized: 112555
|
||||
// gas irOptimized: 112528
|
||||
// gas legacy: 108234
|
||||
// gas legacyOptimized: 102245
|
||||
// l() -> 1
|
||||
// ll(uint256): 0 -> 43
|
||||
// a(uint256,uint256): 0, 42 -> 64
|
||||
// f(uint256,uint256): 84, 128 ->
|
||||
// gas irOptimized: 116427
|
||||
// gas irOptimized: 116400
|
||||
// gas legacy: 107780
|
||||
// gas legacyOptimized: 96331
|
||||
// l() -> 2
|
||||
|
||||
@@ -23,7 +23,7 @@ contract C {
|
||||
// ----
|
||||
// l() -> 0
|
||||
// g(uint256): 70 ->
|
||||
// gas irOptimized: 184507
|
||||
// gas irOptimized: 185936
|
||||
// gas legacy: 184991
|
||||
// gas legacyOptimized: 180608
|
||||
// l() -> 70
|
||||
|
||||
@@ -26,6 +26,6 @@ contract Main {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1
|
||||
// gas irOptimized: 113581
|
||||
// gas irOptimized: 113598
|
||||
// gas legacy: 126596
|
||||
// gas legacyOptimized: 113823
|
||||
|
||||
@@ -11,7 +11,7 @@ contract c {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// (): 1, 2, 3, 4, 5 ->
|
||||
// gas irOptimized: 155178
|
||||
// gas irOptimized: 155181
|
||||
// gas legacy: 155254
|
||||
// gas legacyOptimized: 155217
|
||||
// checkIfDataIsEmpty() -> false
|
||||
|
||||
@@ -26,6 +26,6 @@ contract Creator {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8
|
||||
// gas irOptimized: 456668
|
||||
// gas irOptimized: 443960
|
||||
// gas legacy: 590683
|
||||
// gas legacyOptimized: 448326
|
||||
|
||||
@@ -26,6 +26,6 @@ contract Creator {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
|
||||
// gas irOptimized: 308497
|
||||
// gas irOptimized: 300804
|
||||
// gas legacy: 428917
|
||||
// gas legacyOptimized: 298128
|
||||
|
||||
@@ -19,7 +19,7 @@ contract Main {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): "abc", true
|
||||
// gas irOptimized: 112563
|
||||
// gas irOptimized: 107175
|
||||
// gas legacy: 145838
|
||||
// gas legacyOptimized: 104017
|
||||
// getFlag() -> true
|
||||
|
||||
@@ -12,7 +12,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): 1, 2, 3, 4 ->
|
||||
// gas irOptimized: 180731
|
||||
// gas irOptimized: 174905
|
||||
// gas legacy: 221377
|
||||
// gas legacyOptimized: 177671
|
||||
// a() -> 1
|
||||
|
||||
@@ -15,5 +15,5 @@ contract B is A {
|
||||
// compileViaYul: true
|
||||
// ----
|
||||
// constructor() ->
|
||||
// gas irOptimized: 122233
|
||||
// gas irOptimized: 122017
|
||||
// y() -> 42
|
||||
|
||||
@@ -12,7 +12,7 @@ contract B is A {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor() ->
|
||||
// gas irOptimized: 122233
|
||||
// gas irOptimized: 122017
|
||||
// gas legacy: 135046
|
||||
// gas legacyOptimized: 116176
|
||||
// y() -> 42
|
||||
|
||||
@@ -23,7 +23,7 @@ contract D is B, C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): 2, 0 ->
|
||||
// gas irOptimized: 159542
|
||||
// gas irOptimized: 160166
|
||||
// gas legacy: 170665
|
||||
// gas legacyOptimized: 145396
|
||||
// i() -> 2
|
||||
|
||||
@@ -17,7 +17,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor() ->
|
||||
// gas irOptimized: 177344
|
||||
// gas irOptimized: 173672
|
||||
// gas legacy: 250376
|
||||
// gas legacyOptimized: 174522
|
||||
// deposit(bytes32), 18 wei: 0x1234 ->
|
||||
|
||||
@@ -76,7 +76,7 @@ contract FixedFeeRegistrar is Registrar {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 426283
|
||||
// gas irOptimized: 413485
|
||||
// gas legacy: 936897
|
||||
// gas legacyOptimized: 490983
|
||||
// reserve(string), 69 ether: 0x20, 3, "abc" ->
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Provides a set of functions to operate with Base64 strings.
|
||||
*/
|
||||
library InlineAsmBase64 {
|
||||
/**
|
||||
* @dev Base64 Encoding/Decoding Table
|
||||
*/
|
||||
string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
/**
|
||||
* @dev Converts a `bytes` to its Bytes64 `string` representation.
|
||||
*/
|
||||
function encode(bytes memory data) internal pure returns (string memory) {
|
||||
/**
|
||||
* Inspired by OpenZepplin Base64 implementation
|
||||
* https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2884/commits/157c32b65a15cb0b58257543643cafa1cebf883a
|
||||
*/
|
||||
if (data.length == 0) return "";
|
||||
|
||||
// Loads the table into memory
|
||||
string memory table = _TABLE;
|
||||
|
||||
// Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
|
||||
// and split into 4 numbers of 6 bits.
|
||||
// The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
|
||||
// - `data.length + 2` -> Round up
|
||||
// - `/ 3` -> Number of 3-bytes chunks
|
||||
// - `4 *` -> 4 characters for each chunk
|
||||
uint256 encodedLen = 4 * ((data.length + 2) / 3);
|
||||
|
||||
// Add some extra buffer at the end required for the writing
|
||||
string memory result = new string(encodedLen);
|
||||
|
||||
assembly {
|
||||
// Store the actual result length in memory
|
||||
mstore(result, encodedLen)
|
||||
|
||||
// Prepare the lookup table
|
||||
let tablePtr := add(table, 1)
|
||||
|
||||
// Prepare input pointer
|
||||
let dataPtr := data
|
||||
let endPtr := add(dataPtr, mload(data))
|
||||
|
||||
// Prepare result pointer, jump over length
|
||||
let resultPtr := add(result, 32)
|
||||
|
||||
// Run over the input, 3 bytes at a time
|
||||
for {
|
||||
|
||||
} lt(dataPtr, endPtr) {
|
||||
|
||||
} {
|
||||
// Advance 3 bytes
|
||||
dataPtr := add(dataPtr, 3)
|
||||
let input := mload(dataPtr)
|
||||
|
||||
// To write each character, shift the 3 bytes (24 bits) chunk 4
|
||||
// times in blocks of 6 bits for each character (18, 12, 6, 0)
|
||||
// and apply logical AND with 0x3F to extract the 6-bit group.
|
||||
// Add the 6-bit group with the table ptr to index into the
|
||||
// table and acquire the character to write. Finally, write
|
||||
// the character to the result pointer.
|
||||
|
||||
mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
|
||||
resultPtr := add(resultPtr, 1) // Advance
|
||||
|
||||
mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
|
||||
resultPtr := add(resultPtr, 1) // Advance
|
||||
|
||||
mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
|
||||
resultPtr := add(resultPtr, 1) // Advance
|
||||
|
||||
mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
|
||||
resultPtr := add(resultPtr, 1) // Advance
|
||||
}
|
||||
|
||||
// When data `bytes` is not exactly 3 bytes long
|
||||
// it is padded with `=` characters at the end
|
||||
switch mod(mload(data), 3)
|
||||
case 1 {
|
||||
mstore8(sub(resultPtr, 1), 0x3d)
|
||||
mstore8(sub(resultPtr, 2), 0x3d)
|
||||
}
|
||||
case 2 {
|
||||
mstore8(sub(resultPtr, 1), 0x3d)
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Provides a set of functions to operate with Base64 strings.
|
||||
*/
|
||||
library NoAsmBase64 {
|
||||
bytes private constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
function encode(bytes memory data) internal pure returns (string memory) {
|
||||
if (data.length == 0) return "";
|
||||
|
||||
bytes memory table = TABLE;
|
||||
bytes memory result = new bytes(4 * ((data.length + 2) / 3));
|
||||
uint256 resultPtr = 0;
|
||||
|
||||
for (uint256 dataPtr = 0; dataPtr < data.length; dataPtr += 3) {
|
||||
uint24 chunk = ( (uint24(uint8(data[dataPtr + 0])) << 16))
|
||||
+ (dataPtr + 1 < data.length ? (uint24(uint8(data[dataPtr + 1])) << 8) : 0)
|
||||
+ (dataPtr + 2 < data.length ? (uint24(uint8(data[dataPtr + 2])) ) : 0);
|
||||
|
||||
result[resultPtr++] = table[uint8(chunk >> 18) & 0x3f];
|
||||
result[resultPtr++] = table[uint8(chunk >> 12) & 0x3f];
|
||||
result[resultPtr++] = table[uint8(chunk >> 6) & 0x3f];
|
||||
result[resultPtr++] = table[uint8(chunk ) & 0x3f];
|
||||
}
|
||||
|
||||
if (data.length % 3 == 1) {
|
||||
result[--resultPtr] = 0x3d;
|
||||
result[--resultPtr] = 0x3d;
|
||||
}
|
||||
else if (data.length % 3 == 2) {
|
||||
result[--resultPtr] = 0x3d;
|
||||
}
|
||||
|
||||
return (string(result));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
==== ExternalSource: _base64/base64_inline_asm.sol ====
|
||||
==== ExternalSource: _base64/base64_no_inline_asm.sol ====
|
||||
==== Source: base64.sol ====
|
||||
|
||||
import "_base64/base64_inline_asm.sol";
|
||||
import "_base64/base64_no_inline_asm.sol";
|
||||
|
||||
contract test {
|
||||
function encode_inline_asm(bytes memory data) external pure returns (string memory) {
|
||||
return InlineAsmBase64.encode(data);
|
||||
}
|
||||
|
||||
function encode_no_asm(bytes memory data) external pure returns (string memory) {
|
||||
return NoAsmBase64.encode(data);
|
||||
}
|
||||
|
||||
function encode_inline_asm_large() external {
|
||||
for (uint i = 0; i < 1000; i++) {
|
||||
InlineAsmBase64.encode("foo");
|
||||
}
|
||||
}
|
||||
|
||||
function encode_no_asm_large() external {
|
||||
for (uint i = 0; i < 1000; i++) {
|
||||
NoAsmBase64.encode("foo");
|
||||
}
|
||||
}
|
||||
}
|
||||
// Test cases derived from Base64 specification: RFC4648
|
||||
// https://datatracker.ietf.org/doc/html/rfc4648#section-10
|
||||
//
|
||||
// ====
|
||||
// EVMVersion: >=constantinople
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 450044
|
||||
// gas legacy: 766936
|
||||
// gas legacyOptimized: 543094
|
||||
// encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0
|
||||
// encode_inline_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg=="
|
||||
// encode_inline_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8="
|
||||
// encode_inline_asm(bytes): 0x20, 3, "foo" -> 0x20, 4, "Zm9v"
|
||||
// encode_inline_asm(bytes): 0x20, 4, "foob" -> 0x20, 8, "Zm9vYg=="
|
||||
// encode_inline_asm(bytes): 0x20, 5, "fooba" -> 0x20, 8, "Zm9vYmE="
|
||||
// encode_inline_asm(bytes): 0x20, 6, "foobar" -> 0x20, 8, "Zm9vYmFy"
|
||||
// encode_no_asm(bytes): 0x20, 0 -> 0x20, 0
|
||||
// encode_no_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg=="
|
||||
// encode_no_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8="
|
||||
// encode_no_asm(bytes): 0x20, 3, "foo" -> 0x20, 4, "Zm9v"
|
||||
// encode_no_asm(bytes): 0x20, 4, "foob" -> 0x20, 8, "Zm9vYg=="
|
||||
// encode_no_asm(bytes): 0x20, 5, "fooba" -> 0x20, 8, "Zm9vYmE="
|
||||
// encode_no_asm(bytes): 0x20, 6, "foobar" -> 0x20, 8, "Zm9vYmFy"
|
||||
// encode_inline_asm_large()
|
||||
// gas irOptimized: 1385047
|
||||
// gas legacy: 1658033
|
||||
// gas legacyOptimized: 1210033
|
||||
// encode_no_asm_large()
|
||||
// gas irOptimized: 3335101
|
||||
// gas legacy: 4801077
|
||||
// gas legacyOptimized: 2929077
|
||||
@@ -178,7 +178,7 @@ contract DepositContract is IDepositContract, ERC165 {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 1557137
|
||||
// gas irOptimized: 1543359
|
||||
// gas legacy: 2436584
|
||||
// gas legacyOptimized: 1776483
|
||||
// supportsInterface(bytes4): 0x0 -> 0
|
||||
@@ -186,27 +186,27 @@ contract DepositContract is IDepositContract, ERC165 {
|
||||
// supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id #
|
||||
// supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id #
|
||||
// get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e
|
||||
// gas irOptimized: 122169
|
||||
// gas irOptimized: 122135
|
||||
// gas legacy: 150465
|
||||
// gas legacyOptimized: 122798
|
||||
// get_deposit_count() -> 0x20, 8, 0 # TODO: check balance and logs after each deposit #
|
||||
// deposit(bytes,bytes,bytes,bytes32), 32 ether: 0 -> FAILURE # Empty input #
|
||||
// get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e
|
||||
// gas irOptimized: 122169
|
||||
// gas irOptimized: 122135
|
||||
// gas legacy: 150465
|
||||
// gas legacyOptimized: 122798
|
||||
// get_deposit_count() -> 0x20, 8, 0
|
||||
// deposit(bytes,bytes,bytes,bytes32), 1 ether: 0x80, 0xe0, 0x120, 0xaa4a8d0b7d9077248630f1a4701ae9764e42271d7f22b7838778411857fd349e, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0x00f50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8 -> # txhash: 0x7085c586686d666e8bb6e9477a0f0b09565b2060a11f1c4209d3a52295033832 #
|
||||
// ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0xf50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x08, 0xca9a3b00000000000000000000000000000000000000000000000000000000, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8, 0x08, 0x00
|
||||
// get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438
|
||||
// gas irOptimized: 122148
|
||||
// gas irOptimized: 122114
|
||||
// gas legacy: 150475
|
||||
// gas legacyOptimized: 122811
|
||||
// get_deposit_count() -> 0x20, 8, 0x0100000000000000000000000000000000000000000000000000000000000000
|
||||
// deposit(bytes,bytes,bytes,bytes32), 32 ether: 0x80, 0xe0, 0x120, 0xdbd986dc85ceb382708cf90a3500f500f0a393c5ece76963ac3ed72eccd2c301, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x00344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d -> # txhash: 0x404d8e109822ce448e68f45216c12cb051b784d068fbe98317ab8e50c58304ac #
|
||||
// ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x08, 0x40597307000000000000000000000000000000000000000000000000000000, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d, 0x08, 0x0100000000000000000000000000000000000000000000000000000000000000
|
||||
// get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee
|
||||
// gas irOptimized: 122148
|
||||
// gas irOptimized: 122114
|
||||
// gas legacy: 150475
|
||||
// gas legacyOptimized: 122811
|
||||
// get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000
|
||||
|
||||
@@ -50,7 +50,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 1924392
|
||||
// gas irOptimized: 1938339
|
||||
// gas legacy: 2480887
|
||||
// gas legacyOptimized: 1874490
|
||||
// div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328
|
||||
|
||||
@@ -50,7 +50,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 1778342
|
||||
// gas irOptimized: 1792108
|
||||
// gas legacy: 2250130
|
||||
// gas legacyOptimized: 1746528
|
||||
// div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328
|
||||
|
||||
@@ -35,7 +35,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 465357
|
||||
// gas irOptimized: 465789
|
||||
// gas legacy: 672749
|
||||
// gas legacyOptimized: 479606
|
||||
// prb_pi() -> 3141592656369545286
|
||||
|
||||
@@ -51,7 +51,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 702619
|
||||
// gas irOptimized: 707330
|
||||
// gas legacy: 1130761
|
||||
// gas legacyOptimized: 750416
|
||||
// toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0
|
||||
@@ -71,6 +71,6 @@ contract test {
|
||||
// gas legacy: 31621
|
||||
// gas legacyOptimized: 27914
|
||||
// benchmark(string,bytes32): 0x40, 0x0842021, 8, "solidity" -> 0x2020
|
||||
// gas irOptimized: 2040067
|
||||
// gas irOptimized: 2040045
|
||||
// gas legacy: 4381235
|
||||
// gas legacyOptimized: 2317529
|
||||
|
||||
@@ -17,7 +17,7 @@ contract D {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): 2 ->
|
||||
// gas irOptimized: 200295
|
||||
// gas irOptimized: 203967
|
||||
// gas legacy: 245842
|
||||
// gas legacyOptimized: 195676
|
||||
// f() -> 2
|
||||
|
||||
@@ -18,7 +18,7 @@ contract D {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): 2 ->
|
||||
// gas irOptimized: 200458
|
||||
// gas irOptimized: 204130
|
||||
// gas legacy: 246202
|
||||
// gas legacyOptimized: 195914
|
||||
// f() -> 2
|
||||
|
||||
@@ -25,7 +25,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 1 ether ->
|
||||
// gas irOptimized: 308423
|
||||
// gas irOptimized: 315341
|
||||
// gas legacy: 465314
|
||||
// gas legacyOptimized: 304481
|
||||
// f(uint256): 0 -> FAILURE
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ contract C {
|
||||
// revertStrings: debug
|
||||
// ----
|
||||
// constructor(), 1 ether ->
|
||||
// gas irOptimized: 448383
|
||||
// gas irOptimized: 452673
|
||||
// gas legacy: 834272
|
||||
// gas legacyOptimized: 510004
|
||||
// f(uint256): 0 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code"
|
||||
|
||||
@@ -18,7 +18,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 20 wei
|
||||
// gas irOptimized: 218775
|
||||
// gas irOptimized: 219285
|
||||
// gas legacy: 294569
|
||||
// gas legacyOptimized: 174699
|
||||
// f(uint256): 20 -> 1370859564726510389319704988634906228201275401179
|
||||
@@ -26,7 +26,7 @@ contract C {
|
||||
// f(uint256): 20 -> FAILURE
|
||||
// x() -> 1
|
||||
// stack(uint256): 1023 -> FAILURE
|
||||
// gas irOptimized: 296769
|
||||
// gas irOptimized: 314884
|
||||
// gas legacy: 483942
|
||||
// gas legacyOptimized: 298807
|
||||
// x() -> 1
|
||||
|
||||
@@ -41,7 +41,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 20 wei ->
|
||||
// gas irOptimized: 285350
|
||||
// gas irOptimized: 283040
|
||||
// gas legacy: 402654
|
||||
// gas legacyOptimized: 274470
|
||||
// sendAmount(uint256): 5 -> 5
|
||||
|
||||
@@ -40,7 +40,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 20 wei ->
|
||||
// gas irOptimized: 285350
|
||||
// gas irOptimized: 283040
|
||||
// gas legacy: 402654
|
||||
// gas legacyOptimized: 274470
|
||||
// sendAmount(uint256): 5 -> 5
|
||||
|
||||
@@ -20,7 +20,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(uint8,uint8,uint8,uint8,uint8): 1, 21, 22, 42, 43 -> 0, 0, 0, 0
|
||||
// gas irOptimized: 111896
|
||||
// gas irOptimized: 111929
|
||||
// gas legacy: 113806
|
||||
// gas legacyOptimized: 111781
|
||||
// get(uint8): 1 -> 21, 22, 42, 43
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
interface ShortReturn {
|
||||
function f() external pure returns (bytes32);
|
||||
}
|
||||
contract LongReturn {
|
||||
function f() external pure returns (uint[20] memory) {}
|
||||
}
|
||||
|
||||
contract Test {
|
||||
function test() public returns (uint) {
|
||||
LongReturn longReturn = new LongReturn();
|
||||
uint freeMemoryBefore;
|
||||
assembly {
|
||||
freeMemoryBefore := mload(0x40)
|
||||
}
|
||||
|
||||
ShortReturn(address(longReturn)).f();
|
||||
|
||||
uint freeMemoryAfter;
|
||||
|
||||
assembly {
|
||||
freeMemoryAfter := mload(0x40)
|
||||
}
|
||||
|
||||
return freeMemoryAfter - freeMemoryBefore;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// ----
|
||||
// test() -> 0x20
|
||||
// gas legacy: 131966
|
||||
@@ -0,0 +1,32 @@
|
||||
interface LongReturn {
|
||||
function f() external pure returns (uint[20] memory);
|
||||
}
|
||||
contract ShortReturn {
|
||||
function f() external pure returns (bytes32) {}
|
||||
}
|
||||
|
||||
contract Test {
|
||||
function test() public returns (uint) {
|
||||
ShortReturn shortReturn = new ShortReturn();
|
||||
uint freeMemoryBefore;
|
||||
assembly {
|
||||
freeMemoryBefore := mload(0x40)
|
||||
}
|
||||
|
||||
LongReturn(address(shortReturn)).f();
|
||||
|
||||
uint freeMemoryAfter;
|
||||
|
||||
assembly {
|
||||
freeMemoryAfter := mload(0x40)
|
||||
}
|
||||
|
||||
return freeMemoryAfter - freeMemoryBefore;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: <=homestead
|
||||
// compileViaYul: true
|
||||
// ----
|
||||
// test() -> 0x0500
|
||||
// gas legacy: 131966
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
interface LongReturn {
|
||||
function f() external pure returns (uint[20] memory);
|
||||
}
|
||||
contract ShortReturn {
|
||||
function f() external pure returns (bytes32) {}
|
||||
}
|
||||
|
||||
contract Test {
|
||||
function test() public returns (uint) {
|
||||
ShortReturn shortReturn = new ShortReturn();
|
||||
uint freeMemoryBefore;
|
||||
assembly {
|
||||
freeMemoryBefore := mload(0x40)
|
||||
}
|
||||
|
||||
// This reverts. The external call succeeds but ABI decoding fails due to the returned
|
||||
// `bytes32` being much shorter than the expected `uint[20]`.
|
||||
LongReturn(address(shortReturn)).f();
|
||||
|
||||
uint freeMemoryAfter;
|
||||
|
||||
assembly {
|
||||
freeMemoryAfter := mload(0x40)
|
||||
}
|
||||
|
||||
return freeMemoryAfter - freeMemoryBefore;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >homestead
|
||||
// compileViaYul: true
|
||||
// ----
|
||||
// test() -> FAILURE
|
||||
// gas legacy: 131966
|
||||
@@ -29,7 +29,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 3, 7, 5
|
||||
// gas irOptimized: 127387
|
||||
// gas irOptimized: 127347
|
||||
// gas legacy: 151334
|
||||
// gas legacyOptimized: 125166
|
||||
// x() -> 7
|
||||
|
||||
@@ -17,7 +17,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): 3 ->
|
||||
// gas irOptimized: 137184
|
||||
// gas irOptimized: 131042
|
||||
// gas legacy: 209361
|
||||
// gas legacyOptimized: 139324
|
||||
// f() -> 84, 23
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ contract B {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// g() -> 42
|
||||
// gas irOptimized: 111781
|
||||
// gas irOptimized: 111794
|
||||
// gas legacy: 185053
|
||||
// gas legacyOptimized: 114598
|
||||
|
||||
@@ -42,7 +42,7 @@ contract Main {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 22 wei ->
|
||||
// gas irOptimized: 288778
|
||||
// gas irOptimized: 284287
|
||||
// gas legacy: 402045
|
||||
// gas legacyOptimized: 266772
|
||||
// getFlag() -> true
|
||||
|
||||
@@ -18,7 +18,7 @@ contract ClientReceipt {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 2000 wei ->
|
||||
// gas irOptimized: 184076
|
||||
// gas irOptimized: 188162
|
||||
// gas legacy: 235195
|
||||
// gas legacyOptimized: 176766
|
||||
// balance -> 1500
|
||||
|
||||
@@ -25,6 +25,6 @@ contract Test {
|
||||
// ----
|
||||
// library: Lib
|
||||
// f() -> 4, 0x11
|
||||
// gas irOptimized: 115822
|
||||
// gas irOptimized: 115874
|
||||
// gas legacy: 135952
|
||||
// gas legacyOptimized: 119643
|
||||
|
||||
@@ -22,6 +22,6 @@ contract Test {
|
||||
// ----
|
||||
// library: Lib
|
||||
// f() -> 1, 0, 0x2a, 0x17, 0, 0x63
|
||||
// gas irOptimized: 119757
|
||||
// gas irOptimized: 119561
|
||||
// gas legacy: 124793
|
||||
// gas legacyOptimized: 119694
|
||||
|
||||
@@ -20,6 +20,6 @@ contract Test {
|
||||
// ----
|
||||
// library: Lib
|
||||
// f() -> 1, 0, 0x2a, 0x17, 0, 0x63
|
||||
// gas irOptimized: 120471
|
||||
// gas irOptimized: 120572
|
||||
// gas legacy: 125245
|
||||
// gas legacyOptimized: 120153
|
||||
|
||||
@@ -23,5 +23,5 @@ contract Test {
|
||||
// ----
|
||||
// library: Lib
|
||||
// f() -> 7, 8
|
||||
// gas irOptimized: 101869
|
||||
// gas irOptimized: 101820
|
||||
// gas legacy: 101504
|
||||
|
||||
@@ -22,6 +22,6 @@ contract A {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(), 10 ether -> 3007, 3008, 3009
|
||||
// gas irOptimized: 272947
|
||||
// gas irOptimized: 272413
|
||||
// gas legacy: 422501
|
||||
// gas legacyOptimized: 287472
|
||||
|
||||
@@ -14,7 +14,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 2 wei: 3 ->
|
||||
// gas irOptimized: 111723
|
||||
// gas irOptimized: 111699
|
||||
// gas legacy: 151416
|
||||
// gas legacyOptimized: 108388
|
||||
// state() -> 3
|
||||
|
||||
@@ -14,7 +14,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 119839
|
||||
// gas irOptimized: 115297
|
||||
// gas legacy: 155081
|
||||
// gas legacyOptimized: 107997
|
||||
// genesisHash() -> 0x3737373737373737373737373737373737373737373737373737373737373737
|
||||
|
||||
+1
-1
@@ -18,6 +18,6 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint32,(uint128,uint256[][2],uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 77, 1, 2, 88
|
||||
// gas irOptimized: 203397
|
||||
// gas irOptimized: 203312
|
||||
// gas legacy: 209194
|
||||
// gas legacyOptimized: 203583
|
||||
|
||||
@@ -25,6 +25,6 @@ contract CopyTest {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// run() -> 2, 23, 42
|
||||
// gas irOptimized: 193980
|
||||
// gas irOptimized: 194005
|
||||
// gas legacy: 186016
|
||||
// gas legacyOptimized: 184668
|
||||
|
||||
@@ -88,7 +88,7 @@ contract Test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test1() -> true
|
||||
// gas irOptimized: 150618
|
||||
// gas irOptimized: 150545
|
||||
// gas legacy: 150266
|
||||
// gas legacyOptimized: 149875
|
||||
// test2() -> true
|
||||
|
||||
@@ -69,7 +69,7 @@ contract Test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
||||
// gas irOptimized: 111179
|
||||
// gas irOptimized: 111432
|
||||
// gas legacy: 112999
|
||||
// gas legacyOptimized: 110881
|
||||
// store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
||||
|
||||
@@ -25,7 +25,7 @@ contract c {
|
||||
// ----
|
||||
// storageEmpty -> 1
|
||||
// set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true
|
||||
// gas irOptimized: 133752
|
||||
// gas irOptimized: 133728
|
||||
// gas legacy: 134436
|
||||
// gas legacyOptimized: 133879
|
||||
// test(uint256): 32 -> "3"
|
||||
|
||||
@@ -38,12 +38,12 @@ contract c {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(uint256): 7 -> true
|
||||
// gas irOptimized: 110119
|
||||
// gas irOptimized: 110051
|
||||
// gas legacy: 110616
|
||||
// gas legacyOptimized: 110006
|
||||
// retrieve(uint256): 7 -> 1, 3, 4, 2
|
||||
// copy(uint256,uint256): 7, 8 -> true
|
||||
// gas irOptimized: 118698
|
||||
// gas irOptimized: 118597
|
||||
// gas legacy: 119166
|
||||
// gas legacyOptimized: 118622
|
||||
// retrieve(uint256): 7 -> 1, 3, 4, 2
|
||||
|
||||
@@ -33,4 +33,4 @@ contract C {
|
||||
// compileViaYul: true
|
||||
// ----
|
||||
// f() -> 0, 0, 0
|
||||
// gas irOptimized: 117289
|
||||
// gas irOptimized: 117403
|
||||
|
||||
@@ -44,7 +44,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() ->
|
||||
// gas irOptimized: 121618
|
||||
// gas irOptimized: 121624
|
||||
// gas legacy: 122132
|
||||
// gas legacyOptimized: 121500
|
||||
// g() ->
|
||||
|
||||
@@ -32,7 +32,7 @@ contract test {
|
||||
// ----
|
||||
// check() -> false
|
||||
// set() ->
|
||||
// gas irOptimized: 134335
|
||||
// gas irOptimized: 134432
|
||||
// gas legacy: 135277
|
||||
// gas legacyOptimized: 134064
|
||||
// check() -> true
|
||||
|
||||
@@ -51,7 +51,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test_f() -> true
|
||||
// gas irOptimized: 122509
|
||||
// gas irOptimized: 122364
|
||||
// gas legacy: 126168
|
||||
// gas legacyOptimized: 123199
|
||||
// test_g() -> true
|
||||
|
||||
@@ -115,7 +115,7 @@ contract ERC20 {
|
||||
// ----
|
||||
// constructor()
|
||||
// ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14
|
||||
// gas irOptimized: 447831
|
||||
// gas irOptimized: 423885
|
||||
// gas legacy: 861559
|
||||
// gas legacyOptimized: 420959
|
||||
// totalSupply() -> 20
|
||||
|
||||
@@ -17,7 +17,7 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor() ->
|
||||
// gas irOptimized: 199687
|
||||
// gas irOptimized: 199723
|
||||
// gas legacy: 241124
|
||||
// gas legacyOptimized: 155549
|
||||
// initCode() -> 0x20, 0
|
||||
|
||||
@@ -36,6 +36,6 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(bytes): 0x20, 0x5, "abcde" -> 0
|
||||
// gas irOptimized: 240685
|
||||
// gas irOptimized: 240691
|
||||
// gas legacy: 240358
|
||||
// gas legacyOptimized: 239682
|
||||
|
||||
@@ -98,7 +98,7 @@ contract ERC20 {
|
||||
// ----
|
||||
// constructor()
|
||||
// ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14
|
||||
// gas irOptimized: 443295
|
||||
// gas irOptimized: 419330
|
||||
// gas legacy: 833310
|
||||
// gas legacyOptimized: 416135
|
||||
// totalSupply() -> 20
|
||||
|
||||
@@ -19,7 +19,7 @@ contract D {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 27 wei ->
|
||||
// gas irOptimized: 175261
|
||||
// gas irOptimized: 178933
|
||||
// gas legacy: 222977
|
||||
// gas legacyOptimized: 169779
|
||||
// f() -> 27
|
||||
|
||||
@@ -22,6 +22,6 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// g() -> 2, 6
|
||||
// gas irOptimized: 178835
|
||||
// gas irOptimized: 178812
|
||||
// gas legacy: 180762
|
||||
// gas legacyOptimized: 179481
|
||||
|
||||
@@ -42,6 +42,6 @@ contract D {
|
||||
// gas legacy: 98438801
|
||||
// gas legacyOptimized: 98438594
|
||||
// fpure() -> FAILURE
|
||||
// gas irOptimized: 98438626
|
||||
// gas irOptimized: 98438625
|
||||
// gas legacy: 98438801
|
||||
// gas legacyOptimized: 98438595
|
||||
|
||||
@@ -30,7 +30,7 @@ contract c {
|
||||
// x() -> 0, 0
|
||||
// y() -> 0, 0
|
||||
// set() ->
|
||||
// gas irOptimized: 109733
|
||||
// gas irOptimized: 109713
|
||||
// gas legacy: 109732
|
||||
// gas legacyOptimized: 109682
|
||||
// x() -> 1, 2
|
||||
|
||||
@@ -22,7 +22,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 20 wei ->
|
||||
// gas irOptimized: 185891
|
||||
// gas irOptimized: 192113
|
||||
// gas legacy: 265006
|
||||
// gas legacyOptimized: 182842
|
||||
// sendAmount(uint256): 5 -> 8
|
||||
|
||||
@@ -21,7 +21,7 @@ contract test {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(), 20 wei ->
|
||||
// gas irOptimized: 187835
|
||||
// gas irOptimized: 194261
|
||||
// gas legacy: 266728
|
||||
// gas legacyOptimized: 184762
|
||||
// sendAmount(uint256): 5 -> 8
|
||||
|
||||
@@ -28,7 +28,7 @@ contract C {
|
||||
// index(uint256): 10 -> true
|
||||
// index(uint256): 20 -> true
|
||||
// index(uint256): 0xFF -> true
|
||||
// gas irOptimized: 138441
|
||||
// gas irOptimized: 138410
|
||||
// gas legacy: 248854
|
||||
// gas legacyOptimized: 152638
|
||||
// accessIndex(uint256,int256): 10, 1 -> 2
|
||||
|
||||
@@ -23,6 +23,6 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() ->
|
||||
// gas irOptimized: 113142
|
||||
// gas irOptimized: 112998
|
||||
// gas legacy: 112937
|
||||
// gas legacyOptimized: 112608
|
||||
|
||||
Reference in New Issue
Block a user