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

@LaszloLango LaszloLango added enhancement An improvement memory management Related to memory management or garbage collection jerry-port Related to the port API or the default port implementation labels Aug 2, 2016
#ifdef CONFIG_STORE_CONST_IN_ROM
#ifndef ICACHE_RODATA_ATTR
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

#endif /* !ICACHE_RODATA_ATTR */

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

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

Choose a reason for hiding this comment

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

Normally compilers store...

@slaff slaff force-pushed the feature/memory-optimization branch 2 times, most recently from 21a0dcd to a3b215d Compare August 2, 2016 19:36
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

Choose a reason for hiding this comment

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

The define could be added here :)

@slaff slaff force-pushed the feature/memory-optimization branch from a3b215d to 1430be7 Compare August 3, 2016 07:42
@slaff
Copy link
Contributor Author

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

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

You can change them to "

@zherczeg
Copy link
Member

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 Compare August 3, 2016 09:25
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 Compare August 3, 2016 09:54
@zherczeg
Copy link
Member

zherczeg commented Aug 3, 2016

Still LGTM

@LaszloLango
Copy link
Contributor

@slaff, thanks for the fixes. LGTM

@LaszloLango LaszloLango merged commit ce8abfb into jerryscript-project:master Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement jerry-port Related to the port API or the default port implementation memory management Related to memory management or garbage collection
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants