Mercurial > hg > truffle
comparison src/share/vm/oops/method.hpp @ 6934:4735d2c84362
7200776: Implement default methods in interfaces
Summary: Add generic type analysis and default method selection algorithms
Reviewed-by: coleenp, acorn
author | kamg |
---|---|
date | Thu, 11 Oct 2012 12:25:42 -0400 |
parents | 9191895df19d |
children | 18fb7da42534 |
comparison
equal
deleted
inserted
replaced
6921:a1b8cf9cf970 | 6934:4735d2c84362 |
---|---|
28 #include "classfile/vmSymbols.hpp" | 28 #include "classfile/vmSymbols.hpp" |
29 #include "code/compressedStream.hpp" | 29 #include "code/compressedStream.hpp" |
30 #include "compiler/oopMap.hpp" | 30 #include "compiler/oopMap.hpp" |
31 #include "interpreter/invocationCounter.hpp" | 31 #include "interpreter/invocationCounter.hpp" |
32 #include "oops/annotations.hpp" | 32 #include "oops/annotations.hpp" |
33 #include "oops/constMethod.hpp" | |
34 #include "oops/constantPool.hpp" | 33 #include "oops/constantPool.hpp" |
35 #include "oops/instanceKlass.hpp" | 34 #include "oops/instanceKlass.hpp" |
36 #include "oops/oop.hpp" | 35 #include "oops/oop.hpp" |
37 #include "oops/typeArrayOop.hpp" | 36 #include "oops/typeArrayOop.hpp" |
38 #include "utilities/accessFlags.hpp" | 37 #include "utilities/accessFlags.hpp" |
102 | 101 |
103 class CheckedExceptionElement; | 102 class CheckedExceptionElement; |
104 class LocalVariableTableElement; | 103 class LocalVariableTableElement; |
105 class AdapterHandlerEntry; | 104 class AdapterHandlerEntry; |
106 class MethodData; | 105 class MethodData; |
106 class ConstMethod; | |
107 | 107 |
108 class Method : public Metadata { | 108 class Method : public Metadata { |
109 friend class VMStructs; | 109 friend class VMStructs; |
110 private: | 110 private: |
111 ConstMethod* _constMethod; // Method read-only data. | 111 ConstMethod* _constMethod; // Method read-only data. |
156 volatile address _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry | 156 volatile address _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry |
157 | 157 |
158 // Constructor | 158 // Constructor |
159 Method(ConstMethod* xconst, AccessFlags access_flags, int size); | 159 Method(ConstMethod* xconst, AccessFlags access_flags, int size); |
160 public: | 160 public: |
161 | |
161 static Method* allocate(ClassLoaderData* loader_data, | 162 static Method* allocate(ClassLoaderData* loader_data, |
162 int byte_code_size, | 163 int byte_code_size, |
163 AccessFlags access_flags, | 164 AccessFlags access_flags, |
164 int compressed_line_number_size, | 165 int compressed_line_number_size, |
165 int localvariable_table_length, | 166 int localvariable_table_length, |
166 int exception_table_length, | 167 int exception_table_length, |
167 int checked_exceptions_length, | 168 int checked_exceptions_length, |
168 TRAPS); | 169 ConstMethod::MethodType method_type, |
170 TRAPS); | |
169 | 171 |
170 Method() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } | 172 Method() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } |
171 | 173 |
172 // The Method vtable is restored by this call when the Method is in the | 174 // The Method vtable is restored by this call when the Method is in the |
173 // shared archive. See patch_klass_vtables() in metaspaceShared.cpp for | 175 // shared archive. See patch_klass_vtables() in metaspaceShared.cpp for |
723 void set_force_inline(bool x) { _force_inline = x; } | 725 void set_force_inline(bool x) { _force_inline = x; } |
724 bool dont_inline() { return _dont_inline; } | 726 bool dont_inline() { return _dont_inline; } |
725 void set_dont_inline(bool x) { _dont_inline = x; } | 727 void set_dont_inline(bool x) { _dont_inline = x; } |
726 bool is_hidden() { return _hidden; } | 728 bool is_hidden() { return _hidden; } |
727 void set_hidden(bool x) { _hidden = x; } | 729 void set_hidden(bool x) { _hidden = x; } |
730 ConstMethod::MethodType method_type() const { | |
731 return _constMethod->method_type(); | |
732 } | |
733 bool is_overpass() const { return method_type() == ConstMethod::OVERPASS; } | |
728 | 734 |
729 // On-stack replacement support | 735 // On-stack replacement support |
730 bool has_osr_nmethod(int level, bool match_level) { | 736 bool has_osr_nmethod(int level, bool match_level) { |
731 return InstanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL; | 737 return InstanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL; |
732 } | 738 } |