Skip to content
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

Reusing iids in src/js/runtime/analysis.js:A #3

Open
esbena opened this issue Dec 8, 2014 · 2 comments
Open

Reusing iids in src/js/runtime/analysis.js:A #3

esbena opened this issue Dec 8, 2014 · 2 comments

Comments

@esbena
Copy link
Contributor

esbena commented Dec 8, 2014

The implementation of A in src/js/runtime/analysis.js is a bit odd.
It uses the same iids for the calls to G, B and P:

    function A(iid, base, offset, op, isComputed) {
        var oprnd1 = G(iid, base, offset, isComputed, true, false);
        return function (oprnd2) {
            var val = B(iid, op, oprnd1, oprnd2, true, false);
            return P(iid, base, offset, val, isComputed, true);
        };
    }

It should use different iids in the style of M:

    function M(iid, base, offset, isConstructor, isComputed) {
        return function () {
            var f = G(iid + 2, base, offset, isComputed, false, true);
            return (lastComputedValue = invokeFun(iid, base, f, arguments, isConstructor, true));
        };
    }
@msridhar
Copy link
Contributor

msridhar commented May 8, 2015

@esbena is this still a problem?

@esbena
Copy link
Contributor Author

esbena commented May 9, 2015

It has been fixed partly? (see below excerpt from current source)

It is still surprising that the same iid will be used for different callbacks to the analysis. But at least analysis.js documents this now.

        // avoid iid collision: make sure that iid+2 has the same source map as iid (@todo)
        var oprnd1 = G(iid+2, base, offset, isComputed, true, false);
        return function (oprnd2) {
            // still possible to get iid collision with a mem operation
            var val = B(iid, op, oprnd1, oprnd2, false, true, false);
            return P(iid, base, offset, val, isComputed, true);
        };

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

No branches or pull requests

2 participants