summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2004-06-15 14:40:27 +0000
committerschinz <schinz@epfl.ch>2004-06-15 14:40:27 +0000
commit2090a468ef5683ac4dc73ec81fee385ee3b8f304 (patch)
tree2a85ff414519e346ad57780aa644ac2d7c1c0ea3 /sources
parent1da220d96b9fe702cd904b6978a6d9f341bba8fa (diff)
downloadscala-2090a468ef5683ac4dc73ec81fee385ee3b8f304.tar.gz
scala-2090a468ef5683ac4dc73ec81fee385ee3b8f304.tar.bz2
scala-2090a468ef5683ac4dc73ec81fee385ee3b8f304.zip
- bug fix: differentiate between jumping and no...
- bug fix: differentiate between jumping and non-jumping primitives
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/backend/jvm/GenJVM.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java
index 1ea75caf90..d71dd912bd 100644
--- a/sources/scalac/backend/jvm/GenJVM.java
+++ b/sources/scalac/backend/jvm/GenJVM.java
@@ -675,7 +675,7 @@ class GenJVM {
throws JCode.OffsetTooBigException {
switch (tree) {
case Apply(Tree fun, Tree[] args):
- if (isKnownPrimitive(fun.symbol())) {
+ if (isJumpingPrimitive(fun.symbol())) {
Primitive prim = prims.getPrimitive(fun.symbol());
Tree[] allArgs = extractPrimitiveArgs((Tree.Apply)tree);
@@ -1156,17 +1156,35 @@ class GenJVM {
/**
* Return true iff the given symbol is a primitive, AND that
+ * primitive is recognized by this back-end, AND that primitive is
+ * a "jumping" one.
+ */
+ protected boolean isJumpingPrimitive(Symbol sym) {
+ if (prims.isPrimitive(sym)) {
+ switch (prims.getPrimitive(sym)) {
+ case ID : case EQ : case NE :
+ case LT : case LE : case GE : case GT :
+ case ZNOT : case ZOR : case ZAND :
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Return true iff the given symbol is a primitive, AND that
* primitive is recognized by this back-end.
*/
protected boolean isKnownPrimitive(Symbol sym) {
+ if (isJumpingPrimitive(sym))
+ return true;
+
if (prims.isPrimitive(sym)) {
switch (prims.getPrimitive(sym)) {
case POS : case NEG :
case ADD : case SUB : case MUL : case DIV : case MOD :
case NOT : case OR : case XOR : case AND :
case LSL : case LSR : case ASR :
- case EQ : case NE : case LT : case LE : case GE : case GT :
- case ZNOT : case ZOR : case ZAND :
case NEW_ZARRAY : case NEW_BARRAY : case NEW_SARRAY :
case NEW_CARRAY : case NEW_IARRAY : case NEW_LARRAY :
case NEW_FARRAY : case NEW_DARRAY : case NEW_OARRAY :