src/share/vm/c1/c1_ValueType.cpp

changeset 4037
da91efe96a93
parent 3969
1d7922586cf6
child 4051
8a02ca5e5576
     1.1 --- a/src/share/vm/c1/c1_ValueType.cpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/c1/c1_ValueType.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 @@ -85,22 +85,6 @@
    1.11  }
    1.12  
    1.13  
    1.14 -
    1.15 -jobject ObjectType::encoding() const {
    1.16 -  assert(is_constant(), "must be");
    1.17 -  return constant_value()->constant_encoding();
    1.18 -}
    1.19 -
    1.20 -bool ObjectType::is_loaded() const {
    1.21 -  assert(is_constant(), "must be");
    1.22 -  return constant_value()->is_loaded();
    1.23 -}
    1.24 -
    1.25 -ciObject* ObjectConstant::constant_value() const                   { return _value; }
    1.26 -ciObject* ArrayConstant::constant_value() const                    { return _value; }
    1.27 -ciObject* InstanceConstant::constant_value() const                 { return _value; }
    1.28 -ciObject* ClassConstant::constant_value() const                    { return _value; }
    1.29 -
    1.30  ciType* ObjectConstant::exact_type() const {
    1.31    ciObject* c = constant_value();
    1.32    return (c != NULL && !c->is_null_object()) ? c->klass() : NULL;
    1.33 @@ -114,11 +98,29 @@
    1.34    return (c != NULL && !c->is_null_object()) ? c->klass() : NULL;
    1.35  }
    1.36  ciType* ClassConstant::exact_type() const {
    1.37 -  ciObject* c = constant_value();
    1.38 -  return (c != NULL && !c->is_null_object()) ? c->klass() : NULL;
    1.39 +  return Compilation::current()->env()->Class_klass();
    1.40  }
    1.41  
    1.42  
    1.43 +jobject ObjectType::encoding() const {
    1.44 +  assert(is_constant(), "must be");
    1.45 +  return constant_value()->constant_encoding();
    1.46 +}
    1.47 +
    1.48 +bool ObjectType::is_loaded() const {
    1.49 +  assert(is_constant(), "must be");
    1.50 +  return constant_value()->is_loaded();
    1.51 +}
    1.52 +
    1.53 +bool MetadataType::is_loaded() const {
    1.54 +  assert(is_constant(), "must be");
    1.55 +  return constant_value()->is_loaded();
    1.56 +}
    1.57 +
    1.58 +ciObject* ObjectConstant::constant_value() const                   { return _value; }
    1.59 +ciObject* ArrayConstant::constant_value() const                    { return _value; }
    1.60 +ciObject* InstanceConstant::constant_value() const                 { return _value; }
    1.61 +
    1.62  ValueType* as_ValueType(BasicType type) {
    1.63    switch (type) {
    1.64      case T_VOID   : return voidType;

mercurial