aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-15 18:21:34 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-16 10:59:16 -0700
commit6250b3223a24701fe62bd56d1dd3422d3a372570 (patch)
tree83b81865ca38cc3b3fabc2551b7ecb586c7ccb87 /src/modules.js
parenta3acbcd3f0ab9ea5d1f25df9ec9ea4a8ce44f556 (diff)
simplify and automate GetProcAddress logic, and move it out of GL emulation
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/modules.js b/src/modules.js
index 13561777..01f0d8ae 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -275,20 +275,15 @@ var Functions = {
},
// Mark a function as needing indexing. Python will coordinate them all
- getIndex: function(ident, doNotCreate, sig) {
- if (doNotCreate && !(ident in this.indexedFunctions)) {
- if (!Functions.getIndex.tentative) Functions.getIndex.tentative = {}; // only used by GL emulation; TODO: generalize when needed
- Functions.getIndex.tentative[ident] = 0;
- }
+ getIndex: function(ident, sig) {
var ret;
if (phase != 'post' && singlePhase) {
- if (!doNotCreate) this.indexedFunctions[ident] = 0; // tell python we need this indexized
ret = "'{{ FI_" + toNiceIdent(ident) + " }}'"; // something python will replace later
+ this.indexedFunctions[ident] = 0;
} else {
if (!singlePhase) return 'NO_INDEX'; // Should not index functions in post
ret = this.indexedFunctions[ident];
if (!ret) {
- if (doNotCreate) return '0';
ret = this.nextIndex;
this.nextIndex += 2; // Need to have indexes be even numbers, see |polymorph| test
this.indexedFunctions[ident] = ret;