Skip to content

Commit

Permalink
PR review + formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertp committed Oct 31, 2022
1 parent 16157ae commit c690ad3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
@BuiltinMethod(
type = "Vector",
name = "from_polyglot_array",
description = "Creates a Vector by providing its underlying storage as a polyglot array. The underlying array should be guaranteed to never be mutated.",
description =
"Creates a Vector by providing its underlying storage as a polyglot array. The underlying array should be guaranteed to never be mutated.",
owner = Owner.MODULE)
public abstract class FromPolyglotArrayBuiltinVectorNode extends Node {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@ class IrToTruffle(
// - a module method has been implicitly added by the compiler rather than being explicitly declared
// In all other cases, a builtin method should already have been registered.
fOpt
.filter(_ =>
methodDef.methodReference.typePointer.isEmpty
)
.filter(_ => methodDef.methodReference.typePointer.isEmpty)
.map(m => m.getFunction)
)
case fn: IR.Function =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class ModuleBuiltins(builtins: Builtins) {
def inject(module: Module, ir: IR.Module, language: Language): IR.Module = {
val modName = module.getName.item
val allBuiltins = builtins
.getBuiltinFunctionsForModule(modName, language).asScala
.getBuiltinFunctionsForModule(modName, language)
.asScala

if (allBuiltins.nonEmpty) {
val existingMethodBindings = ir.bindings.collect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,8 @@ public String key() {
@Override
protected MethodMetadataEntry toMetadataEntry(String line) {
String[] elements = line.split(":");
if (elements.length < 2 || elements.length > 4) throw new RuntimeException("invalid builtin metadata entry: " + line);
boolean isStatic = elements.length >= 3 ? Boolean.valueOf(elements[2]) : false;
Owner owner = elements.length == 4 ? Owner.valueOf(elements[3]) : Owner.TYPE;
return new MethodMetadataEntry(elements[0], elements[1], isStatic, owner);
if (elements.length != 4) throw new RuntimeException("invalid builtin metadata entry: " + line);
return new MethodMetadataEntry(elements[0], elements[1], Boolean.valueOf(elements[2]), Owner.valueOf(elements[3]));
}

private static final String DATAFLOW_ERROR_PROFILE = "IsDataflowErrorConditionProfile";
Expand Down

0 comments on commit c690ad3

Please sign in to comment.