Skip to content

Commit e1f4c01

Browse files
committed
[GR-61684][GR-62117] Node-less PythonObjectFactory and inlined PRaiseNode
PullRequest: graalpython/3678
2 parents 229ea3f + 02e6a90 commit e1f4c01

File tree

638 files changed

+13174
-13325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

638 files changed

+13174
-13325
lines changed

graalpython/com.oracle.graal.python.pegparser.generator/asdl/asdl_java.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -44,7 +44,6 @@
4444
from asdl import java_file
4545
from asdl import model
4646

47-
4847
SST_PACKAGE = 'com.oracle.graal.python.pegparser.sst'
4948
AST_PACKAGE = 'com.oracle.graal.python.builtins.modules.ast'
5049

@@ -285,7 +284,7 @@ def visit_abstract_class(self, c: model.AbstractClass, emitter: java_file.Emitte
285284

286285
def visit_concrete_class(self, c: model.ConcreteClass, emitter: java_file.Emitter):
287286
with emitter.define(f'public Object visit({c.full_name} node)', '@Override'):
288-
emitter.println(f'PythonObject o = factory.createPythonObject(state.{c.name.cls_field});')
287+
emitter.println(f'PythonObject o = createPythonObject(state.{c.name.cls_field});')
289288
for f in c.fields:
290289
self.visit(f, emitter)
291290
if c.outer_has_attributes or c.attributes:
@@ -338,6 +337,7 @@ def visit_module(self, module: model.Module):
338337
@staticmethod
339338
def emit_imports(module, emitter):
340339
emitter.println()
340+
emitter.println('import com.oracle.truffle.api.nodes.Node;')
341341
emitter.println('import com.oracle.graal.python.builtins.objects.PNone;')
342342
emitter.println('import com.oracle.graal.python.pegparser.sst.ConstantValue;')
343343
top_level_class_names = [t.name.java for t in module.types]
@@ -346,8 +346,8 @@ def emit_imports(module, emitter):
346346
emitter.println('import com.oracle.graal.python.pegparser.tokenizer.SourceRange;')
347347

348348
def emit_constructor(self, emitter: java_file.Emitter):
349-
with emitter.define(f'{self.CLASS_NAME}({AstStateGenerator.CLASS_NAME} state)'):
350-
emitter.println('super(state);')
349+
with emitter.define(f'{self.CLASS_NAME}(Node node, {AstStateGenerator.CLASS_NAME} state)'):
350+
emitter.println('super(node, state);')
351351

352352
@staticmethod
353353
def visit_enum(c: model.Enum, emitter: java_file.Emitter):

graalpython/com.oracle.graal.python.pegparser.generator/asdl/java_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -42,7 +42,7 @@
4242
from typing import Optional
4343

4444
HEADER = """/*
45-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
45+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
4646
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4747
*
4848
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/AliasTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/ArgTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/ArgumentsTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/BoolOpTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/CmpOpTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/ComprehensionTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/ExceptHandlerTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/sst/ExprContextTy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

0 commit comments

Comments
 (0)