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

Initial RAM optimization for ESP8266 #1233

Merged

Conversation

@slaff
Copy link
Contributor

@slaff slaff commented Aug 2, 2016

by putting big constants into ROM, instead of residing in RAM.
Related to #1224.

JerryScript-DCO-1.0-Signed-off-by: Slavey Karadzhov slaff@attachix.com

#ifdef CONFIG_STORE_CONST_IN_ROM
#ifndef ICACHE_RODATA_ATTR
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
#endif
Copy link
Contributor

@LaszloLango LaszloLango Aug 2, 2016

#endif /* !ICACHE_RODATA_ATTR */

@slaff slaff force-pushed the feature/memory-optimization branch 2 times, most recently from 350a0dd to 5ab9da0 Aug 2, 2016
@LaszloLango
Copy link
Contributor

@LaszloLango LaszloLango commented Aug 2, 2016

LGTM

@@ -166,6 +166,15 @@
#endif /* CONFIG_ECMA_COMPACT_PROFILE */

/**
* Normally your compiler stores const(ant)s in ROM. Thus saving RAM.
Copy link
Member

@zherczeg zherczeg Aug 2, 2016

Normally compilers store...

@slaff slaff force-pushed the feature/memory-optimization branch 2 times, most recently from 21a0dcd to a3b215d Aug 2, 2016
ifneq ($(MFORCE32),)
# If your compiler supports the -mforce-l32 flag then
# uncomment the lines below to gain additional Kb free RAM
ESP_CFLAGS += -DCONFIG_STORE_CONST_IN_ROM
Copy link
Member

@zherczeg zherczeg Aug 3, 2016

The define could be added here :)

@slaff slaff force-pushed the feature/memory-optimization branch from a3b215d to 1430be7 Aug 3, 2016
@slaff
Copy link
Contributor Author

@slaff slaff commented Aug 3, 2016

@zherczeg I added the recommended changes.

ifneq ($(MFORCE32),)
# Your compiler supports the -mforce-l32 flag then
# contants can be placed in ROM to free additional RAM
ESP_CFLAGS += -DJERRY_CONST_DATA="__attribute__((aligned(4))) __attribute__((section(".irom.text")))"
Copy link
Contributor

@LaszloLango LaszloLango Aug 3, 2016

I'm not an expert of GNU make, but the double quote usage is a bit odd to me here. Are you sure this will work as expected? Shouldn't be escaped the quotes around .irom.text?

Copy link
Member

@zherczeg zherczeg Aug 3, 2016

You can change them to "

@zherczeg
Copy link
Member

@zherczeg zherczeg commented Aug 3, 2016

I like this patch much better. LGTM after Laszlo's comments are fixed.

@slaff slaff force-pushed the feature/memory-optimization branch from 1430be7 to 82bba0d Aug 3, 2016
by putting big constants into ROM, instead of residing in RAM.
Related to jerryscript-project#1224.

JerryScript-DCO-1.0-Signed-off-by: Slavey Karadzhov slaff@attachix.com
@slaff slaff force-pushed the feature/memory-optimization branch from 82bba0d to ce8abfb Aug 3, 2016
@zherczeg
Copy link
Member

@zherczeg zherczeg commented Aug 3, 2016

Still LGTM

@LaszloLango
Copy link
Contributor

@LaszloLango LaszloLango commented Aug 3, 2016

@slaff, thanks for the fixes. LGTM

@LaszloLango LaszloLango merged commit ce8abfb into jerryscript-project:master Aug 3, 2016
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants