Skip to content

Commit e0f9f09

Browse files
authored
Merge branch 'jruby-10.0' into jruby-10.0-mvnw-consistency
2 parents f4dce52 + 094907f commit e0f9f09

29 files changed

Lines changed: 700 additions & 624 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
target: ['test:jruby:int', 'spec:ruby:fast', 'spec:ji', 'spec:ffi', 'test:mri:core:jit', 'test:mri:extra', 'spec:ruby:fast:jit', 'test:mri:stdlib', 'spec:ruby:slow', 'spec:ruby:debug', 'test:jruby:aot', 'test:slow_suites', 'spec:compiler', 'spec:regression', 'spec:jrubyc', 'spec:profiler']
19-
java-version: ['21', '25']
19+
java-version: ['21', '25', '26']
2020
fail-fast: false
2121

2222
name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }})
@@ -46,7 +46,7 @@ jobs:
4646
matrix:
4747
target: ['spec:jruby']
4848
platform: ['ubuntu-latest', 'macos-latest']
49-
java-version: ['21', '25']
49+
java-version: ['21', '25', '26']
5050
fail-fast: false
5151

5252
name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }})
@@ -122,7 +122,7 @@ jobs:
122122
strategy:
123123
matrix:
124124
target: ['test:mri:core:jit', 'test:jruby:jit', 'spec:compiler', 'spec:ruby:fast:jit', 'spec:ji']
125-
java-version: ['21', '25']
125+
java-version: ['21', '25', '26']
126126
fail-fast: false
127127

128128
name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }} -indy)

.mvn/wrapper/maven-wrapper.jar

-61.1 KB
Binary file not shown.
Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one
2-
# or more contributor license agreements. See the NOTICE file
3-
# distributed with this work for additional information
4-
# regarding copyright ownership. The ASF licenses this file
5-
# to you under the Apache License, Version 2.0 (the
6-
# "License"); you may not use this file except in compliance
7-
# with the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing,
12-
# software distributed under the License is distributed on an
13-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
# KIND, either express or implied. See the License for the
15-
# specific language governing permissions and limitations
16-
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.14/apache-maven-3.9.14-bin.zip

core/src/main/java/org/jruby/RubyFile.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import java.net.URL;
6868
import java.nio.channels.Channels;
6969
import java.nio.channels.FileChannel;
70+
import java.nio.channels.SeekableByteChannel;
7071
import java.nio.charset.StandardCharsets;
7172
import java.nio.file.*;
7273
import java.nio.file.attribute.FileTime;
@@ -237,6 +238,23 @@ public RubyFile(Ruby runtime, String path, InputStream in) {
237238
this.setPath(path);
238239
}
239240

241+
242+
private RubyFile(Ruby runtime, String path, SeekableByteChannel in) {
243+
super(runtime, runtime.getFile(), in);
244+
this.setPath(path);
245+
}
246+
247+
/**
248+
* Only used by parser (prism) so that we can get a File
249+
* @param runtime the runtime
250+
* @param path the path of DATA
251+
* @param in the channel to use
252+
* @return a Ruby file
253+
*/
254+
public static RubyFile DATAFile(Ruby runtime, String path, SeekableByteChannel in) {
255+
return new RubyFile(runtime, path, in);
256+
}
257+
240258
public RubyFile(Ruby runtime, String path, FileChannel channel) {
241259
super(runtime, runtime.getFile(), channel);
242260
this.setPath(path);

core/src/main/java/org/jruby/ir/builder/EnsureBlockInfo.java

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
* run the stack of ensure blocks in the right order.
5050
* ----------------------------------------------------------------------------------- */
5151
class EnsureBlockInfo {
52-
final Label regionStart;
53-
final Label start;
54-
final Label end;
55-
final Label dummyRescueBlockLabel;
52+
final Label start; // Beginning of this ensure region
53+
final Label bodyStart; // Beginning of any actual instrs in the ensure body (will not be emitted if none)
54+
final Label end; // End of this ensure region
55+
final Label ensureRescue; // Where exceptions in an ensure flow through
5656
Variable savedGlobalException;
5757
boolean needsBacktrace;
5858

@@ -65,13 +65,13 @@ class EnsureBlockInfo {
6565
// This ensure block's instructions
6666
final List<Instr> instrs;
6767

68-
public EnsureBlockInfo(IRScope s, IRLoop l, Label bodyRescuer) {
68+
public EnsureBlockInfo(IRScope s, IRLoop l, Label bodyRescuer, int sourceLine) {
6969
// this technically may be any block and not specifically rescue but for the sake of looking at the CFG
7070
// it is more or less a begin block with exception handling around it.
71-
regionStart = s.getNewLabel("BEGIN");
72-
start = s.getNewLabel("RESC_START");
73-
end = s.getNewLabel("AFTER_RESC");
74-
dummyRescueBlockLabel = s.getNewLabel("RESC_DUMMY");
71+
start = s.getNewLabel("ENSURE_BEGIN_@" + sourceLine);
72+
bodyStart = s.getNewLabel("ENSURE_BODY_:@" + sourceLine);
73+
end = s.getNewLabel("ENSURE_END_:@" + sourceLine);
74+
ensureRescue = s.getNewLabel("ENSURE_CATCH_@" + sourceLine);
7575
instrs = new ArrayList<>(4);
7676
savedGlobalException = null;
7777
innermostLoop = l;
@@ -87,10 +87,14 @@ public void addInstrAtBeginning(Instr i) {
8787
instrs.add(0, i);
8888
}
8989

90-
public void emitBody(IRBuilder b) {
91-
b.addInstr(new LabelInstr(start));
90+
/**
91+
* Emit the saved instrs for the ensure body into the current location in the provided builder.
92+
* @param builder
93+
*/
94+
public void emitEnsureBody(IRBuilder builder) {
95+
builder.addInstr(new LabelInstr(bodyStart));
9296
for (Instr i: instrs) {
93-
b.addInstr(i);
97+
builder.addInstr(i);
9498
}
9599
}
96100

@@ -106,20 +110,20 @@ public void cloneIntoHostScope(IRBuilder builder) {
106110
// there are no actual instrs pushed yet (but ebi has reserved a frame for it -- e.g. the rescue/ensure
107111
// the next is in). Since it is doing nothing we have nothing to clone. By skipping this we prevent
108112
// setting exception regions and simplify CFG construction.
109-
if (instrs.size() == 0) return;
113+
if (instrs.isEmpty()) return;
110114

111115
SimpleCloneInfo ii = new SimpleCloneInfo(builder.scope, true);
112116

113117
// Clone required labels.
114118
// During normal cloning below, labels not found in the rename map
115119
// are not cloned.
116-
ii.renameLabel(start);
120+
ii.renameLabel(bodyStart);
117121
for (Instr i: instrs) {
118122
if (i instanceof LabelInstr) ii.renameLabel(((LabelInstr)i).getLabel());
119123
}
120124

121125
// Clone instructions now
122-
builder.addInstr(new LabelInstr(ii.getRenamedLabel(start)));
126+
builder.addInstr(new LabelInstr(ii.getRenamedLabel(bodyStart)));
123127
builder.addInstr(new ExceptionRegionStartMarkerInstr(bodyRescuer));
124128
for (Instr instr: instrs) {
125129
Instr clonedInstr = instr.clone(ii);

0 commit comments

Comments
 (0)