hotspot/src/share/vm/c1/c1_CodeStubs.hpp
changeset 13728 882756847a04
parent 13486 4f0635e148c1
child 15482 470d0b0c09f1
--- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -346,7 +346,8 @@
  public:
   enum PatchID {
     access_field_id,
-    load_klass_id
+    load_klass_id,
+    load_mirror_id
   };
   enum constants {
     patch_info_size = 3
@@ -360,7 +361,7 @@
   Label         _patch_site_continuation;
   Register      _obj;
   CodeEmitInfo* _info;
-  int           _oop_index;  // index of the patchable oop in nmethod oop table if needed
+  int           _index;  // index of the patchable oop or Klass* in nmethod oop or metadata table if needed
   static int    _patch_info_offset;
 
   void align_patch_site(MacroAssembler* masm);
@@ -368,10 +369,10 @@
  public:
   static int patch_info_offset() { return _patch_info_offset; }
 
-  PatchingStub(MacroAssembler* masm, PatchID id, int oop_index = -1):
+  PatchingStub(MacroAssembler* masm, PatchID id, int index = -1):
       _id(id)
     , _info(NULL)
-    , _oop_index(oop_index) {
+    , _index(index) {
     if (os::is_MP()) {
       // force alignment of patch sites on MP hardware so we
       // can guarantee atomic writes to the patch site.
@@ -399,8 +400,8 @@
       }
       NativeMovRegMem* n_move = nativeMovRegMem_at(pc_start());
       n_move->set_offset(field_offset);
-    } else if (_id == load_klass_id) {
-      assert(_obj != noreg, "must have register object for load_klass");
+    } else if (_id == load_klass_id || _id == load_mirror_id) {
+      assert(_obj != noreg, "must have register object for load_klass/load_mirror");
 #ifdef ASSERT
       // verify that we're pointing at a NativeMovConstReg
       nativeMovConstReg_at(pc_start());