Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 92f09c43ee89
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ecc8c4988083
Choose a head ref

Commits on Sep 12, 2016

  1. Copy the full SHA
    bec3e5d View commit details
  2. Copy the full SHA
    14c901a View commit details
  3. Copy the full SHA
    4a657ad View commit details
  4. Copy the full SHA
    864a3a6 View commit details
  5. [Truffle] All known encoding names are US-ASCII.

    While it's possible in theory to have a new encoding using non-ASCII names, all of the ones in jCodings are US-ASCII and MRI returns US-ASCII for the names of each encoding. Switching to US-ASCII avoids a code range scan, since an ASCII-8BIT string can be either CR_7BIT or CR_VALID, while US-ASCII can only be CR_7BIT. Also, since the jCodings names can't change, there's no need to make a defensive copy here, so we can do away with the unnecessary ByteList allocation.
    nirvdrum committed Sep 12, 2016
    Copy the full SHA
    c7fdb07 View commit details
  6. [Truffle] Removed unnecessary ByteList allocation.

    This also avoids the defensive copy of memory we make when converting a rope to a ByteList.
    nirvdrum committed Sep 12, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6dc0f91 View commit details

Commits on Sep 13, 2016

  1. [Truffle] Avoid calling toString on ropes.

    These calls are expensive and it's hard to track them down if they're left as the general `toString`.
    nirvdrum committed Sep 13, 2016
    Copy the full SHA
    66a5894 View commit details
  2. [Truffle] Store the cwd in the ropes table.

    The cwd is unlikely to change much in a program but is used frequently when expanding paths.
    nirvdrum committed Sep 13, 2016
    Copy the full SHA
    371cf62 View commit details
  3. Copy the full SHA
    53ec720 View commit details
  4. Copy the full SHA
    d7b6cd7 View commit details
  5. [Truffle] Make set_trac_func invalidates an Assumption which InlinedC…

    …oreMethodNode can check.
    eregon committed Sep 13, 2016
    Copy the full SHA
    55a9641 View commit details
  6. Copy the full SHA
    92d63ce View commit details
  7. Revert "[Truffle] Disable ecosystem tests for now."

    This reverts commit fb568f7.
    eregon committed Sep 13, 2016
    Copy the full SHA
    c1f1065 View commit details
  8. [Truffle] Remove buggy condition for visibility when looking methods.

    * It also makes some actionmodel test fail.
    eregon committed Sep 13, 2016
    Copy the full SHA
    e13b2ce View commit details
  9. Copy the full SHA
    6c15561 View commit details
  10. Copy the full SHA
    5810139 View commit details
  11. Copy the full SHA
    fd65c86 View commit details
  12. Copy the full SHA
    df53381 View commit details
  13. Copy the full SHA
    6db635e View commit details
  14. Copy the full SHA
    37c12b8 View commit details
  15. Copy the full SHA
    a08620f View commit details
  16. Copy the full SHA
    80eda52 View commit details

Commits on Sep 14, 2016

  1. Copy the full SHA
    9cdf736 View commit details
  2. [Truffle] Remove running property, update InlineMethod constructor, r…

    …ename param
    Brandon Fish committed Sep 14, 2016
    Copy the full SHA
    ecc8c49 View commit details
