git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 2275e7c92d36229646a81cd7ee76f25234fc2a87

move private flag to the identitier

wanderer committed on 3/21/2018, 11:58:02 PM
Parent: b9423af2cd45a86722df9ab973b4db265a8fcaa3

Files changed

systemObjects.jschanged
wasmContainer.jschanged
systemObjects.jsView
@@ -38,9 +38,8 @@
3838
3939 class FunctionRef extends Serializable {
4040 constructor (opts) {
4141 super()
42- this.private = opts.private
4342 this.identifier = opts.identifier
4443 if (!(opts.id instanceof ID)) {
4544 opts.id = new ID(opts.id)
4645 }
@@ -50,9 +49,8 @@
5049 }
5150
5251 encodeCBOR (gen) {
5352 return gen.write(new cbor.Tagged(TAGS.func, [
54- this.private,
5553 this.identifier,
5654 this.params,
5755 this.destId
5856 ]))
@@ -71,10 +69,9 @@
7169 }
7270
7371 getFuncRef (name) {
7472 return new FunctionRef({
75- private: false,
76- identifier: name,
73+ identifier: [false, name],
7774 params: this.exports[name],
7875 id: this.id
7976 })
8077 }
wasmContainer.jsView
@@ -89,10 +89,9 @@
8989 return self.refs.add(object)
9090 } else {
9191 const params = self.json.types[self.json.indexes[func.name - FUNC_INDEX_OFFSET]].params
9292 const ref = new FunctionRef({
93- private: true,
94- identifier: func.tableIndex,
93+ identifier: [true, func.tableIndex],
9594 params,
9695 id: self.actor.id
9796 })
9897 return self.refs.add(ref, 'func')
@@ -231,12 +230,12 @@
231230 this.instance.exports.setter_globals(...refs)
232231 }
233232
234233 // call entrypoint function
235- if (funcRef.private) {
236- this.instance.exports.table.get(funcRef.identifier)(...args)
234+ if (funcRef.identifier[0]) {
235+ this.instance.exports.table.get(funcRef.identifier[1])(...args)
237236 } else {
238- this.instance.exports[funcRef.identifier](...args)
237+ this.instance.exports[funcRef.identifier[1]](...args)
239238 }
240239 await this.onDone()
241240
242241 // store globals

Built with git-ssb-web