-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added cfBlockEnter cfBlockExit to mark the enter and exit of a contro…
…l flow block (including if,loops,switch)
- Loading branch information
1 parent
4293fa1
commit 4007d05
Showing
5 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/ch.usi.inf.nodeprof/js/analysis/forinof/minitests.forinof.js.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
forObject@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:6:1:7:2) true { x: 'valueX', y: 'valueY' } | ||
iterationEnter@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:6:1:7:2) | ||
iterationExit@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:6:1:7:2) | ||
iterationEnter@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:6:1:7:2) | ||
iterationExit@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:6:1:7:2) | ||
forObjectPost@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:6:1:7:2) true | ||
forObject@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) false [ 41, 42, 43 ] | ||
iterationEnter@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) | ||
iterationExit@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) | ||
iterationEnter@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) | ||
iterationExit@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) | ||
iterationEnter@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) | ||
iterationExit@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) | ||
forObjectPost@ (src/ch.usi.inf.nodeprof.test/js/minitests/forinof.js:11:1:12:2) false |
26 changes: 26 additions & 0 deletions
26
src/ch.usi.inf.nodeprof/src/ch/usi/inf/nodeprof/handlers/CFBlockEventHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/******************************************************************************* | ||
* Copyright 2018 Dynamic Analysis Group, Università della Svizzera Italiana (USI) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*******************************************************************************/ | ||
package ch.usi.inf.nodeprof.handlers; | ||
|
||
import com.oracle.truffle.api.instrumentation.EventContext; | ||
|
||
import ch.usi.inf.nodeprof.ProfiledTagEnum; | ||
|
||
public abstract class CFBlockEventHandler extends BaseSingleTagEventHandler { | ||
public CFBlockEventHandler(EventContext context) { | ||
super(context, ProfiledTagEnum.CF_BLOCK); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/ch.usi.inf.nodeprof/src/ch/usi/inf/nodeprof/jalangi/factory/CFBlockFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/******************************************************************************* | ||
* Copyright 2018 Dynamic Analysis Group, Università della Svizzera Italiana (USI) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*******************************************************************************/ | ||
package ch.usi.inf.nodeprof.jalangi.factory; | ||
|
||
import com.oracle.truffle.api.frame.VirtualFrame; | ||
import com.oracle.truffle.api.instrumentation.EventContext; | ||
import com.oracle.truffle.api.nodes.DirectCallNode; | ||
import com.oracle.truffle.api.object.DynamicObject; | ||
|
||
import ch.usi.inf.nodeprof.handlers.BaseEventHandlerNode; | ||
import ch.usi.inf.nodeprof.handlers.CFBlockEventHandler; | ||
|
||
public class CFBlockFactory extends AbstractFactory { | ||
public CFBlockFactory(Object jalangiAnalysis, DynamicObject pre, DynamicObject post) { | ||
super("cfblock", jalangiAnalysis, pre, post, 1, 1); | ||
} | ||
|
||
@Override | ||
public BaseEventHandlerNode create(EventContext context) { | ||
return new CFBlockEventHandler(context) { | ||
@Child DirectCallNode preCall = createPreCallNode(); | ||
@Child DirectCallNode postCall = createPostCallNode(); | ||
|
||
@Override | ||
public void executePre(VirtualFrame frame, Object[] inputs) { | ||
if (pre != null) { | ||
setPreArguments(0, getSourceIID()); | ||
// TODO | ||
// add information about the type of the block (if, iteration, switch) | ||
directCall(preCall, true, getSourceIID()); | ||
} | ||
} | ||
|
||
@Override | ||
public void executePost(VirtualFrame frame, Object result, | ||
Object[] inputs) { | ||
if (post != null) { | ||
setPostArguments(0, getSourceIID()); | ||
// TODO | ||
// add information about the type of the block (if, iteration, switch) | ||
directCall(postCall, false, getSourceIID()); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
} |