Showing with 221 additions and 326 deletions.
  1. +1 −1 .travis.yml
  2. +12 −4 ci.hocon
  3. +2 −1 mx.jruby/suite.py
  4. +2 −2 truffle/.factorypath
  5. +1 −0 truffle/pom.rb
  6. +79 −46 truffle/src/main/c/openssl/ossl_asn1.c
  7. +3 −14 truffle/src/main/java/org/jruby/truffle/RubyContext.java
  8. +1 −2 truffle/src/main/java/org/jruby/truffle/builtins/CoreMethodNodeManager.java
  9. +7 −5 truffle/src/main/java/org/jruby/truffle/core/InlinedCoreMethodNode.java
  10. +3 −2 truffle/src/main/java/org/jruby/truffle/core/encoding/EncodingConverterNodes.java
  11. +1 −1 truffle/src/main/java/org/jruby/truffle/core/encoding/EncodingNodes.java
  12. +4 −2 truffle/src/main/java/org/jruby/truffle/core/exception/ExceptionNodes.java
  13. +2 −3 truffle/src/main/java/org/jruby/truffle/core/kernel/KernelNodes.java
  14. +15 −1 truffle/src/main/java/org/jruby/truffle/core/kernel/TraceManager.java
  15. +3 −10 truffle/src/main/java/org/jruby/truffle/core/module/ModuleNodes.java
  16. +9 −16 truffle/src/main/java/org/jruby/truffle/core/rope/NativeRope.java
  17. +0 −25 truffle/src/main/java/org/jruby/truffle/core/rope/RopeOperations.java
  18. +2 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/StatPrimitiveNodes.java
  19. +0 −12 truffle/src/main/java/org/jruby/truffle/core/string/StringGuards.java
  20. +21 −25 truffle/src/main/java/org/jruby/truffle/core/string/StringNodes.java
  21. +2 −3 truffle/src/main/java/org/jruby/truffle/extra/TrufflePosixNodes.java
  22. +2 −1 truffle/src/main/java/org/jruby/truffle/extra/ffi/PointerPrimitiveNodes.java
  23. +2 −2 truffle/src/main/java/org/jruby/truffle/interop/cext/CExtStringMessageResolution.java
  24. +2 −2 truffle/src/main/java/org/jruby/truffle/language/LazyRubyRootNode.java
  25. +1 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/DispatchNode.java
  26. +2 −2 truffle/src/main/java/org/jruby/truffle/language/dispatch/RubyCallNode.java
  27. +1 −2 truffle/src/main/java/org/jruby/truffle/language/loader/CodeLoader.java
  28. +22 −6 truffle/src/main/java/org/jruby/truffle/language/methods/InternalMethod.java
  29. +4 −12 truffle/src/main/java/org/jruby/truffle/language/methods/LookupMethodNode.java
  30. +1 −2 truffle/src/main/java/org/jruby/truffle/language/methods/MethodDefinitionNode.java
  31. +1 −2 truffle/src/main/java/org/jruby/truffle/language/methods/ModuleBodyDefinitionNode.java
  32. +0 −2 truffle/src/main/java/org/jruby/truffle/platform/NativePlatform.java
  33. +0 −16 truffle/src/main/java/org/jruby/truffle/platform/SimpleNativeMemoryManager.java
  34. +0 −10 truffle/src/main/java/org/jruby/truffle/platform/darwin/DarwinPlatform.java
  35. +0 −10 truffle/src/main/java/org/jruby/truffle/platform/java/JavaPlatform.java
  36. +0 −10 truffle/src/main/java/org/jruby/truffle/platform/linux/LinuxPlatform.java
  37. +0 −61 truffle/src/main/java/org/jruby/truffle/platform/sunmisc/SunMiscUnsafeSimpleNativeMemoryManager.java
  38. +3 −3 truffle/src/main/ruby/core/io.rb
  39. +6 −2 truffle/src/main/ruby/core/string.rb
  40. +4 −4 truffle/src/main/ruby/core/type.rb
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ matrix:
- env: JT='test specs :truffle'
- env: JT='test integration'
- env: JT='test gems' COMMAND=test/truffle/gems/install-gems.sh
# - env: JT='test ecosystem' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true COMMAND=test/truffle/ecosystem-travis-install.sh
- env: JT='test ecosystem' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true COMMAND=test/truffle/ecosystem-travis-install.sh
- env: JT='test tck'
- env: JT='check_ambiguous_arguments' SKIP_BUILD=true V=1
- env: JT='test mri'
16 changes: 12 additions & 4 deletions ci.hocon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Must be the same as in truffle/pom.rb and mx.jruby/suite.py
truffle-version: 60fde6f5778d478411632077154bea1679839780

