< prev index next >

src/share/vm/runtime/javaCalls.cpp

Print this page




 550     }
 551 
 552     check_value(false);
 553     check_value(false);
 554   }
 555 
 556   void check_obj(BasicType t) {
 557     if (_is_return) {
 558       check_return_type(t);
 559       return;
 560     }
 561 
 562     intptr_t v = _value[_pos];
 563     if (v != 0) {
 564       // v is a "handle" referring to an oop, cast to integral type.
 565       // There shouldn't be any handles in very low memory.
 566       guarantee((size_t)v >= (size_t)os::vm_page_size(),
 567                 "Bad JNI oop argument %d: " PTR_FORMAT, _pos, v);
 568       // Verify the pointee.
 569       oop vv = resolve_indirect_oop(v, _value_state[_pos]);
 570       guarantee(vv->is_oop_or_null(true),
 571                 "Bad JNI oop argument %d: " PTR_FORMAT " -> " PTR_FORMAT,
 572                 _pos, v, p2i(vv));
 573     }
 574 
 575     check_value(true);          // Verify value state.
 576   }
 577 
 578   void do_bool()                       { check_int(T_BOOLEAN);       }
 579   void do_char()                       { check_int(T_CHAR);          }
 580   void do_float()                      { check_int(T_FLOAT);         }
 581   void do_double()                     { check_double(T_DOUBLE);     }
 582   void do_byte()                       { check_int(T_BYTE);          }
 583   void do_short()                      { check_int(T_SHORT);         }
 584   void do_int()                        { check_int(T_INT);           }
 585   void do_long()                       { check_long(T_LONG);         }
 586   void do_void()                       { check_return_type(T_VOID);  }
 587   void do_object(int begin, int end)   { check_obj(T_OBJECT);        }
 588   void do_array(int begin, int end)    { check_obj(T_OBJECT);        }
 589 };
 590 


 550     }
 551 
 552     check_value(false);
 553     check_value(false);
 554   }
 555 
 556   void check_obj(BasicType t) {
 557     if (_is_return) {
 558       check_return_type(t);
 559       return;
 560     }
 561 
 562     intptr_t v = _value[_pos];
 563     if (v != 0) {
 564       // v is a "handle" referring to an oop, cast to integral type.
 565       // There shouldn't be any handles in very low memory.
 566       guarantee((size_t)v >= (size_t)os::vm_page_size(),
 567                 "Bad JNI oop argument %d: " PTR_FORMAT, _pos, v);
 568       // Verify the pointee.
 569       oop vv = resolve_indirect_oop(v, _value_state[_pos]);
 570       guarantee(oopDesc::is_oop_or_null(vv, true),
 571                 "Bad JNI oop argument %d: " PTR_FORMAT " -> " PTR_FORMAT,
 572                 _pos, v, p2i(vv));
 573     }
 574 
 575     check_value(true);          // Verify value state.
 576   }
 577 
 578   void do_bool()                       { check_int(T_BOOLEAN);       }
 579   void do_char()                       { check_int(T_CHAR);          }
 580   void do_float()                      { check_int(T_FLOAT);         }
 581   void do_double()                     { check_double(T_DOUBLE);     }
 582   void do_byte()                       { check_int(T_BYTE);          }
 583   void do_short()                      { check_int(T_SHORT);         }
 584   void do_int()                        { check_int(T_INT);           }
 585   void do_long()                       { check_long(T_LONG);         }
 586   void do_void()                       { check_return_type(T_VOID);  }
 587   void do_object(int begin, int end)   { check_obj(T_OBJECT);        }
 588   void do_array(int begin, int end)    { check_obj(T_OBJECT);        }
 589 };
 590 
< prev index next >