1439 NewMultiArray(ciKlass* klass, Values* dims, ValueStack* state_before) : NewArray(NULL, state_before), _klass(klass), _dims(dims) { 1440 ASSERT_VALUES 1441 } 1442 1443 // accessors 1444 ciKlass* klass() const { return _klass; } 1445 Values* dims() const { return _dims; } 1446 int rank() const { return dims()->length(); } 1447 1448 // generic 1449 virtual void input_values_do(ValueVisitor* f) { 1450 // NOTE: we do not call NewArray::input_values_do since "length" 1451 // is meaningless for a multi-dimensional array; passing the 1452 // zeroth element down to NewArray as its length is a bad idea 1453 // since there will be a copy in the "dims" array which doesn't 1454 // get updated, and the value must not be traversed twice. Was bug 1455 // - kbr 4/10/2001 1456 StateSplit::input_values_do(f); 1457 for (int i = 0; i < _dims->length(); i++) f->visit(_dims->adr_at(i)); 1458 } 1459 }; 1460 1461 1462 BASE(TypeCheck, StateSplit) 1463 private: 1464 ciKlass* _klass; 1465 Value _obj; 1466 1467 ciMethod* _profiled_method; 1468 int _profiled_bci; 1469 1470 public: 1471 // creation 1472 TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before) 1473 : StateSplit(type, state_before), _klass(klass), _obj(obj), 1474 _profiled_method(NULL), _profiled_bci(0) { 1475 ASSERT_VALUES 1476 set_direct_compare(false); 1477 } 1478 | 1439 NewMultiArray(ciKlass* klass, Values* dims, ValueStack* state_before) : NewArray(NULL, state_before), _klass(klass), _dims(dims) { 1440 ASSERT_VALUES 1441 } 1442 1443 // accessors 1444 ciKlass* klass() const { return _klass; } 1445 Values* dims() const { return _dims; } 1446 int rank() const { return dims()->length(); } 1447 1448 // generic 1449 virtual void input_values_do(ValueVisitor* f) { 1450 // NOTE: we do not call NewArray::input_values_do since "length" 1451 // is meaningless for a multi-dimensional array; passing the 1452 // zeroth element down to NewArray as its length is a bad idea 1453 // since there will be a copy in the "dims" array which doesn't 1454 // get updated, and the value must not be traversed twice. Was bug 1455 // - kbr 4/10/2001 1456 StateSplit::input_values_do(f); 1457 for (int i = 0; i < _dims->length(); i++) f->visit(_dims->adr_at(i)); 1458 } 1459 1460 ciType* exact_type() const; 1461 }; 1462 1463 1464 BASE(TypeCheck, StateSplit) 1465 private: 1466 ciKlass* _klass; 1467 Value _obj; 1468 1469 ciMethod* _profiled_method; 1470 int _profiled_bci; 1471 1472 public: 1473 // creation 1474 TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before) 1475 : StateSplit(type, state_before), _klass(klass), _obj(obj), 1476 _profiled_method(NULL), _profiled_bci(0) { 1477 ASSERT_VALUES 1478 set_direct_compare(false); 1479 } 1480 |