Skip to content

Move emscripten_stack_get_base/end into native code - #12615

Merged
sbc100 merged 3 commits into
masterfrom
stack_base_end_native
Oct 29, 2020
Merged

Move emscripten_stack_get_base/end into native code#12615
sbc100 merged 3 commits into
masterfrom
stack_base_end_native

Conversation

@sbc100

@sbc100 sbc100 commented Oct 27, 2020

Copy link
Copy Markdown
Collaborator

With this change, we no longer need any JavaScript variable to track the
state of the stack. The base and max as well as the current stack
pointer are all managed in native code.

The following JavaScript variable a no longer present in the library
code:

  • STACK_BASE -> emscripten_stack_get_base()
  • STACK_MAX -> emscripten_stack_get_end()
  • STACKTOP -> emscripten_stack_get_current()
  • TOTAL_STACK -> emscripten_stack_get_base() - emscripten_stack_get_end()

@sbc100
sbc100 force-pushed the stack_base_end_native branch 10 times, most recently from 548a284 to fd0326b Compare October 28, 2020 07:48
@sbc100 sbc100 changed the title WIP: Move emscripten_stack_get_base/end into native code Move emscripten_stack_get_base/end into native code Oct 28, 2020
@sbc100
sbc100 requested review from dschuff and kripken October 28, 2020 19:23
@sbc100
sbc100 force-pushed the stack_base_end_native branch from fd0326b to 7990a97 Compare October 28, 2020 20:21

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wow, nice work! lgtm modulo comments&questions

Comment thread emscripten.py
Comment thread src/library_pthread_stub.js Outdated
Comment thread src/memoryprofiler.js
Comment thread src/postamble.js Outdated
Comment thread system/include/emscripten/stack.h Outdated
Comment thread system/include/emscripten/stack.h Outdated
Comment thread system/lib/pthread/library_pthread.c
Comment thread tests/test_other.py Outdated
@sbc100
sbc100 changed the base branch from master to es_version_settings October 28, 2020 20:27
@sbc100
sbc100 force-pushed the stack_base_end_native branch from 7990a97 to 102d2b2 Compare October 28, 2020 20:47
@sbc100
sbc100 changed the base branch from es_version_settings to master October 28, 2020 20:59
@sbc100
sbc100 force-pushed the stack_base_end_native branch from 102d2b2 to 1b3d023 Compare October 28, 2020 22:47
Comment thread ChangeLog.md Outdated
Comment thread system/include/emscripten/stack.h
Comment thread system/lib/compiler-rt/stack_limits.S
Comment thread system/lib/libc/emscripten_scan_stack.c
With this change, we no longer need any JavaScript variable to track the
state of the stack.   The base and max as well as the current stack
pointer are all managed in native code.

The following JavaScript variable a no longer present in the library
code:
 STACK_BASE -> emscripten_stack_get_base()
 STACK_MAX -> emscripten_stack_get_end()
 STACKTOP -> emscripten_stack_get_current()
 TOTAL_STACK -> emscripten_stack_get_base() - emscripten_stack_get_end()
@sbc100
sbc100 force-pushed the stack_base_end_native branch from 1b3d023 to d089b12 Compare October 29, 2020 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants