forked from oracle/graal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent-r.test
More file actions
58 lines (58 loc) · 1.62 KB
/
agent-r.test
File metadata and controls
58 lines (58 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
> cat > ${TMP_DIR}/test.R
< cat('Ahoj', file=stderr())
> Rscript --agentscript=agent-r.R --experimental-options ${TMP_DIR}/test.R
Warning.*agentscript.*deprecated.*insight.*
R: Initializing GraalVM Insight script
R: Hooks are ready!
R: observed loading of.*test.R
Ahoj
> Rscript --insight=agent-r.R ${TMP_DIR}/test.R
R: Initializing GraalVM Insight script
R: Hooks are ready!
R: observed loading of.*test.R
Ahoj
> cat > ${TMP_DIR}/fib.R
< fib <- function(n) {
< if (n <= 2) return(1);
< n1 <- fib(n - 1)
< n2 <- fib(n - 2);
< return(n1 + n2);
< }
< cat(fib(6))
< cat('\n')
>[1] Rscript --jvm --insight=agent-histogram.js ${TMP_DIR}/fib.R
.*insight: Access to language 'js' is not permitted.
> Rscript --jvm --polyglot --insight=agent-histogram.js ${TMP_DIR}/fib.R
8
==== Histogram ====
15 calls to fib
3 calls to <repl wrapper>
2 calls to cat
2 calls to stdout
===================
> Rscript --polyglot --insight=agent-histogram.js ${TMP_DIR}/fib.R
8
==== Histogram ====
15 calls to fib
3 calls to <repl wrapper>
2 calls to cat
2 calls to stdout
===================
> cat > ${TMP_DIR}/test.js
< print('hi js!')
> polyglot --jvm --agentscript=agent-r.R --experimental-options ${TMP_DIR}/test.js
Warning.*agentscript.*deprecated.*insight.*
R: Initializing GraalVM Insight script
R: Hooks are ready!
R: observed loading of.*test.js
hi js!
> polyglot --jvm --insight=agent-r.R ${TMP_DIR}/test.js
R: Initializing GraalVM Insight script
R: Hooks are ready!
R: observed loading of.*test.js
hi js!
> polyglot --insight=agent-r.R ${TMP_DIR}/test.js
R: Initializing GraalVM Insight script
R: Hooks are ready!
R: observed loading of.*test.js
hi js!