Skip to content

Commit 538fd49

Browse files
committed
eof: Enable jumpdest remover optimiser for EOF.
1 parent 4f23c18 commit 538fd49

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

Diff for: libevmasm/Assembly.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@ std::map<u256, u256> const& Assembly::optimiseInternal(
832832
m_evmVersion
833833
}.optimise();
834834
}
835-
// TODO: verify this for EOF.
836-
if (_settings.runJumpdestRemover && !m_eofVersion.has_value())
835+
836+
if (_settings.runJumpdestRemover)
837837
{
838838
for (auto& codeSection: m_codeSections)
839839
{

Diff for: test/libyul/objectCompiler/eof/functions.yul

+1-5
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ object "a" {
4242
// calldataload
4343
// /* "source":91:128 */
4444
// rjumpi{tag_1}
45-
// /* "source":22:386 */
46-
// tag_2:
4745
// /* "source":151:153 */
4846
// 0x20
4947
// /* "source":148:149 */
@@ -58,8 +56,6 @@ object "a" {
5856
// code_section_1: assembly {
5957
// /* "source":217:294 */
6058
// rjumpi{tag_3}
61-
// /* "source":203:324 */
62-
// tag_4:
6359
// /* "source":312:314 */
6460
// 0x63
6561
// /* "source":173:324 */
@@ -81,4 +77,4 @@ object "a" {
8177
// }
8278
// Bytecode: ef000101000c020003001400090003040000000080000201010001008000025f35e300015f52602035e1000460205ff3e50002e100036063e46005e45f80fd
8379
// Opcodes: 0xEF STOP ADD ADD STOP 0xC MUL STOP SUB STOP EQ STOP MULMOD STOP SUB DIV STOP STOP STOP STOP DUP1 STOP MUL ADD ADD STOP ADD STOP DUP1 STOP MUL PUSH0 CALLDATALOAD CALLF 0x1 PUSH0 MSTORE PUSH1 0x20 CALLDATALOAD RJUMPI 0x4 PUSH1 0x20 PUSH0 RETURN JUMPF 0x2 RJUMPI 0x3 PUSH1 0x63 RETF PUSH1 0x5 RETF PUSH0 DUP1 REVERT
84-
// SourceMappings: 74:1:0:-:0;61:15;56:21::i;53:1::-;46:32;107:2;94:16;91:37;22:364;151:2;148:1;141:13;111:17;113:13::i217:77:0:-:0;203:121;312:2;173:151::o;234:60::-;257:1;275:5::o376:1:0:-:0;366:12;
80+
// SourceMappings: 74:1:0:-:0;61:15;56:21::i;53:1::-;46:32;107:2;94:16;91:37;151:2;148:1;141:13;111:17;113:13::i217:77:0:-:0;312:2;173:151::o;234:60::-;257:1;275:5::o376:1:0:-:0;366:12;

Diff for: test/libyul/objectCompiler/eof/verbatim_bug.yul

-6
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,20 @@ object "a" {
4444
// /* "source":133:225 */
4545
// eq
4646
// rjumpi{tag_1}
47-
// /* "source":108:406 */
48-
// tag_2:
4947
// /* "source":238:263 */
5048
// dup1
5149
// /* "source":243:247 */
5250
// 0x01
5351
// /* "source":238:263 */
5452
// eq
5553
// rjumpi{tag_3}
56-
// /* "source":108:406 */
57-
// tag_4:
5854
// /* "source":276:368 */
5955
// dup1
6056
// /* "source":281:285 */
6157
// 0x02
6258
// /* "source":276:368 */
6359
// eq
6460
// rjumpi{tag_5}
65-
// /* "source":108:406 */
66-
// tag_6:
6761
// /* "source":386:390 */
6862
// 0x03
6963
// /* "source":381:406 */

0 commit comments

Comments
 (0)