comparison src/cpu/x86/vm/stubGenerator_x86_32.cpp @ 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 1d7922586cf6
children d8ce2825b193
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 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.
26 #include "asm/assembler.hpp" 26 #include "asm/assembler.hpp"
27 #include "assembler_x86.inline.hpp" 27 #include "assembler_x86.inline.hpp"
28 #include "interpreter/interpreter.hpp" 28 #include "interpreter/interpreter.hpp"
29 #include "nativeInst_x86.hpp" 29 #include "nativeInst_x86.hpp"
30 #include "oops/instanceOop.hpp" 30 #include "oops/instanceOop.hpp"
31 #include "oops/methodOop.hpp" 31 #include "oops/method.hpp"
32 #include "oops/objArrayKlass.hpp" 32 #include "oops/objArrayKlass.hpp"
33 #include "oops/oop.inline.hpp" 33 #include "oops/oop.inline.hpp"
34 #include "prims/methodHandles.hpp" 34 #include "prims/methodHandles.hpp"
35 #include "runtime/frame.inline.hpp" 35 #include "runtime/frame.inline.hpp"
36 #include "runtime/handles.inline.hpp" 36 #include "runtime/handles.inline.hpp"
232 __ decrement(rcx); 232 __ decrement(rcx);
233 __ jcc(Assembler::notZero, loop); 233 __ jcc(Assembler::notZero, loop);
234 234
235 // call Java function 235 // call Java function
236 __ BIND(parameters_done); 236 __ BIND(parameters_done);
237 __ movptr(rbx, method); // get methodOop 237 __ movptr(rbx, method); // get Method*
238 __ movptr(rax, entry_point); // get entry_point 238 __ movptr(rax, entry_point); // get entry_point
239 __ mov(rsi, rsp); // set sender sp 239 __ mov(rsi, rsp); // set sender sp
240 BLOCK_COMMENT("call Java function"); 240 BLOCK_COMMENT("call Java function");
241 __ call(rax); 241 __ call(rax);
242 242
680 __ mov(rdx, rax); 680 __ mov(rdx, rax);
681 __ andptr(rdx, oop_mask); 681 __ andptr(rdx, oop_mask);
682 __ cmpptr(rdx, oop_bits); 682 __ cmpptr(rdx, oop_bits);
683 __ jcc(Assembler::notZero, error); 683 __ jcc(Assembler::notZero, error);
684 684
685 // make sure klass is 'reasonable' 685 // make sure klass is 'reasonable', which is not zero.
686 __ movptr(rax, Address(rax, oopDesc::klass_offset_in_bytes())); // get klass 686 __ movptr(rax, Address(rax, oopDesc::klass_offset_in_bytes())); // get klass
687 __ testptr(rax, rax); 687 __ testptr(rax, rax);
688 __ jcc(Assembler::zero, error); // if klass is NULL it is broken 688 __ jcc(Assembler::zero, error); // if klass is NULL it is broken
689 689 // TODO: Future assert that klass is lower 4g memory for UseCompressedKlassPointers
690 // Check if the klass is in the right area of memory
691 const int klass_mask = Universe::verify_klass_mask();
692 const int klass_bits = Universe::verify_klass_bits();
693 __ mov(rdx, rax);
694 __ andptr(rdx, klass_mask);
695 __ cmpptr(rdx, klass_bits);
696 __ jcc(Assembler::notZero, error);
697
698 // make sure klass' klass is 'reasonable'
699 __ movptr(rax, Address(rax, oopDesc::klass_offset_in_bytes())); // get klass' klass
700 __ testptr(rax, rax);
701 __ jcc(Assembler::zero, error); // if klass' klass is NULL it is broken
702
703 __ mov(rdx, rax);
704 __ andptr(rdx, klass_mask);
705 __ cmpptr(rdx, klass_bits);
706 __ jcc(Assembler::notZero, error); // if klass not in right area
707 // of memory it is broken too.
708 690
709 // return if everything seems ok 691 // return if everything seems ok
710 __ bind(exit); 692 __ bind(exit);
711 __ movptr(rax, Address(rsp, 5 * wordSize)); // get saved rax, back 693 __ movptr(rax, Address(rsp, 5 * wordSize)); // get saved rax, back
712 __ pop(rdx); // restore rdx 694 __ pop(rdx); // restore rdx