src/share/vm/c1/c1_Instruction.cpp

changeset 4037
da91efe96a93
parent 4003
7a302948f5a4
child 4536
37c18711a0df
     1.1 --- a/src/share/vm/c1/c1_Instruction.cpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/c1/c1_Instruction.cpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -396,6 +396,8 @@
    1.11      switch (type()->tag()) {
    1.12      case intTag:
    1.13        return HASH2(name(), type()->as_IntConstant()->value());
    1.14 +    case addressTag:
    1.15 +      return HASH2(name(), type()->as_AddressConstant()->value());
    1.16      case longTag:
    1.17        {
    1.18          jlong temp = type()->as_LongConstant()->value();
    1.19 @@ -411,6 +413,11 @@
    1.20      case objectTag:
    1.21        assert(type()->as_ObjectType()->is_loaded(), "can't handle unloaded values");
    1.22        return HASH2(name(), type()->as_ObjectType()->constant_value());
    1.23 +    case metaDataTag:
    1.24 +      assert(type()->as_MetadataType()->is_loaded(), "can't handle unloaded values");
    1.25 +      return HASH2(name(), type()->as_MetadataType()->constant_value());
    1.26 +    default:
    1.27 +      ShouldNotReachHere();
    1.28      }
    1.29    }
    1.30    return 0;
    1.31 @@ -456,6 +463,14 @@
    1.32                  t1->is_loaded() && t2->is_loaded() &&
    1.33                  t1->constant_value() == t2->constant_value());
    1.34        }
    1.35 +    case metaDataTag:
    1.36 +      {
    1.37 +        MetadataType* t1 =    type()->as_MetadataType();
    1.38 +        MetadataType* t2 = v->type()->as_MetadataType();
    1.39 +        return (t1 != NULL && t2 != NULL &&
    1.40 +                t1->is_loaded() && t2->is_loaded() &&
    1.41 +                t1->constant_value() == t2->constant_value());
    1.42 +      }
    1.43    }
    1.44    return false;
    1.45  }
    1.46 @@ -508,6 +523,18 @@
    1.47      }
    1.48      break;
    1.49    }
    1.50 +  case metaDataTag: {
    1.51 +    ciMetadata* xvalue = lt->as_MetadataType()->constant_value();
    1.52 +    ciMetadata* yvalue = rt->as_MetadataType()->constant_value();
    1.53 +    assert(xvalue != NULL && yvalue != NULL, "not constants");
    1.54 +    if (xvalue->is_loaded() && yvalue->is_loaded()) {
    1.55 +      switch (cond) {
    1.56 +      case If::eql: return xvalue == yvalue ? cond_true : cond_false;
    1.57 +      case If::neq: return xvalue != yvalue ? cond_true : cond_false;
    1.58 +      }
    1.59 +    }
    1.60 +    break;
    1.61 +  }
    1.62    }
    1.63    return not_comparable;
    1.64  }

mercurial