Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_CodeStubs.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 | 09aad8452938 |
children | db9981fd3124 |
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. |
344 | 344 |
345 class PatchingStub: public CodeStub { | 345 class PatchingStub: public CodeStub { |
346 public: | 346 public: |
347 enum PatchID { | 347 enum PatchID { |
348 access_field_id, | 348 access_field_id, |
349 load_klass_id | 349 load_klass_id, |
350 load_mirror_id | |
350 }; | 351 }; |
351 enum constants { | 352 enum constants { |
352 patch_info_size = 3 | 353 patch_info_size = 3 |
353 }; | 354 }; |
354 private: | 355 private: |
358 Label _patched_code_entry; | 359 Label _patched_code_entry; |
359 Label _patch_site_entry; | 360 Label _patch_site_entry; |
360 Label _patch_site_continuation; | 361 Label _patch_site_continuation; |
361 Register _obj; | 362 Register _obj; |
362 CodeEmitInfo* _info; | 363 CodeEmitInfo* _info; |
363 int _oop_index; // index of the patchable oop in nmethod oop table if needed | 364 int _index; // index of the patchable oop or Klass* in nmethod oop or metadata table if needed |
364 static int _patch_info_offset; | 365 static int _patch_info_offset; |
365 | 366 |
366 void align_patch_site(MacroAssembler* masm); | 367 void align_patch_site(MacroAssembler* masm); |
367 | 368 |
368 public: | 369 public: |
369 static int patch_info_offset() { return _patch_info_offset; } | 370 static int patch_info_offset() { return _patch_info_offset; } |
370 | 371 |
371 PatchingStub(MacroAssembler* masm, PatchID id, int oop_index = -1): | 372 PatchingStub(MacroAssembler* masm, PatchID id, int index = -1): |
372 _id(id) | 373 _id(id) |
373 , _info(NULL) | 374 , _info(NULL) |
374 , _oop_index(oop_index) { | 375 , _index(index) { |
375 if (os::is_MP()) { | 376 if (os::is_MP()) { |
376 // force alignment of patch sites on MP hardware so we | 377 // force alignment of patch sites on MP hardware so we |
377 // can guarantee atomic writes to the patch site. | 378 // can guarantee atomic writes to the patch site. |
378 align_patch_site(masm); | 379 align_patch_site(masm); |
379 } | 380 } |
397 case lir_patch_normal: field_offset = 0; break; | 398 case lir_patch_normal: field_offset = 0; break; |
398 default: ShouldNotReachHere(); | 399 default: ShouldNotReachHere(); |
399 } | 400 } |
400 NativeMovRegMem* n_move = nativeMovRegMem_at(pc_start()); | 401 NativeMovRegMem* n_move = nativeMovRegMem_at(pc_start()); |
401 n_move->set_offset(field_offset); | 402 n_move->set_offset(field_offset); |
402 } else if (_id == load_klass_id) { | 403 } else if (_id == load_klass_id || _id == load_mirror_id) { |
403 assert(_obj != noreg, "must have register object for load_klass"); | 404 assert(_obj != noreg, "must have register object for load_klass/load_mirror"); |
404 #ifdef ASSERT | 405 #ifdef ASSERT |
405 // verify that we're pointing at a NativeMovConstReg | 406 // verify that we're pointing at a NativeMovConstReg |
406 nativeMovConstReg_at(pc_start()); | 407 nativeMovConstReg_at(pc_start()); |
407 #endif | 408 #endif |
408 } else { | 409 } else { |