final class com.oracle.truffle.js.builtins.commonjs.CommonJSResolution
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: com.oracle.truffle.js.builtins.commonjs.CommonJSResolution
super_class: java.lang.Object
{
private static final java.lang.String JS_EXT;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: ".js"
private static final java.lang.String JSON_EXT;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: ".json"
private static final java.lang.String NODE_EXT;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: ".node"
public static final java.lang.String INDEX_JS;
descriptor: Ljava/lang/String;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: "index.js"
private static final java.lang.String INDEX_JSON;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "index.json"
private static final java.lang.String INDEX_NODE;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "index.node"
public static final java.lang.String PACKAGE_JSON;
descriptor: Ljava/lang/String;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: "package.json"
private static final java.lang.String NODE_MODULES;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "node_modules"
public static final java.lang.String PACKAGE_JSON_MAIN_PROPERTY_NAME;
descriptor: Ljava/lang/String;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: "main"
public static final java.lang.String PACKAGE_JSON_TYPE_PROPERTY_NAME;
descriptor: Ljava/lang/String;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: "type"
public static final java.lang.String PACKAGE_JSON_MODULE_VALUE;
descriptor: Ljava/lang/String;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: "module"
private static final java.lang.String[] CORE_MODULES;
descriptor: [Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=0, args_size=0
0: bipush 34
anewarray java.lang.String
dup
iconst_0
ldc "assert"
aastore
dup
iconst_1
ldc "async_hooks"
aastore
dup
iconst_2
ldc "buffer"
aastore
dup
iconst_3
ldc "child_process"
aastore
dup
iconst_4
ldc "cluster"
aastore
dup
iconst_5
ldc "crypto"
aastore
dup
bipush 6
1: ldc "dgram"
aastore
dup
bipush 7
ldc "dns"
aastore
dup
bipush 8
ldc "domain"
aastore
dup
bipush 9
ldc "events"
aastore
dup
bipush 10
ldc "fs"
aastore
dup
bipush 11
ldc "http"
aastore
dup
bipush 12
ldc "http2"
aastore
dup
bipush 13
ldc "https"
aastore
dup
bipush 14
ldc "module"
aastore
dup
bipush 15
ldc "net"
aastore
dup
bipush 16
2: ldc "os"
aastore
dup
bipush 17
ldc "path"
aastore
dup
bipush 18
ldc "perf_hooks"
aastore
dup
bipush 19
ldc "punycode"
aastore
dup
bipush 20
ldc "querystring"
aastore
dup
bipush 21
ldc "readline"
aastore
dup
bipush 22
ldc "repl"
aastore
dup
bipush 23
3: ldc "stream"
aastore
dup
bipush 24
ldc "string_decoder"
aastore
dup
bipush 25
ldc "tls"
aastore
dup
bipush 26
ldc "trace_events"
aastore
dup
bipush 27
ldc "tty"
aastore
dup
bipush 28
ldc "url"
aastore
dup
bipush 29
ldc "util"
aastore
dup
bipush 30
4: ldc "v8"
aastore
dup
bipush 31
ldc "vm"
aastore
dup
bipush 32
ldc "worker_threads"
aastore
dup
bipush 33
ldc "zlib"
aastore
5: putstatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.CORE_MODULES:[Ljava/lang/String;
6: return
LocalVariableTable:
Start End Slot Name Signature
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/oracle/truffle/js/builtins/commonjs/CommonJSResolution;
static boolean isCoreModule(java.lang.String);
descriptor: (Ljava/lang/String;)Z
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: getstatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.CORE_MODULES:[Ljava/lang/String;
invokestatic java.util.Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
aload 0
invokeinterface java.util.List.contains:(Ljava/lang/Object;)Z
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 moduleIdentifier Ljava/lang/String;
MethodParameters:
Name Flags
moduleIdentifier
static java.lang.String getCurrentFileNameFromStack();
descriptor: ()Ljava/lang/String;
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=3, args_size=0
0: invokestatic com.oracle.truffle.api.Truffle.getRuntime:()Lcom/oracle/truffle/api/TruffleRuntime;
invokeinterface com.oracle.truffle.api.TruffleRuntime.getCallerFrame:()Lcom/oracle/truffle/api/frame/FrameInstance;
astore 0
start local 0 1: aload 0
ifnull 12
2: aconst_null
astore 1
start local 1 3: aload 0
invokeinterface com.oracle.truffle.api.frame.FrameInstance.getCallNode:()Lcom/oracle/truffle/api/nodes/Node;
ifnull 6
4: aload 0
invokeinterface com.oracle.truffle.api.frame.FrameInstance.getCallNode:()Lcom/oracle/truffle/api/nodes/Node;
invokevirtual com.oracle.truffle.api.nodes.Node.getEncapsulatingSourceSection:()Lcom/oracle/truffle/api/source/SourceSection;
astore 1
5: goto 9
6: StackMap locals: com.oracle.truffle.api.frame.FrameInstance com.oracle.truffle.api.source.SourceSection
StackMap stack:
aload 0
invokestatic com.oracle.truffle.js.runtime.builtins.JSFunction.getFrameRootNode:(Lcom/oracle/truffle/api/frame/FrameInstance;)Lcom/oracle/truffle/api/nodes/RootNode;
astore 2
start local 2 7: aload 2
ifnull 9
8: aload 2
invokevirtual com.oracle.truffle.api.nodes.RootNode.getEncapsulatingSourceSection:()Lcom/oracle/truffle/api/source/SourceSection;
astore 1
end local 2 9: StackMap locals:
StackMap stack:
aload 1
ifnull 12
aload 1
invokevirtual com.oracle.truffle.api.source.SourceSection.getSource:()Lcom/oracle/truffle/api/source/Source;
ifnull 12
10: aload 1
invokevirtual com.oracle.truffle.api.source.SourceSection.getSource:()Lcom/oracle/truffle/api/source/Source;
astore 2
start local 2 11: aload 2
invokevirtual com.oracle.truffle.api.source.Source.getPath:()Ljava/lang/String;
areturn
end local 2 end local 1 12: StackMap locals:
StackMap stack:
aconst_null
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
1 13 0 callerFrame Lcom/oracle/truffle/api/frame/FrameInstance;
3 12 1 encapsulatingSourceSection Lcom/oracle/truffle/api/source/SourceSection;
7 9 2 frameRootNode Lcom/oracle/truffle/api/nodes/RootNode;
11 12 2 source Lcom/oracle/truffle/api/source/Source;
static com.oracle.truffle.api.TruffleFile resolve(com.oracle.truffle.js.runtime.JSContext, java.lang.String, com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/js/runtime/JSContext;Ljava/lang/String;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x0008) ACC_STATIC
Code:
stack=5, locals=6, args_size=3
start local 0 start local 1 start local 2 0: ldc ""
aload 1
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 2
1: aconst_null
areturn
2: StackMap locals:
StackMap stack:
aload 0
invokevirtual com.oracle.truffle.js.runtime.JSContext.getRealm:()Lcom/oracle/truffle/js/runtime/JSRealm;
invokevirtual com.oracle.truffle.js.runtime.JSRealm.getEnv:()Lcom/oracle/truffle/api/TruffleLanguage$Env;
astore 3
start local 3 3: aload 2
astore 4
start local 4 4: aload 1
iconst_0
invokevirtual java.lang.String.charAt:(I)C
bipush 47
if_icmpne 6
5: aload 3
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.getFileSystemRootPath:(Lcom/oracle/truffle/api/TruffleLanguage$Env;)Lcom/oracle/truffle/api/TruffleFile;
astore 4
6: StackMap locals: com.oracle.truffle.api.TruffleLanguage$Env com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 1
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.isPathFileName:(Ljava/lang/String;)Z
ifeq 10
7: aload 0
aload 3
aload 3
aload 4
aload 1
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.joinPaths:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadAsFileOrDirectory:(Lcom/oracle/truffle/js/runtime/JSContext;Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
astore 5
start local 5 8: aload 5
ifnull 10
9: aload 5
areturn
end local 5 10: StackMap locals:
StackMap stack:
aload 0
aload 3
aload 1
aload 4
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadNodeModulesOrSelfReference:(Lcom/oracle/truffle/js/runtime/JSContext;Lcom/oracle/truffle/api/TruffleLanguage$Env;Ljava/lang/String;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 context Lcom/oracle/truffle/js/runtime/JSContext;
0 11 1 moduleIdentifier Ljava/lang/String;
0 11 2 entryPath Lcom/oracle/truffle/api/TruffleFile;
3 11 3 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
4 11 4 currentWorkingPath Lcom/oracle/truffle/api/TruffleFile;
8 10 5 module Lcom/oracle/truffle/api/TruffleFile;
RuntimeVisibleAnnotations:
com.oracle.truffle.api.CompilerDirectives$TruffleBoundary()
MethodParameters:
Name Flags
context
moduleIdentifier
entryPath
private static com.oracle.truffle.api.TruffleFile loadNodeModulesOrSelfReference(com.oracle.truffle.js.runtime.JSContext, com.oracle.truffle.api.TruffleLanguage$Env, java.lang.String, com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/js/runtime/JSContext;Lcom/oracle/truffle/api/TruffleLanguage$Env;Ljava/lang/String;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=5, locals=8, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 3
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.getNodeModulesPaths:(Lcom/oracle/truffle/api/TruffleFile;)Ljava/util/List;
astore 4
start local 4 1: aload 4
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 6
goto 6
StackMap locals: com.oracle.truffle.js.runtime.JSContext com.oracle.truffle.api.TruffleLanguage$Env java.lang.String com.oracle.truffle.api.TruffleFile java.util.List top java.util.Iterator
StackMap stack:
2: aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast com.oracle.truffle.api.TruffleFile
astore 5
start local 5 3: aload 0
aload 1
aload 1
aload 5
aload 2
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.joinPaths:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadAsFileOrDirectory:(Lcom/oracle/truffle/js/runtime/JSContext;Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
astore 7
start local 7 4: aload 7
ifnull 6
5: aload 7
areturn
end local 7 end local 5 6: StackMap locals:
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 2
7: aconst_null
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 cx Lcom/oracle/truffle/js/runtime/JSContext;
0 8 1 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
0 8 2 moduleIdentifier Ljava/lang/String;
0 8 3 startFolder Lcom/oracle/truffle/api/TruffleFile;
1 8 4 nodeModulesPaths Ljava/util/List<Lcom/oracle/truffle/api/TruffleFile;>;
3 6 5 s Lcom/oracle/truffle/api/TruffleFile;
4 6 7 module Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
cx
env
moduleIdentifier
startFolder
public static com.oracle.truffle.api.TruffleFile loadIndex(com.oracle.truffle.api.TruffleLanguage$Env, com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=4, args_size=2
start local 0 start local 1 0: aload 0
aload 1
ldc "index.js"
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.joinPaths:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 2
start local 2 1: aload 2
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 3
2: aload 2
areturn
3: StackMap locals: com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 0
aload 1
ldc "index.json"
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.joinPaths:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 3
start local 3 4: aload 3
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 6
5: aload 3
areturn
6: StackMap locals: com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 0
aload 1
ldc "index.node"
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.joinPaths:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 8
7: aconst_null
areturn
8: StackMap locals:
StackMap stack:
aconst_null
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
0 9 1 modulePath Lcom/oracle/truffle/api/TruffleFile;
1 9 2 indexJs Lcom/oracle/truffle/api/TruffleFile;
4 9 3 indexJson Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
env
modulePath
static com.oracle.truffle.api.TruffleFile loadAsFile(com.oracle.truffle.api.TruffleLanguage$Env, com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=4, args_size=2
start local 0 start local 1 0: aload 1
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 2
1: aload 1
areturn
2: StackMap locals:
StackMap stack:
aload 0
new java.lang.StringBuilder
dup
aload 1
invokevirtual com.oracle.truffle.api.TruffleFile.toString:()Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc ".js"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokevirtual com.oracle.truffle.api.TruffleLanguage$Env.getPublicTruffleFile:(Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 2
start local 2 3: aload 2
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 5
4: aload 2
areturn
5: StackMap locals: com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 0
new java.lang.StringBuilder
dup
aload 1
invokevirtual com.oracle.truffle.api.TruffleFile.toString:()Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc ".json"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokevirtual com.oracle.truffle.api.TruffleLanguage$Env.getPublicTruffleFile:(Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 3
start local 3 6: aload 3
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 8
7: aload 3
areturn
8: StackMap locals: com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 0
new java.lang.StringBuilder
dup
aload 1
invokevirtual com.oracle.truffle.api.TruffleFile.toString:()Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc ".node"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokevirtual com.oracle.truffle.api.TruffleLanguage$Env.getPublicTruffleFile:(Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 10
9: aconst_null
areturn
10: StackMap locals:
StackMap stack:
aconst_null
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
0 11 1 modulePath Lcom/oracle/truffle/api/TruffleFile;
3 11 2 moduleJs Lcom/oracle/truffle/api/TruffleFile;
6 11 3 moduleJson Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
env
modulePath
public static java.util.List<com.oracle.truffle.api.TruffleFile> getNodeModulesPaths(com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/api/TruffleFile;)Ljava/util/List;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=6, args_size=1
start local 0 0: new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 1
start local 1 1: aload 0
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.getAllParentPaths:(Lcom/oracle/truffle/api/TruffleFile;)Ljava/util/List;
astore 2
start local 2 2: aload 2
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 4
goto 9
StackMap locals: com.oracle.truffle.api.TruffleFile java.util.List java.util.List top java.util.Iterator
StackMap stack:
3: aload 4
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast com.oracle.truffle.api.TruffleFile
astore 3
start local 3 4: aload 3
ldc "node_modules"
invokevirtual com.oracle.truffle.api.TruffleFile.endsWith:(Ljava/lang/String;)Z
ifeq 7
5: aload 1
aload 3
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
6: goto 9
7: StackMap locals: com.oracle.truffle.api.TruffleFile java.util.List java.util.List com.oracle.truffle.api.TruffleFile java.util.Iterator
StackMap stack:
aload 3
ldc "node_modules"
invokevirtual com.oracle.truffle.api.TruffleFile.resolve:(Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 5
start local 5 8: aload 1
aload 5
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
end local 5 end local 3 9: StackMap locals: com.oracle.truffle.api.TruffleFile java.util.List java.util.List top java.util.Iterator
StackMap stack:
aload 4
invokeinterface java.util.Iterator.hasNext:()Z
ifne 3
10: aload 1
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 path Lcom/oracle/truffle/api/TruffleFile;
1 11 1 list Ljava/util/List<Lcom/oracle/truffle/api/TruffleFile;>;
2 11 2 paths Ljava/util/List<Lcom/oracle/truffle/api/TruffleFile;>;
4 9 3 p Lcom/oracle/truffle/api/TruffleFile;
8 9 5 truffleFile Lcom/oracle/truffle/api/TruffleFile;
Signature: (Lcom/oracle/truffle/api/TruffleFile;)Ljava/util/List<Lcom/oracle/truffle/api/TruffleFile;>;
MethodParameters:
Name Flags
path
private static com.oracle.truffle.api.TruffleFile loadAsFileOrDirectory(com.oracle.truffle.js.runtime.JSContext, com.oracle.truffle.api.TruffleLanguage$Env, com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/js/runtime/JSContext;Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 1
aload 2
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadAsFile:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
astore 3
start local 3 1: aload 3
ifnonnull 3
2: aload 0
aload 1
aload 2
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadAsDirectory:(Lcom/oracle/truffle/js/runtime/JSContext;Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
areturn
3: StackMap locals: com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 3
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 cx Lcom/oracle/truffle/js/runtime/JSContext;
0 4 1 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
0 4 2 modulePath Lcom/oracle/truffle/api/TruffleFile;
1 4 3 maybeFile Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
cx
env
modulePath
private static java.util.List<com.oracle.truffle.api.TruffleFile> getAllParentPaths(com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/api/TruffleFile;)Ljava/util/List;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=3, args_size=1
start local 0 0: new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 1
start local 1 1: aload 0
astore 2
start local 2 2: goto 5
3: StackMap locals: java.util.List com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 1
aload 2
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
4: aload 2
invokevirtual com.oracle.truffle.api.TruffleFile.getParent:()Lcom/oracle/truffle/api/TruffleFile;
astore 2
5: StackMap locals:
StackMap stack:
aload 2
ifnonnull 3
6: aload 1
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 from Lcom/oracle/truffle/api/TruffleFile;
1 7 1 paths Ljava/util/List<Lcom/oracle/truffle/api/TruffleFile;>;
2 7 2 p Lcom/oracle/truffle/api/TruffleFile;
Signature: (Lcom/oracle/truffle/api/TruffleFile;)Ljava/util/List<Lcom/oracle/truffle/api/TruffleFile;>;
MethodParameters:
Name Flags
from
private static com.oracle.truffle.api.TruffleFile loadAsDirectory(com.oracle.truffle.js.runtime.JSContext, com.oracle.truffle.api.TruffleLanguage$Env, com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/js/runtime/JSContext;Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=8, args_size=3
start local 0 start local 1 start local 2 0: aload 1
aload 2
ldc "package.json"
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.joinPaths:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 3
start local 3 1: aload 3
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 12
2: aload 3
aload 0
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadJsonObject:(Lcom/oracle/truffle/api/TruffleFile;Lcom/oracle/truffle/js/runtime/JSContext;)Lcom/oracle/truffle/api/object/DynamicObject;
astore 4
start local 4 3: aload 4
invokestatic com.oracle.truffle.js.runtime.objects.JSDynamicObject.isJSDynamicObject:(Ljava/lang/Object;)Z
ifeq 13
4: aload 4
ldc "main"
invokestatic com.oracle.truffle.js.runtime.objects.JSObject.get:(Lcom/oracle/truffle/api/object/DynamicObject;Ljava/lang/Object;)Ljava/lang/Object;
astore 5
start local 5 5: aload 5
invokestatic com.oracle.truffle.js.runtime.JSRuntime.isString:(Ljava/lang/Object;)Z
ifne 7
6: aload 1
aload 2
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadIndex:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
areturn
7: StackMap locals: com.oracle.truffle.api.TruffleFile com.oracle.truffle.api.object.DynamicObject java.lang.Object
StackMap stack:
aload 1
aload 2
aload 5
invokestatic com.oracle.truffle.js.runtime.JSRuntime.safeToString:(Ljava/lang/Object;)Ljava/lang/String;
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.joinPaths:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 6
start local 6 8: aload 1
aload 6
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadAsFile:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
astore 7
start local 7 9: aload 7
ifnull 11
10: aload 7
areturn
11: StackMap locals: com.oracle.truffle.api.TruffleFile com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 1
aload 6
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadIndex:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
areturn
end local 7 end local 6 end local 5 end local 4 12: StackMap locals: com.oracle.truffle.js.runtime.JSContext com.oracle.truffle.api.TruffleLanguage$Env com.oracle.truffle.api.TruffleFile com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 1
aload 2
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.loadIndex:(Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/TruffleFile;
areturn
13: StackMap locals:
StackMap stack:
aconst_null
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 cx Lcom/oracle/truffle/js/runtime/JSContext;
0 14 1 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
0 14 2 modulePath Lcom/oracle/truffle/api/TruffleFile;
1 14 3 packageJson Lcom/oracle/truffle/api/TruffleFile;
3 12 4 jsonObj Lcom/oracle/truffle/api/object/DynamicObject;
5 12 5 main Ljava/lang/Object;
8 12 6 module Lcom/oracle/truffle/api/TruffleFile;
9 12 7 asFile Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
cx
env
modulePath
public static com.oracle.truffle.api.object.DynamicObject loadJsonObject(com.oracle.truffle.api.TruffleFile, com.oracle.truffle.js.runtime.JSContext);
descriptor: (Lcom/oracle/truffle/api/TruffleFile;Lcom/oracle/truffle/js/runtime/JSContext;)Lcom/oracle/truffle/api/object/DynamicObject;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=6, locals=8, args_size=2
start local 0 start local 1 0: aload 0
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.fileExists:(Lcom/oracle/truffle/api/TruffleFile;)Z
ifeq 14
1: aconst_null
astore 2
start local 2 2: aload 1
invokevirtual com.oracle.truffle.js.runtime.JSContext.getRealm:()Lcom/oracle/truffle/js/runtime/JSRealm;
astore 3
start local 3 3: aload 0
invokevirtual com.oracle.truffle.api.TruffleFile.toString:()Ljava/lang/String;
aload 3
invokevirtual com.oracle.truffle.js.runtime.JSRealm.getEnv:()Lcom/oracle/truffle/api/TruffleLanguage$Env;
invokestatic com.oracle.truffle.js.builtins.GlobalBuiltins.resolveRelativeFilePath:(Ljava/lang/String;Lcom/oracle/truffle/api/TruffleLanguage$Env;)Lcom/oracle/truffle/api/TruffleFile;
astore 4
start local 4 4: aload 4
iconst_0
anewarray java.nio.file.LinkOption
invokevirtual com.oracle.truffle.api.TruffleFile.isRegularFile:([Ljava/nio/file/LinkOption;)Z
ifeq 6
5: aload 4
invokestatic com.oracle.truffle.js.builtins.commonjs.CommonJSResolution.sourceFromTruffleFile:(Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/source/Source;
astore 2
6: StackMap locals: com.oracle.truffle.api.source.Source com.oracle.truffle.js.runtime.JSRealm com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 2
ifnonnull 8
7: aconst_null
areturn
8: StackMap locals:
StackMap stack:
aload 3
invokevirtual com.oracle.truffle.js.runtime.JSRealm.getJsonParseFunctionObject:()Ljava/lang/Object;
checkcast com.oracle.truffle.api.object.DynamicObject
astore 5
start local 5 9: aload 2
invokevirtual com.oracle.truffle.api.source.Source.getCharacters:()Ljava/lang/CharSequence;
invokeinterface java.lang.CharSequence.toString:()Ljava/lang/String;
astore 6
start local 6 10: aload 5
aload 5
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 6
aastore
invokestatic com.oracle.truffle.js.runtime.JSArguments.create:(Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)[Ljava/lang/Object;
invokestatic com.oracle.truffle.js.runtime.builtins.JSFunction.call:([Ljava/lang/Object;)Ljava/lang/Object;
astore 7
start local 7 11: aload 7
invokestatic com.oracle.truffle.js.runtime.objects.JSDynamicObject.isJSDynamicObject:(Ljava/lang/Object;)Z
ifeq 14
12: aload 7
checkcast com.oracle.truffle.api.object.DynamicObject
13: areturn
end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 14: StackMap locals:
StackMap stack:
aconst_null
areturn
15: StackMap locals:
StackMap stack: java.lang.SecurityException
astore 2
start local 2 16: aload 2
invokestatic com.oracle.truffle.js.runtime.Errors.createErrorFromException:(Ljava/lang/Throwable;)Lcom/oracle/truffle/js/runtime/JSException;
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 17 0 jsonFile Lcom/oracle/truffle/api/TruffleFile;
0 17 1 context Lcom/oracle/truffle/js/runtime/JSContext;
2 14 2 source Lcom/oracle/truffle/api/source/Source;
3 14 3 realm Lcom/oracle/truffle/js/runtime/JSRealm;
4 14 4 file Lcom/oracle/truffle/api/TruffleFile;
9 14 5 parse Lcom/oracle/truffle/api/object/DynamicObject;
10 14 6 jsonString Ljava/lang/String;
11 14 7 jsonObj Ljava/lang/Object;
16 17 2 e Ljava/lang/SecurityException;
Exception table:
from to target type
0 7 15 Class java.lang.SecurityException
8 13 15 Class java.lang.SecurityException
MethodParameters:
Name Flags
jsonFile
context
private static com.oracle.truffle.api.source.Source sourceFromTruffleFile(com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/source/Source;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: ldc "js"
aload 0
invokestatic com.oracle.truffle.api.source.Source.newBuilder:(Ljava/lang/String;Lcom/oracle/truffle/api/TruffleFile;)Lcom/oracle/truffle/api/source/Source$SourceBuilder;
invokevirtual com.oracle.truffle.api.source.Source$SourceBuilder.build:()Lcom/oracle/truffle/api/source/Source;
1: areturn
2: StackMap locals:
StackMap stack: java.lang.Exception
pop
3: aconst_null
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 file Lcom/oracle/truffle/api/TruffleFile;
Exception table:
from to target type
0 1 2 Class java.io.IOException
0 1 2 Class java.lang.SecurityException
MethodParameters:
Name Flags
file
public static boolean fileExists(com.oracle.truffle.api.TruffleFile);
descriptor: (Lcom/oracle/truffle/api/TruffleFile;)Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
iconst_0
anewarray java.nio.file.LinkOption
invokevirtual com.oracle.truffle.api.TruffleFile.exists:([Ljava/nio/file/LinkOption;)Z
ifeq 1
aload 0
iconst_0
anewarray java.nio.file.LinkOption
invokevirtual com.oracle.truffle.api.TruffleFile.isRegularFile:([Ljava/nio/file/LinkOption;)Z
ifeq 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 modulePath Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
modulePath
private static boolean isPathFileName(java.lang.String);
descriptor: (Ljava/lang/String;)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
ldc "/"
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifne 1
aload 0
ldc "./"
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifne 1
aload 0
ldc "../"
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifne 1
iconst_0
ireturn
StackMap locals:
StackMap stack:
1: iconst_1
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 moduleIdentifier Ljava/lang/String;
MethodParameters:
Name Flags
moduleIdentifier
public static com.oracle.truffle.api.TruffleFile joinPaths(com.oracle.truffle.api.TruffleLanguage$Env, com.oracle.truffle.api.TruffleFile, java.lang.String);
descriptor: (Lcom/oracle/truffle/api/TruffleLanguage$Env;Lcom/oracle/truffle/api/TruffleFile;Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=6, args_size=3
start local 0 start local 1 start local 2 0: aload 1
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 0
invokevirtual com.oracle.truffle.api.TruffleLanguage$Env.getFileNameSeparator:()Ljava/lang/String;
astore 3
start local 3 2: aload 1
invokevirtual com.oracle.truffle.api.TruffleFile.normalize:()Lcom/oracle/truffle/api/TruffleFile;
invokevirtual com.oracle.truffle.api.TruffleFile.toString:()Ljava/lang/String;
astore 4
start local 4 3: aload 0
new java.lang.StringBuilder
dup
aload 4
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 3
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 2
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokevirtual com.oracle.truffle.api.TruffleLanguage$Env.getPublicTruffleFile:(Ljava/lang/String;)Lcom/oracle/truffle/api/TruffleFile;
astore 5
start local 5 4: aload 5
invokevirtual com.oracle.truffle.api.TruffleFile.normalize:()Lcom/oracle/truffle/api/TruffleFile;
areturn
end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
0 5 1 p1 Lcom/oracle/truffle/api/TruffleFile;
0 5 2 p2 Ljava/lang/String;
2 5 3 pathSeparator Ljava/lang/String;
3 5 4 pathName Ljava/lang/String;
4 5 5 truffleFile Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
env
p1
p2
private static com.oracle.truffle.api.TruffleFile getFileSystemRootPath(com.oracle.truffle.api.TruffleLanguage$Env);
descriptor: (Lcom/oracle/truffle/api/TruffleLanguage$Env;)Lcom/oracle/truffle/api/TruffleFile;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=1, locals=3, args_size=1
start local 0 0: aload 0
invokevirtual com.oracle.truffle.api.TruffleLanguage$Env.getCurrentWorkingDirectory:()Lcom/oracle/truffle/api/TruffleFile;
astore 1
start local 1 1: aload 1
astore 2
start local 2 2: goto 5
3: StackMap locals: com.oracle.truffle.api.TruffleFile com.oracle.truffle.api.TruffleFile
StackMap stack:
aload 1
astore 2
4: aload 1
invokevirtual com.oracle.truffle.api.TruffleFile.getParent:()Lcom/oracle/truffle/api/TruffleFile;
astore 1
5: StackMap locals:
StackMap stack:
aload 1
ifnonnull 3
6: aload 2
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 env Lcom/oracle/truffle/api/TruffleLanguage$Env;
1 7 1 root Lcom/oracle/truffle/api/TruffleFile;
2 7 2 last Lcom/oracle/truffle/api/TruffleFile;
MethodParameters:
Name Flags
env
}
SourceFile: "CommonJSResolution.java"
InnerClasses:
public abstract TruffleBoundary = com.oracle.truffle.api.CompilerDirectives$TruffleBoundary of com.oracle.truffle.api.CompilerDirectives
public final Env = com.oracle.truffle.api.TruffleLanguage$Env of com.oracle.truffle.api.TruffleLanguage
public SourceBuilder = com.oracle.truffle.api.source.Source$SourceBuilder of com.oracle.truffle.api.source.Source