use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class PropertyDescriptor method createJSON.
private static JSONObject createJSON(String name, RemoteObject value, Boolean writable, RemoteObject get, RemoteObject set, boolean configurable, boolean enumerable, Boolean wasThrown, Boolean isOwn, RemoteObject symbol) {
JSONObject json = new JSONObject();
json.put("name", name);
if (value != null && get == null) {
json.put("value", value.toJSON());
}
json.putOpt("writable", writable);
if (get != null) {
json.put("get", get.toJSON());
}
if (set != null) {
json.put("set", set.toJSON());
}
json.put("configurable", configurable);
json.put("enumerable", enumerable);
json.putOpt("wasThrown", wasThrown);
json.putOpt("isOwn", isOwn);
if (symbol != null) {
json.put("symbol", symbol.toJSON());
}
return json;
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class RuntimeCallFrame method toJSON.
JSONObject toJSON() {
JSONObject json = new JSONObject();
json.put("functionName", functionName);
json.put("scriptId", Integer.toString(scriptId));
json.put("url", url);
// 0-based in the protocol
json.put("lineNumber", line - 1);
// 0-based in the protocol
json.put("columnNumber", column - 1);
return json;
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class ScriptTypeProfile method toJSON.
public JSONObject toJSON() {
JSONObject json = new JSONObject();
json.put("scriptId", Integer.toString(scriptId));
json.put("url", url);
json.put("entries", TypeProfileEntry.toJSON(entries));
return json;
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class CustomPreview method createJSON.
private static JSONObject createJSON(DebugValue debugValue, DebugValue config, DebugValue headerValue, DebugValue bodyFunction, InspectorExecutionContext context) {
JSONObject json = new JSONObject();
json.put(HEADER, value2JSON(headerValue, context).toString());
if (bodyFunction != null) {
RemoteObject bodyFunctionRemote = context.getRemoteObjectsHandler().getRemote(bodyFunction);
RemoteObjectsHandler objectsHandler = context.getRemoteObjectsHandler();
objectsHandler.registerCustomPreviewBody(bodyFunctionRemote.getId(), bodyFunction);
if (config != null) {
// If there is an config object, register it for callFunctionOn() call.
String objectId = objectsHandler.getRemote(debugValue).getId();
objectsHandler.registerCustomPreviewConfig(objectId, config);
}
json.put(BODY_GETTER_ID, bodyFunctionRemote.getId());
}
return json;
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class FunctionCoverage method toJSON.
private JSONObject toJSON() {
JSONObject json = new JSONObject();
json.put("functionName", functionName);
json.put("ranges", CoverageRange.toJSON(ranges));
json.put("isBlockCoverage", isBlockCoverage);
return json;
}
Aggregations