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

Rename tableBase/memoryBase to __table_base/__memory_base #7467

Merged
merged 1 commit into from Nov 8, 2018
Jump to file or symbol
Failed to load files and symbols.
+21 −15
Diff settings

Always

Just for now

Rename tableBase/memoryBase to __tableBase/__memoryBase

  • Loading branch information...
sbc100 committed Nov 8, 2018
commit 74ec83aec8227c55c1431411ceed15e3585ddff5
Copy path View file
@@ -16,6 +16,10 @@ full changeset diff at the end of each section.
Current Trunk
-------------
v1.38.17: 11/08/2018
--------------------
- Bumped version to pull in new version of fastcomp
v1.38.17: 11/07/2018
--------------------
- Minify wasm import and export names. This decreases JS and wasm size by
Copy path View file
@@ -1 +1 @@
"1.38.17"
"1.38.18"
Copy path View file
@@ -1369,7 +1369,8 @@ def create_basic_vars(exported_implemented_functions, forwarded_json, metadata):
if not (shared.Settings.WASM and shared.Settings.SIDE_MODULE):
basic_vars += ['gb', 'fb']
else:
basic_vars += ['memoryBase', 'tableBase'] # wasm side modules have a specific convention for these
# wasm side modules have a specific convention for these
basic_vars += ['__memory_base', '__table_base']
# See if we need ASYNCIFY functions
# We might not need them even if ASYNCIFY is enabled
Copy path View file
@@ -2456,11 +2456,11 @@ function integrateWasmJS() {
Module['wasmTable'] = env['table'];
}
if (!env['memoryBase']) {
env['memoryBase'] = Module['STATIC_BASE']; // tell the memory segments where to place themselves
if (!env['__memory_base']) {
env['__memory_base'] = Module['STATIC_BASE']; // tell the memory segments where to place themselves
}
if (!env['tableBase']) {
env['tableBase'] = 0; // table starts at 0 by default, in dynamic linking this will change
if (!env['__table_base']) {
env['__table_base'] = 0; // table starts at 0 by default, in dynamic linking this will change
}
// try the methods. each should return the exports if it succeeded
Copy path View file
@@ -170,19 +170,20 @@ function loadWebAssemblyModule(binary, loadAsync) {
for (var i = memoryStart; i < memoryStart + memorySize; ++i) HEAP8[i] = 0;
// prepare env imports
var env = Module['asmLibraryArg'];
// TODO: use only memoryBase and tableBase, need to update asm.js backend
// TODO: use only __memory_base and __table_base, need to update asm.js backend
var table = Module['wasmTable'];
var oldTableSize = table.length;
env['memoryBase'] = env['gb'] = memoryStart;
env['tableBase'] = env['fb'] = oldTableSize;
env['__memory_base'] = env['gb'] = memoryStart;
env['__table_base'] = env['fb'] = oldTableSize;
var originalTable = table;
table.grow(tableSize);
assert(table === originalTable);
// zero-initialize memory and table TODO: in some cases we can tell it is already zero initialized
for (var i = env['memoryBase']; i < env['memoryBase'] + memorySize; i++) {
// zero-initialize memory and table
// TODO: in some cases we can tell it is already zero initialized
for (var i = env['__memory_base']; i < env['__memory_base'] + memorySize; i++) {
HEAP8[i] = 0;
}
for (var i = env['tableBase']; i < env['tableBase'] + tableSize; i++) {
for (var i = env['__table_base']; i < env['__table_base'] + tableSize; i++) {
table.set(i, null);
}
// copy currently exported symbols so the new module can import them
@@ -275,10 +276,10 @@ function loadWebAssemblyModule(binary, loadAsync) {
#if EMULATE_FUNCTION_POINTER_CASTS
// it may be a function pointer
if (e.substr(0, 3) == 'fp$' && typeof instance.exports[e.substr(3)] === 'function') {
value = value + env['tableBase'];
value = value + env['__table_base'];
} else {
#endif
value = value + env['memoryBase'];
value = value + env['__memory_base'];
#if EMULATE_FUNCTION_POINTER_CASTS
}
#endif
Copy path View file
@@ -5,7 +5,7 @@
import os, shutil, logging
TAG = 'version_52'
TAG = 'version_53'
def needed(settings, shared, ports):
if not settings.WASM: return False
ProTip! Use n and p to navigate between commits in a pull request.