comparison src/share/vm/interpreter/bytecodeInterpreter.cpp @ 14398:641d55c11d6b

8019517: PPC64 (part 102): cppInterpreter: implement G1 support Reviewed-by: kvn
author goetz
date Wed, 03 Jul 2013 01:29:13 +0200
parents 583211d4b16b
children 48b178ff07b6
comparison
equal deleted inserted replaced
14397:53fa76359eb1 14398:641d55c11d6b
28 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/bytecodeHistogram.hpp"
29 #include "interpreter/bytecodeInterpreter.hpp" 29 #include "interpreter/bytecodeInterpreter.hpp"
30 #include "interpreter/bytecodeInterpreter.inline.hpp" 30 #include "interpreter/bytecodeInterpreter.inline.hpp"
31 #include "interpreter/interpreter.hpp" 31 #include "interpreter/interpreter.hpp"
32 #include "interpreter/interpreterRuntime.hpp" 32 #include "interpreter/interpreterRuntime.hpp"
33 #include "memory/cardTableModRefBS.hpp"
34 #include "memory/resourceArea.hpp" 33 #include "memory/resourceArea.hpp"
35 #include "oops/methodCounters.hpp" 34 #include "oops/methodCounters.hpp"
36 #include "oops/objArrayKlass.hpp" 35 #include "oops/objArrayKlass.hpp"
37 #include "oops/oop.inline.hpp" 36 #include "oops/oop.inline.hpp"
38 #include "prims/jvmtiExport.hpp" 37 #include "prims/jvmtiExport.hpp"
501 // Screwups with stack management usually cause us to overwrite istate 500 // Screwups with stack management usually cause us to overwrite istate
502 // save a copy so we can verify it. 501 // save a copy so we can verify it.
503 interpreterState orig = istate; 502 interpreterState orig = istate;
504 #endif 503 #endif
505 504
506 static volatile jbyte* _byte_map_base; // adjusted card table base for oop store barrier
507
508 register intptr_t* topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */ 505 register intptr_t* topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */
509 register address pc = istate->bcp(); 506 register address pc = istate->bcp();
510 register jubyte opcode; 507 register jubyte opcode;
511 register intptr_t* locals = istate->locals(); 508 register intptr_t* locals = istate->locals();
512 register ConstantPoolCache* cp = istate->constants(); // method()->constants()->cache() 509 register ConstantPoolCache* cp = istate->constants(); // method()->constants()->cache()
513 #ifdef LOTS_OF_REGS 510 #ifdef LOTS_OF_REGS
514 register JavaThread* THREAD = istate->thread(); 511 register JavaThread* THREAD = istate->thread();
515 register volatile jbyte* BYTE_MAP_BASE = _byte_map_base;
516 #else 512 #else
517 #undef THREAD 513 #undef THREAD
518 #define THREAD istate->thread() 514 #define THREAD istate->thread()
519 #undef BYTE_MAP_BASE
520 #define BYTE_MAP_BASE _byte_map_base
521 #endif 515 #endif
522 516
523 #ifdef USELABELS 517 #ifdef USELABELS
524 const static void* const opclabels_data[256] = { 518 const static void* const opclabels_data[256] = {
525 /* 0x00 */ &&opc_nop, &&opc_aconst_null,&&opc_iconst_m1,&&opc_iconst_0, 519 /* 0x00 */ &&opc_nop, &&opc_aconst_null,&&opc_iconst_m1,&&opc_iconst_0,
628 if (initialized++) ShouldNotReachHere(); // Only one initialize call 622 if (initialized++) ShouldNotReachHere(); // Only one initialize call
629 _compiling = (UseCompiler || CountCompiledCalls); 623 _compiling = (UseCompiler || CountCompiledCalls);
630 #ifdef VM_JVMTI 624 #ifdef VM_JVMTI
631 _jvmti_interp_events = JvmtiExport::can_post_interpreter_events(); 625 _jvmti_interp_events = JvmtiExport::can_post_interpreter_events();
632 #endif 626 #endif
633 BarrierSet* bs = Universe::heap()->barrier_set();
634 assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
635 _byte_map_base = (volatile jbyte*)(((CardTableModRefBS*)bs)->byte_map_base);
636 return; 627 return;
637 } 628 }
638 break; 629 break;
639 case method_entry: { 630 case method_entry: {
640 THREAD->set_do_not_unlock(); 631 THREAD->set_do_not_unlock();
1706 // 1697 //
1707 if (rhsKlassOop != elemKlassOop && !rhsKlassOop->is_subtype_of(elemKlassOop)) { // ebx->is... 1698 if (rhsKlassOop != elemKlassOop && !rhsKlassOop->is_subtype_of(elemKlassOop)) { // ebx->is...
1708 VM_JAVA_ERROR(vmSymbols::java_lang_ArrayStoreException(), ""); 1699 VM_JAVA_ERROR(vmSymbols::java_lang_ArrayStoreException(), "");
1709 } 1700 }
1710 } 1701 }
1711 oop* elem_loc = (oop*)(((address) arrObj->base(T_OBJECT)) + index * sizeof(oop)); 1702 ((objArrayOopDesc *) arrObj)->obj_at_put(index, rhsObject);
1712 // *(oop*)(((address) arrObj->base(T_OBJECT)) + index * sizeof(oop)) = rhsObject;
1713 *elem_loc = rhsObject;
1714 // Mark the card
1715 OrderAccess::release_store(&BYTE_MAP_BASE[(uintptr_t)elem_loc >> CardTableModRefBS::card_shift], 0);
1716 UPDATE_PC_AND_TOS_AND_CONTINUE(1, -3); 1703 UPDATE_PC_AND_TOS_AND_CONTINUE(1, -3);
1717 } 1704 }
1718 CASE(_bastore): 1705 CASE(_bastore):
1719 ARRAY_STOREFROM32(T_BYTE, jbyte, "%d", STACK_INT, 0); 1706 ARRAY_STOREFROM32(T_BYTE, jbyte, "%d", STACK_INT, 0);
1720 CASE(_castore): 1707 CASE(_castore):
2050 if (tos_type == itos) { 2037 if (tos_type == itos) {
2051 obj->release_int_field_put(field_offset, STACK_INT(-1)); 2038 obj->release_int_field_put(field_offset, STACK_INT(-1));
2052 } else if (tos_type == atos) { 2039 } else if (tos_type == atos) {
2053 VERIFY_OOP(STACK_OBJECT(-1)); 2040 VERIFY_OOP(STACK_OBJECT(-1));
2054 obj->release_obj_field_put(field_offset, STACK_OBJECT(-1)); 2041 obj->release_obj_field_put(field_offset, STACK_OBJECT(-1));
2055 OrderAccess::release_store(&BYTE_MAP_BASE[(uintptr_t)obj >> CardTableModRefBS::card_shift], 0);
2056 } else if (tos_type == btos) { 2042 } else if (tos_type == btos) {
2057 obj->release_byte_field_put(field_offset, STACK_INT(-1)); 2043 obj->release_byte_field_put(field_offset, STACK_INT(-1));
2058 } else if (tos_type == ltos) { 2044 } else if (tos_type == ltos) {
2059 obj->release_long_field_put(field_offset, STACK_LONG(-1)); 2045 obj->release_long_field_put(field_offset, STACK_LONG(-1));
2060 } else if (tos_type == ctos) { 2046 } else if (tos_type == ctos) {
2071 if (tos_type == itos) { 2057 if (tos_type == itos) {
2072 obj->int_field_put(field_offset, STACK_INT(-1)); 2058 obj->int_field_put(field_offset, STACK_INT(-1));
2073 } else if (tos_type == atos) { 2059 } else if (tos_type == atos) {
2074 VERIFY_OOP(STACK_OBJECT(-1)); 2060 VERIFY_OOP(STACK_OBJECT(-1));
2075 obj->obj_field_put(field_offset, STACK_OBJECT(-1)); 2061 obj->obj_field_put(field_offset, STACK_OBJECT(-1));
2076 OrderAccess::release_store(&BYTE_MAP_BASE[(uintptr_t)obj >> CardTableModRefBS::card_shift], 0);
2077 } else if (tos_type == btos) { 2062 } else if (tos_type == btos) {
2078 obj->byte_field_put(field_offset, STACK_INT(-1)); 2063 obj->byte_field_put(field_offset, STACK_INT(-1));
2079 } else if (tos_type == ltos) { 2064 } else if (tos_type == ltos) {
2080 obj->long_field_put(field_offset, STACK_LONG(-1)); 2065 obj->long_field_put(field_offset, STACK_LONG(-1));
2081 } else if (tos_type == ctos) { 2066 } else if (tos_type == ctos) {