jt: [ruby, tool/jt.rb]

common: {
@@ -42,9 +45,12 @@ labsjdk: {
}
}

# Allow a version mismatch with truffle to prefer the language truffle version
// Allow a version mismatch with truffle to prefer the language truffle version
clone_graal: [mx, --version-conflict-resolution, ignore, sclone, --kind, git]

// Use Truffle version of the language
use-language-truffle: ["&&", git, fetch, "&&", git, reset, --hard, ${truffle-version}, "&&"]

graal-core: ${labsjdk} {
setup: ${common.setup} [
[mv, mx.jruby, temp_mx],
@@ -53,7 +59,8 @@ graal-core: ${labsjdk} {
${clone_graal} ["https://github.com/graalvm/graal-core.git", graal-core],
[cd, graal-core],
[mx, sforceimports],
[mx, build],
[cd, ../truffle] ${use-language-truffle} [cd, ../graal-core],
[mx, --java-home, "$JVMCI_JAVA_HOME", build],
[cd, ../..],
[mv, temp_mx, mx.jruby]
]
@@ -73,7 +80,8 @@ graal-enterprise: ${labsjdk} {
${clone_graal} ["https://github.com/graalvm/graal-enterprise.git", graal-enterprise],
[cd, graal-enterprise/graal-enterprise],
[mx, sforceimports],
[mx, build],
[cd, ../../truffle] ${use-language-truffle} [cd, ../graal-enterprise/graal-enterprise],
[mx, --java-home, "$JVMCI_JAVA_HOME", build],
[cd, ../../..],
[mv, temp_mx, mx.jruby]
]
@@ -353,7 +361,7 @@ builds: [
{name: ruby-test-integration} ${common} ${gate-caps} {run: [${jt} [test, integration]]},
{name: ruby-test-cexts} ${common} ${gate-caps} ${test-cexts},
{name: ruby-test-gems} ${common} ${gate-caps} ${test-gems},
// {name: ruby-test-ecosystem} ${common} ${gate-caps} ${test-ecosystem},
{name: ruby-test-ecosystem} ${common} ${gate-caps} ${test-ecosystem},
{name: ruby-test-tarball} ${common} ${gate-caps} {run: [${jt} [tarball]]},

{name: ruby-test-compiler-graal-core} ${common} ${graal-core} ${gate-caps} {run: [${jt} [test, compiler]]},
3 changes: 2 additions & 1 deletion mx.jruby/suite.py
Original file line number Diff line number Diff line change
@@ -30,7 +30,8 @@ def mavenLib(mavenDep, sha1):
"suites": [
{
"name": "truffle",
"version": "387cbe478688e84d211aa534b7b93d47709cadd9",
# Must be the same as in truffle/pom.rb and ci.hocon
"version": "60fde6f5778d478411632077154bea1679839780",
"urls": [
{"url": "https://github.com/graalvm/truffle.git", "kind": "git"},
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
4 changes: 2 additions & 2 deletions truffle/.factorypath
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<factorypath>
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle/truffle-api/0.16/truffle-api-0.16.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle/truffle-dsl-processor/0.16/truffle-dsl-processor-0.16.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle/truffle-api/0.17/truffle-api-0.17.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/oracle/truffle/truffle-dsl-processor/0.17/truffle-dsl-processor-0.17.jar" enabled="true" runInBatchMode="false"/>
</factorypath>
1 change: 1 addition & 0 deletions truffle/pom.rb
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@

properties( 'polyglot.dump.pom' => 'pom.xml',
'polyglot.dump.readonly' => true,
# Must be the same as in mx.jruby/suite.py and ci.hocon
'truffle.version' => '0.17',
'jruby.basedir' => '${basedir}/..',
'maven.test.skip' => 'true' )
125 changes: 79 additions & 46 deletions truffle/src/main/c/openssl/ossl_asn1.c
Original file line number Diff line number Diff line change
@@ -504,48 +504,49 @@ decode_eoc(unsigned char *der, long length)

/********/

typedef struct {
const char *name;
VALUE *klass;
} ossl_asn1_info_t;

// TODO CS 06-09-16 Removed the address of the classes for now as it causes problems in Sulong

static const ossl_asn1_info_t ossl_asn1_info[] = {
{ "EOC", NULL /*&cASN1EndOfContent*/, }, /* 0 */
{ "BOOLEAN", NULL /*&cASN1Boolean*/, }, /* 1 */
{ "INTEGER", NULL /*&cASN1Integer*/, }, /* 2 */
{ "BIT_STRING", NULL /*&cASN1BitString*/, }, /* 3 */
{ "OCTET_STRING", NULL /*&cASN1OctetString*/, }, /* 4 */
{ "NULL", NULL /*&cASN1Null*/, }, /* 5 */
{ "OBJECT", NULL /*&cASN1ObjectId*/, }, /* 6 */
{ "OBJECT_DESCRIPTOR", NULL, }, /* 7 */
{ "EXTERNAL", NULL, }, /* 8 */
{ "REAL", NULL, }, /* 9 */
{ "ENUMERATED", NULL /*&cASN1Enumerated*/, }, /* 10 */
{ "EMBEDDED_PDV", NULL, }, /* 11 */
{ "UTF8STRING", NULL /*&cASN1UTF8String*/, }, /* 12 */
{ "RELATIVE_OID", NULL, }, /* 13 */
{ "[UNIVERSAL 14]", NULL, }, /* 14 */
{ "[UNIVERSAL 15]", NULL, }, /* 15 */
{ "SEQUENCE", NULL /*&cASN1Sequence*/, }, /* 16 */
{ "SET", NULL /*&cASN1Set*/, }, /* 17 */
{ "NUMERICSTRING", NULL /*&cASN1NumericString*/, }, /* 18 */
{ "PRINTABLESTRING", NULL /*&cASN1PrintableString*/, }, /* 19 */
{ "T61STRING", NULL /*&cASN1T61String*/, }, /* 20 */
{ "VIDEOTEXSTRING", NULL /*&cASN1VideotexString*/, }, /* 21 */
{ "IA5STRING", NULL /*&cASN1IA5String*/, }, /* 22 */
{ "UTCTIME", NULL /*&cASN1UTCTime*/, }, /* 23 */
{ "GENERALIZEDTIME", NULL /*&cASN1GeneralizedTime*/, }, /* 24 */
{ "GRAPHICSTRING", NULL /*&cASN1GraphicString*/, }, /* 25 */
{ "ISO64STRING", NULL /*&cASN1ISO64String*/, }, /* 26 */
{ "GENERALSTRING", NULL /*&cASN1GeneralString*/, }, /* 27 */
{ "UNIVERSALSTRING", NULL /*&cASN1UniversalString*/, }, /* 28 */
{ "CHARACTER_STRING", NULL, }, /* 29 */
{ "BMPSTRING", NULL /*&cASN1BMPString*/, }, /* 30 */
/*
* Modified for Sulong to flatten the array of ossl_asn1_info_t structures,
* into an array of names and array of classes, because the classes are
* managed and can't be stored in a static array of structures like that.
*/

static const char *ossl_asn1_info_names[] = {
"EOC",
"BOOLEAN",
"INTEGER",
"BIT_STRING",
"OCTET_STRING",
"NULL",
"OBJECT",
"OBJECT_DESCRIPTOR",
"EXTERNAL",
"REAL",
"ENUMERATED",
"EMBEDDED_PDV",
"UTF8STRING",
"RELATIVE_OID",
"[UNIVERSAL 14]",
"[UNIVERSAL 15]",
"SEQUENCE",
"SET",
"NUMERICSTRING",
"PRINTABLESTRING",
"T61STRING",
"VIDEOTEXSTRING",
"IA5STRING",
"UTCTIME",
"GENERALIZEDTIME",
"GRAPHICSTRING",
"ISO64STRING",
"GENERALSTRING",
"UNIVERSALSTRING",
"CHARACTER_STRING",
"BMPSTRING"
};

enum {ossl_asn1_info_size = (sizeof(ossl_asn1_info)/sizeof(ossl_asn1_info[0]))};
static VALUE *ossl_asn1_info_klasses;

enum {ossl_asn1_info_size = (sizeof(ossl_asn1_info_names)/sizeof(ossl_asn1_info_names[0]))};

static VALUE class_tag_map;

@@ -859,8 +860,8 @@ int_ossl_asn1_decode0_prim(unsigned char **pp, long length, long hlen, int tag,
*pp += hlen + length;
*num_read = hlen + length;

if (tc == sUNIVERSAL && tag < ossl_asn1_info_size && ossl_asn1_info[tag].klass) {
VALUE klass = *ossl_asn1_info[tag].klass;
if (tc == sUNIVERSAL && tag < ossl_asn1_info_size && ossl_asn1_info_klasses[tag]) {
VALUE klass = ossl_asn1_info_klasses[tag];
VALUE args[4];
args[0] = value;
args[1] = INT2NUM(tag);
@@ -924,7 +925,7 @@ int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length,
}
}
else {
VALUE klass = *ossl_asn1_info[tag].klass;
VALUE klass = ossl_asn1_info_klasses[tag];
asn1data = rb_obj_alloc(klass);
}
args[0] = ary;
@@ -1634,9 +1635,9 @@ Init_ossl_asn1(void)
*/
rb_define_const(mASN1, "UNIVERSAL_TAG_NAME", ary);
for(i = 0; i < ossl_asn1_info_size; i++){
if(ossl_asn1_info[i].name[0] == '[') continue;
rb_define_const(mASN1, ossl_asn1_info[i].name, INT2NUM(i));
rb_ary_store(ary, i, rb_str_new2(ossl_asn1_info[i].name));
if(ossl_asn1_info_names[i][0] == '[') continue;
rb_define_const(mASN1, ossl_asn1_info_names[i], INT2NUM(i));
rb_ary_store(ary, i, rb_str_new2(ossl_asn1_info_names[i]));
}

/* Document-class: OpenSSL::ASN1::ASN1Data
@@ -1950,6 +1951,38 @@ do{\

OSSL_ASN1_DEFINE_CLASS(EndOfContent, Data);

ossl_asn1_info_klasses = (VALUE *) truffle_managed_malloc(ossl_asn1_info_size * sizeof(VALUE));
ossl_asn1_info_klasses[0] = cASN1EndOfContent;
ossl_asn1_info_klasses[1] = cASN1Boolean;
ossl_asn1_info_klasses[2] = cASN1Integer;
ossl_asn1_info_klasses[3] = cASN1BitString;
ossl_asn1_info_klasses[4] = cASN1OctetString;
ossl_asn1_info_klasses[5] = cASN1Null;
ossl_asn1_info_klasses[6] = cASN1ObjectId;
ossl_asn1_info_klasses[7] = NULL;
ossl_asn1_info_klasses[8] = NULL;
ossl_asn1_info_klasses[9] = NULL;
ossl_asn1_info_klasses[10] = cASN1Enumerated;
ossl_asn1_info_klasses[11] = NULL;
ossl_asn1_info_klasses[12] = cASN1UTF8String;
ossl_asn1_info_klasses[13] = NULL;
ossl_asn1_info_klasses[14] = NULL;
ossl_asn1_info_klasses[15] = NULL;
ossl_asn1_info_klasses[16] = cASN1Sequence;
ossl_asn1_info_klasses[17] = cASN1Set;
ossl_asn1_info_klasses[18] = cASN1NumericString;
ossl_asn1_info_klasses[19] = cASN1PrintableString;
ossl_asn1_info_klasses[20] = cASN1T61String;
ossl_asn1_info_klasses[21] = cASN1VideotexString;
ossl_asn1_info_klasses[22] = cASN1IA5String;
ossl_asn1_info_klasses[23] = cASN1UTCTime;
ossl_asn1_info_klasses[24] = cASN1GeneralizedTime;
ossl_asn1_info_klasses[25] = cASN1GraphicString;
ossl_asn1_info_klasses[26] = cASN1ISO64String;
ossl_asn1_info_klasses[27] = cASN1GeneralString;
ossl_asn1_info_klasses[28] = cASN1UniversalString;
ossl_asn1_info_klasses[29] = NULL;
ossl_asn1_info_klasses[30] = cASN1BMPString;

/* Document-class: OpenSSL::ASN1::ObjectId
*
17 changes: 3 additions & 14 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -64,7 +64,6 @@ public class RubyContext extends ExecutionContext {

private final TruffleLanguage.Env env;
private final Ruby jrubyRuntime;
private boolean running = false;

private final Options options = new Options();
private final RopeTable ropeTable = new RopeTable();
@@ -161,6 +160,9 @@ public RubyContext(Ruby jrubyRuntime, TruffleLanguage.Env env) {

// Capture known builtin methods

final Instrumenter instrumenter = env.lookup(Instrumenter.class);
attachmentsManager = new AttachmentsManager(this, instrumenter);
traceManager = new TraceManager(this, instrumenter);
coreMethods = new CoreMethods(coreLibrary);

// Load the reset of the core library
@@ -179,13 +181,8 @@ public RubyContext(Ruby jrubyRuntime, TruffleLanguage.Env env) {
instrumentationServerManager = null;
}

final Instrumenter instrumenter = env.lookup(Instrumenter.class);
attachmentsManager = new AttachmentsManager(this, instrumenter);
traceManager = new TraceManager(this, instrumenter);
coverageManager = new CoverageManager(this, instrumenter);

this.setRunning(true);

coreLibrary.initializePostBoot();
}

@@ -318,14 +315,6 @@ public AttachmentsManager getAttachmentsManager() {
return attachmentsManager;
}

public boolean isRunning() {
return running;
}

public void setRunning(boolean running) {
this.running = running;
}

public SourceLoader getSourceLoader() {
return sourceLoader;
}
Original file line number Diff line number Diff line change
@@ -160,8 +160,7 @@ private static void addMethod(RubyContext context, DynamicObject module, SharedM
if (ModuleOperations.isMethodPrivateFromName(name)) {
visibility = Visibility.PRIVATE;
}
final boolean builtIn = !context.isRunning();
final InternalMethod method = new InternalMethod(sharedMethodInfo, name, module, visibility, builtIn, callTarget);
final InternalMethod method = new InternalMethod(context, sharedMethodInfo, name, module, visibility, callTarget);

Layouts.MODULE.getFields(module).addMethod(context, null, method);
}
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
*/
package org.jruby.truffle.core;

import com.oracle.truffle.api.Assumption;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.NodeFactory;
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -30,6 +31,7 @@ public class InlinedCoreMethodNode extends RubyNode {

private final RubyCallNodeParameters callNodeParameters;
private final InternalMethod method;
private final Assumption tracingUnused;

@Child InlinableBuiltin builtin;
@Child LookupMethodNode lookupMethodNode;
@@ -40,6 +42,7 @@ public InlinedCoreMethodNode(RubyCallNodeParameters callNodeParameters, Internal
super(callNodeParameters.getContext(), callNodeParameters.getSection());
this.callNodeParameters = callNodeParameters;
this.method = method;
this.tracingUnused = callNodeParameters.getContext().getTraceManager().getUnusedAssumption();
this.builtin = builtin;
this.lookupMethodNode = LookupMethodNodeGen.create(callNodeParameters.getContext(), callNodeParameters.getSection(), false, false, null, null);
this.receiverNode = callNodeParameters.getReceiver();
@@ -57,14 +60,13 @@ public Object execute(VirtualFrame frame) {
final InternalMethod lookedUpMethod = lookupMethodNode.executeLookupMethod(frame, self, method.getName());
final Object[] arguments = executeArguments(frame, self);

if (lookedUpMethod != method || !guard(arguments)) {
if (lookedUpMethod == method && guard(arguments) && tracingUnused.isValid()) {
return builtin.executeBuiltin(frame, arguments);
} else {
CompilerDirectives.transferToInterpreterAndInvalidate();
RubyCallNode callNode = rewriteToCallNode();
Object[] argumentsObjects = ArrayUtils.extractRange(arguments, 1, arguments.length);
return callNode.executeWithArgumentEvaluated(frame, arguments[0], argumentsObjects);
return rewriteToCallNode().executeWithArgumentsEvaluated(frame, arguments[0], argumentsObjects);
}

return builtin.executeBuiltin(frame, arguments);
}

@ExplodeLoop
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import org.jcodings.Encoding;
import org.jcodings.EncodingDB;
import org.jcodings.Ptr;
import org.jcodings.specific.USASCIIEncoding;
import org.jcodings.transcode.EConv;
import org.jcodings.transcode.EConvFlags;
import org.jcodings.transcode.EConvResult;
@@ -167,11 +168,11 @@ public Object transcodingMap(VirtualFrame frame) {
final TranscoderDB.Entry e = destinationEntry.value;

if (key == null) {
final Object upcased = upcaseNode.call(frame, createString(new ByteList(e.getSource())), "upcase");
final Object upcased = upcaseNode.call(frame, createString(e.getSource(), USASCIIEncoding.INSTANCE), "upcase");
key = toSymNode.call(frame, upcased, "to_sym");
}

final Object upcasedLookupTableKey = upcaseNode.call(frame, createString(new ByteList(e.getDestination())), "upcase");
final Object upcasedLookupTableKey = upcaseNode.call(frame, createString(e.getDestination(), USASCIIEncoding.INSTANCE), "upcase");
final Object lookupTableKey = toSymNode.call(frame, upcasedLookupTableKey, "to_sym");
final Object lookupTableValue = newTranscodingNode.call(frame, coreLibrary().getTranscodingClass(), "create", key, lookupTableKey);
lookupTableWriteNode.call(frame, value, "[]=", lookupTableKey, lookupTableValue);
Original file line number Diff line number Diff line change
@@ -465,7 +465,7 @@ public DynamicObject eachAlias(VirtualFrame frame, DynamicObject block) {
CompilerAsserts.neverPartOfCompilation();
for (HashEntry<Entry> entry : EncodingDB.getAliases().entryIterator()) {
final CaseInsensitiveBytesHashEntry<Entry> e = (CaseInsensitiveBytesHashEntry<Entry>) entry;
final ByteList aliasName = new ByteList(e.bytes, e.p, e.end - e.p);
final ByteList aliasName = new ByteList(e.bytes, e.p, e.end - e.p, USASCIIEncoding.INSTANCE, false);
yield(frame, block, createString(aliasName), entry.value.getIndex());
}
return nil();
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@
import org.jruby.truffle.builtins.NonStandard;
import org.jruby.truffle.builtins.Primitive;
import org.jruby.truffle.builtins.PrimitiveArrayArgumentsNode;
import org.jruby.truffle.core.rope.RopeOperations;
import org.jruby.truffle.core.string.StringOperations;
import org.jruby.truffle.language.NotProvided;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.backtrace.Backtrace;
@@ -158,9 +160,9 @@ public DynamicObject exceptionErrnoError(
final String errorMessage;
if (message != nil()) {
if (RubyGuards.isRubyString(location)) {
errorMessage = " @ " + location.toString() + " - " + message.toString();
errorMessage = " @ " + location.toString() + " - " + RopeOperations.decodeRope(StringOperations.rope(message));
} else {
errorMessage = " - " + message.toString();
errorMessage = " - " + RopeOperations.decodeRope(StringOperations.rope(message));
}
} else {
errorMessage = "";
Loading