From: <ls...@us...> - 2008-08-14 14:28:14
|
Revision: 4435 http://jnode.svn.sourceforge.net/jnode/?rev=4435&view=rev Author: lsantha Date: 2008-08-14 14:28:09 +0000 (Thu, 14 Aug 2008) Log Message: ----------- Added typecheck to do item to wastore. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2008-08-14 09:51:08 UTC (rev 4434) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2008-08-14 14:28:09 UTC (rev 4435) @@ -4289,6 +4289,8 @@ // Verify checkBounds(ref, idx); + //todo spec issue: add type compatibility check (elemType <- valueType), throw ArrayStoreException + // Store if (idx.isConstant()) { final int offset = idx.getValue() * scale; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-02-22 23:26:21
|
Revision: 5059 http://jnode.svn.sourceforge.net/jnode/?rev=5059&view=rev Author: konkubinaten Date: 2009-02-22 23:26:19 +0000 (Sun, 22 Feb 2009) Log Message: ----------- cleanup l1a compiler, removing debug info as testcase should the code is correct. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2009-02-22 01:26:11 UTC (rev 5058) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2009-02-22 23:26:19 UTC (rev 5059) @@ -1647,11 +1647,12 @@ * @see org.jnode.vm.bytecode.BytecodeVisitor#visit_dup2_x2() */ public final void visit_dup2_x2() { + + // TODO: port to ORP style + // Push all on the stack, since this opcode is just too complicated vstack.push(eContext); - System.out.println("####### dup2_x2"); - final Item v1 = vstack.pop1(); final Item v2 = vstack.pop1(); final int c1 = v1.getCategory(); @@ -1709,77 +1710,6 @@ } /** - * New version, corrects issue 760 - * @see org.jnode.vm.bytecode.BytecodeVisitor#visit_dup2_x2() - * - public final void visit_dup2_x2() { - - // Push all on the stack, since this opcode is just too complicated - vstack.push(eContext); - - System.out.println("NEW dup2_x2"); - - final Item v1 = vstack.pop1(); - final Item v2 = vstack.pop1(); - final int c1 = v1.getCategory(); - final int c2 = v2.getCategory(); - - // Perform a stack swap independent of the actual form - os.writePOP(helper.AAX); // Value1 - os.writePOP(helper.ABX); // Value2 - os.writePOP(helper.ACX); // Value3 - os.writePOP(helper.ADX); // Value4 - os.writePUSH(helper.ABX); // Value2 - os.writePUSH(helper.AAX); // Value1 - os.writePUSH(helper.ADX); // Value4 - os.writePUSH(helper.ACX); // Value3 - os.writePUSH(helper.ABX); // Value2 - os.writePUSH(helper.AAX); // Value1 - - // Now update the operandstack - // cope with brain-dead definition from Sun (look-like somebody there - // was to eager to optimize this and it landed in the compiler... - if (c1 == 2) { - if (c2 == 2) { - // form 4 - vstack.push1(ifac.createStack(v1.getType())); - vstack.push1(v2); - vstack.push1(v1); - } else { - // form 2 - final Item v3 = vstack.pop1(); - int c3 = v3.getCategory(); - assertCondition(c3 == 1, "category mismatch"); - vstack.push1(ifac.createStack(v1.getType())); - vstack.push1(v3); - vstack.push1(v2); - vstack.push1(v1); - } - } else { - assertCondition(c2 == 1, "category mismatch"); - final Item v3 = vstack.pop1(); - int c3 = v3.getCategory(); - if (c3 == 2) { - // form 3 - vstack.push1(ifac.createStack(v2.getType())); - vstack.push1(ifac.createStack(v1.getType())); - vstack.push1(v3); - vstack.push1(v2); - vstack.push1(v1); - } else { - // form 1 - final Item v4 = vstack.pop1(); - vstack.push1(ifac.createStack(v2.getType())); - vstack.push1(ifac.createStack(v1.getType())); - vstack.push1(v4); - vstack.push1(v3); - vstack.push1(v2); - vstack.push1(v1); - } - } - }*/ - - /** * @see org.jnode.vm.bytecode.BytecodeVisitor#visit_f2d() */ public final void visit_f2d() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-02-20 11:09:59
|
Revision: 5731 http://jnode.svn.sourceforge.net/jnode/?rev=5731&view=rev Author: lsantha Date: 2010-02-20 11:09:53 +0000 (Sat, 20 Feb 2010) Log Message: ----------- Cleanup of optimization experiments. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2010-02-20 10:24:46 UTC (rev 5730) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2010-02-20 11:09:53 UTC (rev 5731) @@ -20,8 +20,6 @@ package org.jnode.vm.x86.compiler.l1a; -import java.util.HashMap; -import java.util.Map; import org.jnode.assembler.Label; import org.jnode.assembler.NativeStream; import org.jnode.assembler.x86.X86Assembler; @@ -221,16 +219,6 @@ private byte inlineDepth; /** - * Register used by wstore (see xloadStored methods) - */ - private GPR wstoreReg; - - /** - * Constant values that are stored in local variables - */ - private Map<Integer, Item> constLocals = new HashMap<Integer, Item>(); - - /** * The current basic block */ private BasicBlock currentBasicBlock; @@ -653,11 +641,6 @@ */ public void endMethod() { stackFrame.emitTrailer(typeSizeInfo, maxLocals); - //release constant local items - for (Item item : constLocals.values()) - item.release(eContext); - // Clear all constant locals - constLocals.clear(); if (ItemFactory.CHECK_BALANCED_ITEM_FACTORY) { if (!ifac.isBalanced()) { System.out.println("WARNING: unbalanced item handling in " + currentMethod.getFullName()); @@ -1082,12 +1065,6 @@ final TypeStack tstack = bb.getStartStack(); vstack.pushAll(ifac, tstack); - //release constant local items - for (Item item : constLocals.values()) - item.release(eContext); - // Clear all constant locals - constLocals.clear(); - if (debug) { BootLog.debug("-- VStack: " + vstack.toString()); } @@ -2502,11 +2479,6 @@ } else { os.writeADD(BITS32, helper.BP, ebpOfs, incValue); } - - // Local no longer constant - Item item = constLocals.remove(index); - if (item != null) - item.release(eContext); } /** @@ -4344,16 +4316,7 @@ * @param index */ private void wload(int jvmType, int index, boolean useStored) { - Item constValue = constLocals.get(index); - if (constValue != null) { - counters.getCounter("const-local").inc(); - vstack.push(constValue.clone(eContext)); - } else if (false && useStored && (wstoreReg != null)) { - vstack.push(L1AHelper.requestWordRegister(eContext, jvmType, wstoreReg)); - } else { - vstack.push(ifac.createLocal(jvmType, stackFrame - .getEbpOffset(typeSizeInfo, index))); - } + vstack.push(ifac.createLocal(jvmType, stackFrame.getEbpOffset(typeSizeInfo, index))); } /** @@ -4390,25 +4353,12 @@ */ private void wstore(int jvmType, int index) { final int disp = stackFrame.getEbpOffset(typeSizeInfo, index); - wstoreReg = null; - // Pin down (load) other references to this local vstack.loadLocal(eContext, disp); // Load final WordItem val = (WordItem) vstack.pop(jvmType); final boolean vconst = val.isConstant(); - if (vconst) { - // Store constant locals - Item item = constLocals.put(index, val.clone(eContext)); - if (item != null) - item.release(eContext); - } else { - // Not constant anymore, remove it - Item item = constLocals.remove(index); - if (item != null) - item.release(eContext); - } if (vconst && (jvmType == JvmType.INT)) { if (localEscapesBasicBlock(index)) { // Store constant int @@ -4443,7 +4393,6 @@ final GPR valr = val.getRegister(); // Store os.writeMOV(valr.getSize(), helper.BP, disp, valr); - wstoreReg = valr; } // Release This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |