68 AccessFlags access_flags,
69 InlineTableSizes* sizes,
70 ConstMethod::MethodType method_type,
71 TRAPS) {
72 assert(!access_flags.is_native() || byte_code_size == 0,
73 "native methods should not contain byte codes");
74 ConstMethod* cm = ConstMethod::allocate(loader_data,
75 byte_code_size,
76 sizes,
77 method_type,
78 CHECK_NULL);
79 int size = Method::size(access_flags.is_native());
80 return new (loader_data, size, false, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags);
81 }
82
83 Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
84 NoSafepointVerifier no_safepoint;
85 set_constMethod(xconst);
86 set_access_flags(access_flags);
87 set_intrinsic_id(vmIntrinsics::_none);
88 set_jfr_towrite(false);
89 set_force_inline(false);
90 set_hidden(false);
91 set_dont_inline(false);
92 set_has_injected_profile(false);
93 set_method_data(NULL);
94 clear_method_counters();
95 set_vtable_index(Method::garbage_vtable_index);
96
97 // Fix and bury in Method*
98 set_interpreter_entry(NULL); // sets i2i entry and from_int
99 set_adapter_entry(NULL);
100 clear_code(false /* don't need a lock */); // from_c/from_i get set to c2i/i2i
101
102 if (access_flags.is_native()) {
103 clear_native_function();
104 set_signature_handler(NULL);
105 }
106
107 NOT_PRODUCT(set_compiled_invocation_count(0);)
108 }
|
68 AccessFlags access_flags,
69 InlineTableSizes* sizes,
70 ConstMethod::MethodType method_type,
71 TRAPS) {
72 assert(!access_flags.is_native() || byte_code_size == 0,
73 "native methods should not contain byte codes");
74 ConstMethod* cm = ConstMethod::allocate(loader_data,
75 byte_code_size,
76 sizes,
77 method_type,
78 CHECK_NULL);
79 int size = Method::size(access_flags.is_native());
80 return new (loader_data, size, false, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags);
81 }
82
83 Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
84 NoSafepointVerifier no_safepoint;
85 set_constMethod(xconst);
86 set_access_flags(access_flags);
87 set_intrinsic_id(vmIntrinsics::_none);
88 set_force_inline(false);
89 set_hidden(false);
90 set_dont_inline(false);
91 set_has_injected_profile(false);
92 set_method_data(NULL);
93 clear_method_counters();
94 set_vtable_index(Method::garbage_vtable_index);
95
96 // Fix and bury in Method*
97 set_interpreter_entry(NULL); // sets i2i entry and from_int
98 set_adapter_entry(NULL);
99 clear_code(false /* don't need a lock */); // from_c/from_i get set to c2i/i2i
100
101 if (access_flags.is_native()) {
102 clear_native_function();
103 set_signature_handler(NULL);
104 }
105
106 NOT_PRODUCT(set_compiled_invocation_count(0);)
107 }
|