Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $one for true in ASM instead of using data section #6186

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sway-core/src/asm_generation/fuel/fuel_asm_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ impl<'ir, 'eng> FuelAsmBuilder<'ir, 'eng> {
(VirtualRegister::Constant(ConstantRegister::Zero), None)
}

ConstantValue::Uint(1) if config_name.is_none() => {
ConstantValue::Uint(1) | ConstantValue::Bool(true) if config_name.is_none() => {
(VirtualRegister::Constant(ConstantRegister::One), None)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"typeArguments": null
},
"name": "BOOL",
"offset": 3416
"offset": 3392
},
{
"configurableType": {
Expand All @@ -16,7 +16,7 @@
"typeArguments": null
},
"name": "U8",
"offset": 3552
"offset": 3528
},
{
"configurableType": {
Expand All @@ -25,7 +25,7 @@
"typeArguments": null
},
"name": "ANOTHER_U8",
"offset": 3344
"offset": 3320
},
{
"configurableType": {
Expand All @@ -34,7 +34,7 @@
"typeArguments": null
},
"name": "U16",
"offset": 3496
"offset": 3472
},
{
"configurableType": {
Expand All @@ -43,7 +43,7 @@
"typeArguments": null
},
"name": "U32",
"offset": 3536
"offset": 3512
},
{
"configurableType": {
Expand All @@ -52,7 +52,7 @@
"typeArguments": null
},
"name": "U64",
"offset": 3544
"offset": 3520
},
{
"configurableType": {
Expand All @@ -61,7 +61,7 @@
"typeArguments": null
},
"name": "U256",
"offset": 3504
"offset": 3480
},
{
"configurableType": {
Expand All @@ -70,7 +70,7 @@
"typeArguments": null
},
"name": "B256",
"offset": 3384
"offset": 3360
},
{
"configurableType": {
Expand All @@ -79,7 +79,7 @@
"typeArguments": []
},
"name": "CONFIGURABLE_STRUCT",
"offset": 3456
"offset": 3432
},
{
"configurableType": {
Expand All @@ -88,7 +88,7 @@
"typeArguments": []
},
"name": "CONFIGURABLE_ENUM_A",
"offset": 3424
"offset": 3400
},
{
"configurableType": {
Expand All @@ -97,7 +97,7 @@
"typeArguments": []
},
"name": "CONFIGURABLE_ENUM_B",
"offset": 3440
"offset": 3416
},
{
"configurableType": {
Expand All @@ -106,7 +106,7 @@
"typeArguments": null
},
"name": "ARRAY_BOOL",
"offset": 3352
"offset": 3328
},
{
"configurableType": {
Expand All @@ -115,7 +115,7 @@
"typeArguments": null
},
"name": "ARRAY_U64",
"offset": 3360
"offset": 3336
},
{
"configurableType": {
Expand All @@ -124,7 +124,7 @@
"typeArguments": null
},
"name": "TUPLE_BOOL_U64",
"offset": 3480
"offset": 3456
},
{
"configurableType": {
Expand All @@ -133,7 +133,7 @@
"typeArguments": null
},
"name": "STR_4",
"offset": 3472
"offset": 3448
}
],
"functions": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"typeArguments": null
},
"name": "BOOL",
"offset": 6912
"offset": 6888
},
{
"configurableType": {
Expand All @@ -16,7 +16,7 @@
"typeArguments": null
},
"name": "U8",
"offset": 7048
"offset": 7024
},
{
"configurableType": {
Expand All @@ -25,7 +25,7 @@
"typeArguments": null
},
"name": "ANOTHER_U8",
"offset": 6840
"offset": 6816
},
{
"configurableType": {
Expand All @@ -34,7 +34,7 @@
"typeArguments": null
},
"name": "U16",
"offset": 6992
"offset": 6968
},
{
"configurableType": {
Expand All @@ -43,7 +43,7 @@
"typeArguments": null
},
"name": "U32",
"offset": 7032
"offset": 7008
},
{
"configurableType": {
Expand All @@ -52,7 +52,7 @@
"typeArguments": null
},
"name": "U64",
"offset": 7040
"offset": 7016
},
{
"configurableType": {
Expand All @@ -61,7 +61,7 @@
"typeArguments": null
},
"name": "U256",
"offset": 7000
"offset": 6976
},
{
"configurableType": {
Expand All @@ -70,7 +70,7 @@
"typeArguments": null
},
"name": "B256",
"offset": 6880
"offset": 6856
},
{
"configurableType": {
Expand All @@ -79,7 +79,7 @@
"typeArguments": []
},
"name": "CONFIGURABLE_STRUCT",
"offset": 6952
"offset": 6928
},
{
"configurableType": {
Expand All @@ -88,7 +88,7 @@
"typeArguments": []
},
"name": "CONFIGURABLE_ENUM_A",
"offset": 6920
"offset": 6896
},
{
"configurableType": {
Expand All @@ -97,7 +97,7 @@
"typeArguments": []
},
"name": "CONFIGURABLE_ENUM_B",
"offset": 6936
"offset": 6912
},
{
"configurableType": {
Expand All @@ -106,7 +106,7 @@
"typeArguments": null
},
"name": "ARRAY_BOOL",
"offset": 6848
"offset": 6824
},
{
"configurableType": {
Expand All @@ -115,7 +115,7 @@
"typeArguments": null
},
"name": "ARRAY_U64",
"offset": 6856
"offset": 6832
},
{
"configurableType": {
Expand All @@ -124,7 +124,7 @@
"typeArguments": null
},
"name": "TUPLE_BOOL_U64",
"offset": 6976
"offset": 6952
},
{
"configurableType": {
Expand All @@ -133,7 +133,7 @@
"typeArguments": null
},
"name": "STR_4",
"offset": 6968
"offset": 6944
}
],
"encoding": "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use abi_with_tuples::{MyContract, Location, Person};


