comparison src/share/vm/interpreter/bytecodes.hpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 7f813940ac35
children beebba0acc11
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
351 static void pd_initialize(); // platform specific initialization 351 static void pd_initialize(); // platform specific initialization
352 static Code pd_base_code_for(Code code); // platform specific base_code_for implementation 352 static Code pd_base_code_for(Code code); // platform specific base_code_for implementation
353 353
354 // Verify that bcp points into method 354 // Verify that bcp points into method
355 #ifdef ASSERT 355 #ifdef ASSERT
356 static bool check_method(const methodOopDesc* method, address bcp); 356 static bool check_method(const Method* method, address bcp);
357 #endif 357 #endif
358 static bool check_must_rewrite(Bytecodes::Code bc); 358 static bool check_must_rewrite(Bytecodes::Code bc);
359 359
360 public: 360 public:
361 // Conversion 361 // Conversion
366 366
367 // Fetch a bytecode, hiding breakpoints as necessary. The method 367 // Fetch a bytecode, hiding breakpoints as necessary. The method
368 // argument is used for conversion of breakpoints into the original 368 // argument is used for conversion of breakpoints into the original
369 // bytecode. The CI uses these methods but guarantees that 369 // bytecode. The CI uses these methods but guarantees that
370 // breakpoints are hidden so the method argument should be passed as 370 // breakpoints are hidden so the method argument should be passed as
371 // NULL since in that case the bcp and methodOop are unrelated 371 // NULL since in that case the bcp and Method* are unrelated
372 // memory. 372 // memory.
373 static Code code_at(const methodOopDesc* method, address bcp) { 373 static Code code_at(const Method* method, address bcp) {
374 assert(method == NULL || check_method(method, bcp), "bcp must point into method"); 374 assert(method == NULL || check_method(method, bcp), "bcp must point into method");
375 Code code = cast(*bcp); 375 Code code = cast(*bcp);
376 assert(code != _breakpoint || method != NULL, "need methodOop to decode breakpoint"); 376 assert(code != _breakpoint || method != NULL, "need Method* to decode breakpoint");
377 return (code != _breakpoint) ? code : non_breakpoint_code_at(method, bcp); 377 return (code != _breakpoint) ? code : non_breakpoint_code_at(method, bcp);
378 } 378 }
379 static Code java_code_at(const methodOopDesc* method, address bcp) { 379 static Code java_code_at(const Method* method, address bcp) {
380 return java_code(code_at(method, bcp)); 380 return java_code(code_at(method, bcp));
381 } 381 }
382 382
383 // Fetch a bytecode or a breakpoint: 383 // Fetch a bytecode or a breakpoint:
384 static Code code_or_bp_at(address bcp) { return (Code)cast(*bcp); } 384 static Code code_or_bp_at(address bcp) { return (Code)cast(*bcp); }
385 385
386 static Code code_at(methodOop method, int bci); 386 static Code code_at(Method* method, int bci);
387 static bool is_active_breakpoint_at(address bcp) { return (Code)*bcp == _breakpoint; } 387 static bool is_active_breakpoint_at(address bcp) { return (Code)*bcp == _breakpoint; }
388 388
389 // find a bytecode, behind a breakpoint if necessary: 389 // find a bytecode, behind a breakpoint if necessary:
390 static Code non_breakpoint_code_at(const methodOopDesc* method, address bcp); 390 static Code non_breakpoint_code_at(const Method* method, address bcp);
391 391
392 // Bytecode attributes 392 // Bytecode attributes
393 static bool is_defined (int code) { return 0 <= code && code < number_of_codes && flags(code, false) != 0; } 393 static bool is_defined (int code) { return 0 <= code && code < number_of_codes && flags(code, false) != 0; }
394 static bool wide_is_defined(int code) { return is_defined(code) && flags(code, true) != 0; } 394 static bool wide_is_defined(int code) { return is_defined(code) && flags(code, true) != 0; }
395 static const char* name (Code code) { check(code); return _name [code]; } 395 static const char* name (Code code) { check(code); return _name [code]; }
406 static bool native_byte_order(Code code) { check(code); return has_all_flags(code, _fmt_has_nbo, false); } 406 static bool native_byte_order(Code code) { check(code); return has_all_flags(code, _fmt_has_nbo, false); }
407 static bool uses_cp_cache (Code code) { check(code); return has_all_flags(code, _fmt_has_j, false); } 407 static bool uses_cp_cache (Code code) { check(code); return has_all_flags(code, _fmt_has_j, false); }
408 // if 'end' is provided, it indicates the end of the code buffer which 408 // if 'end' is provided, it indicates the end of the code buffer which
409 // should not be read past when parsing. 409 // should not be read past when parsing.
410 static int special_length_at(Bytecodes::Code code, address bcp, address end = NULL); 410 static int special_length_at(Bytecodes::Code code, address bcp, address end = NULL);
411 static int special_length_at(methodOop method, address bcp, address end = NULL) { return special_length_at(code_at(method, bcp), bcp, end); } 411 static int special_length_at(Method* method, address bcp, address end = NULL) { return special_length_at(code_at(method, bcp), bcp, end); }
412 static int raw_special_length_at(address bcp, address end = NULL); 412 static int raw_special_length_at(address bcp, address end = NULL);
413 static int length_for_code_at(Bytecodes::Code code, address bcp) { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); } 413 static int length_for_code_at(Bytecodes::Code code, address bcp) { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); }
414 static int length_at (methodOop method, address bcp) { return length_for_code_at(code_at(method, bcp), bcp); } 414 static int length_at (Method* method, address bcp) { return length_for_code_at(code_at(method, bcp), bcp); }
415 static int java_length_at (methodOop method, address bcp) { return length_for_code_at(java_code_at(method, bcp), bcp); } 415 static int java_length_at (Method* method, address bcp) { return length_for_code_at(java_code_at(method, bcp), bcp); }
416 static bool is_java_code (Code code) { return 0 <= code && code < number_of_java_codes; } 416 static bool is_java_code (Code code) { return 0 <= code && code < number_of_java_codes; }
417 417
418 static bool is_aload (Code code) { return (code == _aload || code == _aload_0 || code == _aload_1 418 static bool is_aload (Code code) { return (code == _aload || code == _aload_0 || code == _aload_1
419 || code == _aload_2 || code == _aload_3); } 419 || code == _aload_2 || code == _aload_3); }
420 static bool is_astore (Code code) { return (code == _astore || code == _astore_0 || code == _astore_1 420 static bool is_astore (Code code) { return (code == _astore || code == _astore_0 || code == _astore_1