~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to src/shell_sharedlib.js

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Capture the output of this into a variable, if you want
2
 
(function(FUNCTION_TABLE_OFFSET, globalScope) {
 
2
(function(FUNCTION_TABLE_OFFSET, parentModule) {
3
3
  var Module = {};
4
4
  var args = [];
5
5
  Module.arguments = [];
 
6
  Module.print = parentModule.print;
 
7
  Module.printErr = parentModule.printErr;
 
8
 
 
9
  Module.cleanups = [];
 
10
 
 
11
#if ASM_JS
 
12
  var H_BASE = 0;
 
13
  // Each module has its own stack
 
14
  var STACKTOP = parentModule['_malloc'](TOTAL_STACK);
 
15
  assert(STACKTOP % 8 == 0);
 
16
  var STACK_MAX = STACKTOP + TOTAL_STACK;
 
17
  Module.cleanups.push(function() {
 
18
    parentModule['_free'](STACKTOP); // XXX ensure exported
 
19
    parentModule['_free'](H_BASE);
 
20
  });
 
21
#endif
6
22
 
7
23
  {{BODY}}
8
24
 
10
26
 
11
27
  return Module;
12
28
});
 
29