Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/AdvancedInstrumentRootFactory.java @ 21951:9c8c0937da41
Moving all sources into truffle subdirectory
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Wed, 17 Jun 2015 10:58:08 +0200 |
parents | graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/AdvancedInstrumentRootFactory.java@28cbfacd0518 |
children | dc83cc1f94f2 |
comparison
equal
deleted
inserted
replaced
21950:2a5011c7e641 | 21951:9c8c0937da41 |
---|---|
1 /* | |
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. Oracle designates this | |
8 * particular file as subject to the "Classpath" exception as provided | |
9 * by Oracle in the LICENSE file that accompanied this code. | |
10 * | |
11 * This code is distributed in the hope that it will be useful, but WITHOUT | |
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 * version 2 for more details (a copy is included in the LICENSE file that | |
15 * accompanied this code). | |
16 * | |
17 * You should have received a copy of the GNU General Public License version | |
18 * 2 along with this work; if not, write to the Free Software Foundation, | |
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
20 * | |
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
22 * or visit www.oracle.com if you need additional information or have any | |
23 * questions. | |
24 */ | |
25 package com.oracle.truffle.api.instrument; | |
26 | |
27 import com.oracle.truffle.api.nodes.*; | |
28 | |
29 /** | |
30 * Creator of {@linkplain AdvancedInstrumentRoot AST fragments} suitable for efficient execution, | |
31 * subject to full Truffle optimization, by an | |
32 * {@linkplain Instrument#create(AdvancedInstrumentResultListener, AdvancedInstrumentRootFactory, Class, String) | |
33 * Advanced Instrument}. | |
34 * | |
35 * @see Instrument | |
36 * @see AdvancedInstrumentRoot | |
37 */ | |
38 public interface AdvancedInstrumentRootFactory { | |
39 | |
40 /** | |
41 * Provider of {@linkplain AdvancedInstrumentRoot AST fragment} instances to be executed by the | |
42 * Instrumentation Framework at a {@linkplain Probe Probed} site in a guest-language AST. | |
43 * <p> | |
44 * <strong>Notes:</strong> | |
45 * <ul> | |
46 * <li>Once the factory has produced an AST fragment at a particular {@linkplain Node AST Node}, | |
47 * it will not be called again at that Node.</li> | |
48 * <li>In some use cases, for example to implement a breakpoint at a specific program location, | |
49 * the Probe argument will be the same for every call. Each Node argument will represent the | |
50 * same program location associated with the Probe, but in different clones of the AST.</li> | |
51 * <li>In other use cases, for example to implement a breakpoint at any Node with a particular | |
52 * {@linkplain SyntaxTag tag}, both the Probe and Node argument may differ. Implementations that | |
53 * are sensitive to the lexical context in which the AST fragment will be evaluated must take | |
54 * care to build a new, possibly different AST fragment for each request.</li> | |
55 * </ul> | |
56 * | |
57 * @param probe the Probe to which the Instrument requesting the AST fragment is attached | |
58 * @param node the guest-language AST location that is the context in which the requesting | |
59 * Instrument must execute the AST fragment. | |
60 * @return a newly created AST fragment suitable for execution, via instrumentation, in the | |
61 * execution context of the specified guest-language AST site. | |
62 */ | |
63 AdvancedInstrumentRoot createInstrumentRoot(Probe probe, Node node); | |
64 } |