Skip to content

Commit 62095a2

Browse files
committed
[GR-21590] [GR-20902] [GR-21507] Update to latest Truffle with new metaobject API
PullRequest: graalpython/840
2 parents 83bd222 + eb10d38 commit 62095a2

Some content is hidden

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

47 files changed

+11396
-233
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ language
3737
*.dylib
3838
*.rej
3939
.checkstyle
40-
/graalpython/com.oracle.graal.python.cext/compile_flags.txt
41-
/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/*.interp
42-
/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/*.tokens
43-
/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/Python3*.java
44-
/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/Python3.g4.stamp
4540
/mx.imports
4641
.pydevproject
4742
## local dev and debug files

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "7a921d86cdb241e190bb1ad2c6f924d1837c6fa3" }
1+
{ "overlay": "ba6e4e7720df9534bc6b608786ce45ba954661d7" }
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-Iinclude/
2+
-I../include/

graalpython/com.oracle.graal.python.parser.antlr/postprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2020, 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
@@ -43,7 +43,7 @@
4343

4444
COPYRIGHT_HEADER = """\
4545
/*
46-
* Copyright (c) 2017-2019, Oracle and/or its affiliates.
46+
* Copyright (c) 2017-2020, Oracle and/or its affiliates.
4747
* Copyright (c) 2014 by Bart Kiers
4848
*
4949
* The MIT License (MIT)

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/debug/PythonDebugTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ public void testInspectJavaArray() throws Throwable {
424424
expectSuspended((SuspendedEvent event) -> {
425425
DebugScope globalScope = session.getTopScope("python");
426426
DebugValue intValue = globalScope.getDeclaredValue("a_int").getArray().get(0);
427-
// It's up to Truffle to decide which language it uses for inspection of primitives,
428-
// we should be fine as long as this doesn't throw an exception
427+
// Truffle will now use our language to get a Python view on the primitive object
428+
// for inspection
429429
intValue.getMetaObject();
430430
assertEquals("0", intValue.as(String.class));
431431
DebugValue longValue = globalScope.getDeclaredValue("a_long").getArray().get(0);
@@ -445,7 +445,7 @@ public void testInspectJavaArray() throws Throwable {
445445
assertEquals("0.0", doubleValue.as(String.class));
446446
DebugValue charValue = globalScope.getDeclaredValue("a_char").getArray().get(0);
447447
charValue.getMetaObject();
448-
assertEquals("\0", charValue.as(String.class));
448+
assertEquals("'\\x00'", charValue.as(String.class));
449449
});
450450
}
451451
}

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/interop/ReadAndWriteVariableTagsTests.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@
4040
*/
4141
package com.oracle.graal.python.test.interop;
4242

43+
import static org.junit.Assert.assertTrue;
44+
45+
import java.util.HashMap;
46+
import java.util.HashSet;
47+
import java.util.Set;
48+
4349
import com.oracle.graal.python.nodes.PNode;
50+
import com.oracle.graal.python.nodes.instrumentation.NodeObjectDescriptor;
4451
import com.oracle.graal.python.test.PythonTests;
4552
import com.oracle.truffle.api.frame.VirtualFrame;
4653
import com.oracle.truffle.api.instrumentation.EventContext;
@@ -50,21 +57,18 @@
5057
import com.oracle.truffle.api.instrumentation.StandardTags;
5158
import com.oracle.truffle.api.instrumentation.TruffleInstrument;
5259
import com.oracle.truffle.api.interop.InteropLibrary;
60+
import com.oracle.truffle.api.interop.UnknownIdentifierException;
61+
import com.oracle.truffle.api.interop.UnsupportedMessageException;
5362
import com.oracle.truffle.api.library.LibraryFactory;
5463
import com.oracle.truffle.api.nodes.Node;
55-
import java.util.HashMap;
64+
5665
import org.graalvm.polyglot.Context;
5766
import org.graalvm.polyglot.Engine;
5867
import org.graalvm.polyglot.Instrument;
5968
import org.graalvm.polyglot.Source;
60-
import static org.junit.Assert.assertTrue;
61-
import com.oracle.graal.python.nodes.instrumentation.NodeObjectDescriptor;
62-
import com.oracle.truffle.api.interop.UnknownIdentifierException;
63-
import com.oracle.truffle.api.interop.UnsupportedMessageException;
64-
import java.util.HashSet;
65-
import java.util.Set;
6669
import org.junit.Test;
6770

71+
@SuppressWarnings("all")
6872
public class ReadAndWriteVariableTagsTests extends PythonTests {
6973

7074
static final InteropLibrary INTEROP = LibraryFactory.resolve(InteropLibrary.class).getUncached();

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/interop/StandardTagsTests.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
*/
4141
package com.oracle.graal.python.test.interop;
4242

43+
import static org.junit.Assert.assertFalse;
44+
import static org.junit.Assert.assertTrue;
45+
46+
import java.util.HashMap;
47+
4348
import com.oracle.graal.python.nodes.PNode;
4449
import com.oracle.graal.python.nodes.function.InnerRootNode;
4550
import com.oracle.graal.python.test.PythonTests;
@@ -53,16 +58,15 @@
5358
import com.oracle.truffle.api.interop.InteropLibrary;
5459
import com.oracle.truffle.api.library.LibraryFactory;
5560
import com.oracle.truffle.api.nodes.Node;
56-
import java.util.HashMap;
61+
5762
import org.graalvm.polyglot.Context;
5863
import org.graalvm.polyglot.Engine;
5964
import org.graalvm.polyglot.Instrument;
6065
import org.graalvm.polyglot.Source;
6166
import org.junit.Assert;
62-
import static org.junit.Assert.assertTrue;
63-
import static org.junit.Assert.assertFalse;
6467
import org.junit.Test;
6568

69+
@SuppressWarnings("all")
6670
public class StandardTagsTests extends PythonTests {
6771

6872
static final InteropLibrary INTEROP = LibraryFactory.resolve(InteropLibrary.class).getUncached();

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/interop/TimeDateTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2020, 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
@@ -40,19 +40,24 @@
4040
*/
4141
package com.oracle.graal.python.test.interop;
4242

43-
import com.oracle.graal.python.test.PythonTests;
43+
import static org.junit.Assert.assertEquals;
44+
import static org.junit.Assert.assertFalse;
45+
4446
import java.io.ByteArrayOutputStream;
4547
import java.time.LocalDate;
4648
import java.time.LocalTime;
4749
import java.time.ZoneId;
50+
51+
import com.oracle.graal.python.test.PythonTests;
52+
4853
import org.graalvm.polyglot.Context;
4954
import org.graalvm.polyglot.Source;
5055
import org.graalvm.polyglot.Value;
5156
import org.junit.After;
52-
import static org.junit.Assert.*;
5357
import org.junit.Before;
5458
import org.junit.Test;
5559

60+
@SuppressWarnings("all")
5661
public class TimeDateTest extends PythonTests {
5762

5863
private ByteArrayOutputStream out;

0 commit comments

Comments
 (0)