Package org.apache.spark.util
Class IndylambdaScalaClosures
Object
org.apache.spark.util.IndylambdaScalaClosures
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
findAccessedFields
(SerializedLambda lambdaProxy, ClassLoader lambdaClassLoader, scala.collection.mutable.Map<Class<?>, scala.collection.mutable.Set<String>> accessedFields, scala.collection.mutable.Map<Class<?>, scala.collection.mutable.Set<String>> accessedAmmCmdFields, scala.collection.mutable.Map<Class<?>, Object> ammCmdInstances, boolean findTransitively) Scans an indylambda Scala closure, along with its lexically nested closures, and populate the accessed fields info on which fields on the outer object are accessed.static scala.Option<SerializedLambda>
getSerializationProxy
(Object maybeClosure) Check if the given reference is a indylambda style Scala closure.static SerializedLambda
static boolean
isIndylambdaScalaClosure
(SerializedLambda lambdaProxy) static boolean
isInnerClassCtorCapturingOuter
(int op, String owner, String name, String desc, String callerInternalName) Check if the callee of a call site is a inner class constructor.static boolean
isLambdaBodyCapturingOuter
(org.apache.xbean.asm9.Handle handle, String ownerInternalName) Check if the handle represents a target method that is: - a STATIC method that implements a Scala lambda body in the indylambda style - captures the enclosingthis
, i.e.static boolean
isLambdaMetafactory
(org.apache.xbean.asm9.Handle bsmHandle) Check if the handle represents the LambdaMetafactory that indylambda Scala closures use for creating the lambda class and getting a closure instance.static String
static String
static String
static org.apache.spark.internal.Logging.LogStringContext
LogStringContext
(scala.StringContext sc) static org.slf4j.Logger
static void
org$apache$spark$internal$Logging$$log__$eq
(org.slf4j.Logger x$1)
-
Constructor Details
-
IndylambdaScalaClosures
public IndylambdaScalaClosures()
-
-
Method Details
-
LambdaMetafactoryClassName
-
LambdaMetafactoryMethodName
-
LambdaMetafactoryMethodDesc
-
getSerializationProxy
Check if the given reference is a indylambda style Scala closure. If so (e.g. for Scala 2.12+ closures), return a non-empty serialization proxy (SerializedLambda) of the closure; otherwise (e.g. for Scala 2.11 closures) return None.- Parameters:
maybeClosure
- the closure to check.- Returns:
- (undocumented)
-
isIndylambdaScalaClosure
-
inspect
-
isLambdaMetafactory
public static boolean isLambdaMetafactory(org.apache.xbean.asm9.Handle bsmHandle) Check if the handle represents the LambdaMetafactory that indylambda Scala closures use for creating the lambda class and getting a closure instance.- Parameters:
bsmHandle
- (undocumented)- Returns:
- (undocumented)
-
isLambdaBodyCapturingOuter
public static boolean isLambdaBodyCapturingOuter(org.apache.xbean.asm9.Handle handle, String ownerInternalName) Check if the handle represents a target method that is: - a STATIC method that implements a Scala lambda body in the indylambda style - captures the enclosingthis
, i.e. the first argument is a reference to the same type as the owning class. Returns true if both criteria above are met.- Parameters:
handle
- (undocumented)ownerInternalName
- (undocumented)- Returns:
- (undocumented)
-
isInnerClassCtorCapturingOuter
public static boolean isInnerClassCtorCapturingOuter(int op, String owner, String name, String desc, String callerInternalName) Check if the callee of a call site is a inner class constructor. - A constructor has to be invoked via INVOKESPECIAL - A constructor's internal name is "<init>" and the return type is "V" (void) - An inner class' first argument in the signature has to be a reference to the enclosing "this", aka$outer
in Scala.- Parameters:
op
- (undocumented)owner
- (undocumented)name
- (undocumented)desc
- (undocumented)callerInternalName
- (undocumented)- Returns:
- (undocumented)
-
findAccessedFields
public static void findAccessedFields(SerializedLambda lambdaProxy, ClassLoader lambdaClassLoader, scala.collection.mutable.Map<Class<?>, scala.collection.mutable.Set<String>> accessedFields, scala.collection.mutable.Map<Class<?>, scala.collection.mutable.Set<String>> accessedAmmCmdFields, scala.collection.mutable.Map<Class<?>, Object> ammCmdInstances, boolean findTransitively) Scans an indylambda Scala closure, along with its lexically nested closures, and populate the accessed fields info on which fields on the outer object are accessed.This is equivalent to getInnerClosureClasses() + InnerClosureFinder + FieldAccessFinder fused into one for processing indylambda closures. The traversal order along the call graph is the same for all three combined, so they can be fused together easily while maintaining the same ordering as the existing implementation.
It also visits transitively Ammonite cmd and cmd%Helper objects it encounters and populates accessed fields for them to be able to clean up these as well
Precondition: this function expects the
accessedFields
to be populated with all known outer classes and their super classes to be in the map as keys, e.g. initializing via ClosureCleaner.initAccessedFields.- Parameters:
lambdaProxy
- (undocumented)lambdaClassLoader
- (undocumented)accessedFields
- (undocumented)accessedAmmCmdFields
- (undocumented)ammCmdInstances
- (undocumented)findTransitively
- (undocumented)
-
org$apache$spark$internal$Logging$$log_
public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_() -
org$apache$spark$internal$Logging$$log__$eq
public static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) -
LogStringContext
public static org.apache.spark.internal.Logging.LogStringContext LogStringContext(scala.StringContext sc)
-