private void buildObjectArray(String type, Object[] sourceArray, ArrayCallback callback) { if (sourceArray.length == 0) { method.getstatic(p(IRubyObject.class), "NULL_ARRAY", ci(IRubyObject[].class)); } else if (sourceArray.length <= Helpers.MAX_SPECIFIC_ARITY_OBJECT_ARRAY) { // if we have a specific-arity helper to construct an array for us, use that for (int i = 0; i < sourceArray.length; i++) { callback.nextValue(this, sourceArray, i); } invokeUtilityMethod("constructObjectArray", sig(IRubyObject[].class, params(IRubyObject.class, sourceArray.length))); } else { // brute force construction inline method.pushInt(sourceArray.length); method.anewarray(type); for (int i = 0; i < sourceArray.length; i++) { method.dup(); method.pushInt(i); callback.nextValue(this, sourceArray, i); method.arraystore(); } } }
private void buildObjectArray(String type, Object[] sourceArray, ArrayCallback callback) { if (sourceArray.length == 0) { method.getstatic(p(IRubyObject.class), "NULL_ARRAY", ci(IRubyObject[].class)); } else if (sourceArray.length <= Helpers.MAX_SPECIFIC_ARITY_OBJECT_ARRAY) { // if we have a specific-arity helper to construct an array for us, use that for (int i = 0; i < sourceArray.length; i++) { callback.nextValue(this, sourceArray, i); } invokeUtilityMethod("constructObjectArray", sig(IRubyObject[].class, params(IRubyObject.class, sourceArray.length))); } else { // brute force construction inline method.pushInt(sourceArray.length); method.anewarray(type); for (int i = 0; i < sourceArray.length; i++) { method.dup(); method.pushInt(i); callback.nextValue(this, sourceArray, i); method.arraystore(); } } }
value.call(methodCompiler); if (expr) method.dup_x2(); method.arraystore(); break;
value.call(methodCompiler); if (expr) method.dup_x2(); method.arraystore(); break;
method.pushInt(index); method.swap(); method.arraystore(); break;
method.pushInt(index); method.swap(); method.arraystore(); break;