src/share/vm/opto/library_call.cpp

changeset 2101
4b29a725c43c
parent 1964
4311f23817fd
child 2103
3e8fbc61cee8
     1.1 --- a/src/share/vm/opto/library_call.cpp	Thu Aug 19 14:51:47 2010 -0700
     1.2 +++ b/src/share/vm/opto/library_call.cpp	Fri Aug 20 23:40:30 2010 -0700
     1.3 @@ -906,7 +906,8 @@
     1.4    const int count_offset = java_lang_String::count_offset_in_bytes();
     1.5    const int offset_offset = java_lang_String::offset_offset_in_bytes();
     1.6  
     1.7 -  _sp += 2;
     1.8 +  int nargs = 2;
     1.9 +  _sp += nargs;
    1.10    Node* argument = pop();  // pop non-receiver first:  it was pushed second
    1.11    Node* receiver = pop();
    1.12  
    1.13 @@ -914,11 +915,11 @@
    1.14    // null check technically happens in the wrong place, which can lead to
    1.15    // invalid stack traces when string compare is inlined into a method
    1.16    // which handles NullPointerExceptions.
    1.17 -  _sp += 2;
    1.18 +  _sp += nargs;
    1.19    receiver = do_null_check(receiver, T_OBJECT);
    1.20    //should not do null check for argument for String.equals(), because spec
    1.21    //allows to specify NULL as argument.
    1.22 -  _sp -= 2;
    1.23 +  _sp -= nargs;
    1.24  
    1.25    if (stopped()) {
    1.26      return true;
    1.27 @@ -943,7 +944,9 @@
    1.28    ciInstanceKlass* klass = env()->String_klass();
    1.29  
    1.30    if (!stopped()) {
    1.31 +    _sp += nargs;          // gen_instanceof might do an uncommon trap
    1.32      Node* inst = gen_instanceof(argument, makecon(TypeKlassPtr::make(klass)));
    1.33 +    _sp -= nargs;
    1.34      Node* cmp  = _gvn.transform(new (C, 3) CmpINode(inst, intcon(1)));
    1.35      Node* bol  = _gvn.transform(new (C, 2) BoolNode(cmp, BoolTest::ne));
    1.36  
    1.37 @@ -2935,7 +2938,9 @@
    1.38    switch (id) {
    1.39    case vmIntrinsics::_isInstance:
    1.40      // nothing is an instance of a primitive type
    1.41 +    _sp += nargs;          // gen_instanceof might do an uncommon trap
    1.42      query_value = gen_instanceof(obj, kls);
    1.43 +    _sp -= nargs;
    1.44      break;
    1.45  
    1.46    case vmIntrinsics::_getModifiers:

mercurial