Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Fix CALLs #264

Merged
merged 7 commits into from
May 28, 2018
Merged

Fix CALLs #264

merged 7 commits into from
May 28, 2018

Conversation

axic
Copy link
Member

@axic axic commented May 27, 2018

Closes #246 (replaces).

@axic
Copy link
Member Author

axic commented May 27, 2018

Commits regarding the "2300 call stipend" can be removed if ewasm/hera#219 is merged.

@axic axic force-pushed the callcall2 branch 3 times, most recently from 31cc133 to d753b23 Compare May 28, 2018 03:01
@axic
Copy link
Member Author

axic commented May 28, 2018

This passes with ewasm/hera#219.

@axic axic changed the title [WIP] Fix CALLs Fix CALLs May 28, 2018
@@ -281,7 +338,7 @@ function generateManifest (interfaceManifest, opts) {
(i64.store (i32.add (get_global $sp) (i32.const ${spOffset * 32 + 8 * 2})) (i64.const 0))`

if (!op.async) {
call += '(drop (call $bswap_m128 (i32.add (i32.const 32)(get_global $sp))))'
call += '(drop (i32.add (i32.const 32)(get_global $sp)))'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is useless, it is a no-op.

In the previous case bswap_m128 operates on memory, so it wasn't a no-op.

@@ -292,7 +349,7 @@ function generateManifest (interfaceManifest, opts) {
}

call += `)
(drop (call $bswap_m160 (i32.add (get_global $sp) (i32.const ${spOffset * 32}))))
(drop (i32.add (get_global $sp) (i32.const ${spOffset * 32})))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same applies here.

// add 2300 gas subsidy
// for now this only works if the gas is a 64-bit value
// TODO: use 256-bit arithmetic
/*
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this kept as a comment?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be relevant when we simplify the EEI and move the ugly gas logic here into evm2wasm

@lrettig lrettig merged commit 0561608 into master May 28, 2018
@lrettig lrettig deleted the callcall2 branch May 28, 2018 21:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants