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

forin/forof extension #48

Closed
wants to merge 3 commits into from
Closed

forin/forof extension #48

wants to merge 3 commits into from

Conversation

Haiyang-Sun
Copy link
Owner

  • added a new callback forObjectPost to mark the end of a forin or forof event

  • added cfBlockEnter and cfBlockExit to mark any enter and exit of a control flow block (i.e., if,iterations,switch).

@Haiyang-Sun Haiyang-Sun mentioned this pull request Sep 17, 2019
@alexjordan
Copy link
Collaborator

I'm getting a strange nesting of callbacks when testing this, e.g.:

forObject@ (/home/aljordan/work/graal-au/nodeprof/src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:8:1:10:2) true { x: 'valueX', y: 'valueY' }
write name=key, val=x
read name=key, val=x
write name=baz, val=x
iterationEnter@ (/home/aljordan/work/graal-au/nodeprof/src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:8:1:10:2) 0
iterationExit@ (/home/aljordan/work/graal-au/nodeprof/src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:8:1:10:2)
write name=key, val=y

cfBlockEnter is executed at the end of the block, immediately followed by cfBlockExit.

CF_COND(JSTags.ControlFlowBranchTag.class, 0), // to be checked
CF_BRANCH(JSTags.ControlFlowBlockTag.class, -1), // to be checked
CF_BRANCH(JSTags.ControlFlowBranchTag.class, -1), // to be checked
CF_BLOCK(JSTags.ControlFlowBlockTag.class, -1), // to be checked
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Haiyang-Sun to issue the callback at the right time, the -1 should be 0 here. I.e. we want to ignore the inputs to the block and issue the callback onEnter right away. (We don't have a use for the inputs, which I think are the statements, anyway.

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

Successfully merging this pull request may close these issues.

2 participants