#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x5175a6a984a6d8f92622afd3d987f5b778f5741c56d55ee5993cc368b9afee10;
const CONTRACT_ID = 0xfdc14550c8aee742cd556d0ab7f378b7be0d3b1e6e086c097352e94590d4ed02;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0x2435d33fbcdcaea63ea81348866a3d565a84cc90f68a18513b0cef78ee3faa03;
const CONTRACT_ID = 0xfc32e1cb0635642004594eb3503279b3f4aee3d0b0de0e1aa78dcd7de2389239;

fn main() -> bool {
let the_abi = abi(MyContract, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ script;
use basic_storage_abi::{BasicStorage, Quad};

#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x186c989267434c784f7785be57b0db0a490ec382bbf98a6108a840c63b99be99;
const CONTRACT_ID = 0x94db39f409a31b9f2ebcadeea44378e419208c20de90f5d8e1e33dc1523754cb;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0x9fd665bb5b0ff768013b7f9b08f76b762bdc7426b11d76bd023c53433e9d21ed;
const CONTRACT_ID = 0xb6abfeaffedeabec13b886013932f154f50d4d6a2c4cf7bc09dd7fd3063fec3e;

fn main() -> u64 {
let addr = abi(BasicStorage, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ script;
use storage_enum_abi::*;

#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xb54eb67f943fda15981308ef55b2cb2afe1ed5907c483d2d92d010ab39549644;
const CONTRACT_ID = 0xc601d11767195485a6654d566c67774134668863d8c797a8c69e8778fb1f89e9;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfd91339494a1600ffb24d90eb7b67582e11fee5936e01704fb17a5445eb3f47e;
const CONTRACT_ID = 0xad38274ba48598272b4e69191748178ac2747fd70d59b4e9d6b9fb6e3599ff07;

fn main() -> u64 {
let caller = abi(StorageEnum, CONTRACT_ID);
Expand Down
Loading