Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/StandardTag.java @ 15779:8c34e2cc4add
Truffle/Instrumentation: significant reorganization of the instrumentation framework's implementation and connection to the runtime ExecutionContext, with some new features, including a Tag-based "trap" mechanisms.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Mon, 19 May 2014 17:14:36 -0700 |
parents | bb9473723904 |
children |
rev | line source |
---|---|
15605
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
1 /* |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
4 * |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
10 * |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
15 * accompanied this code). |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
16 * |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
20 * |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
23 * questions. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
24 */ |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
25 package com.oracle.truffle.api.instrument; |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
26 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
27 /** |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
28 * A somewhat language-agnostic set of phylum categories, suitable for conventional imperative |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
29 * languages, and is being developed incrementally. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
30 * <p> |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
31 * The need for alternative sets of tags is likely to arise, perhaps for other families of languages |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
32 * (for example for mostly expression-oriented languages) or even for specific languages. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
33 * <p> |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
34 * <strong>Disclaimer:</strong> experimental interface under development. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
35 * |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
36 * @see Probe |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
37 * @see Wrapper |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
38 */ |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
39 public enum StandardTag implements PhylumTag { |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
40 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
41 /** |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
42 * Marker for a variable assignment. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
43 */ |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
44 ASSIGNMENT("assignment", "a variable assignment"), |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
45 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
46 /** |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
47 * Marker for a call site. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
48 */ |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
49 CALL("call", "a method/procedure call site"), |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
50 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
51 /** |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
52 * Marker for a location where a guest language exception is about to be thrown. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
53 */ |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
54 THROW("throw", "creator of an exception"), |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
55 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
56 /** |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
57 * Marker for a location where ordinary "stepping" should halt. |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
58 */ |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
59 STATEMENT("statement", "basic unit of the language, suitable for \"stepping\" in a debugger"); |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
60 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
61 private final String name; |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
62 private final String description; |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
63 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
64 private StandardTag(String name, String description) { |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
65 this.name = name; |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
66 this.description = description; |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
67 } |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
68 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
69 public String getName() { |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
70 return name; |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
71 } |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
72 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
73 public String getDescription() { |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
74 return description; |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
75 } |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
76 |
bb9473723904
Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff
changeset
|
77 } |