comparison src/share/vm/ci/ciEnv.cpp @ 7126:ce248dc0a656

removed all Graal modifications to ci and c1
author Doug Simon <doug.simon@oracle.com>
date Mon, 03 Dec 2012 17:54:05 +0100
parents 2cb439954abf
children 5fc51c1ecdeb
comparison
equal deleted inserted replaced
7125:1baf7f1e3f23 7126:ce248dc0a656
84 84
85 // ------------------------------------------------------------------ 85 // ------------------------------------------------------------------
86 // ciEnv::ciEnv 86 // ciEnv::ciEnv
87 ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter) { 87 ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter) {
88 VM_ENTRY_MARK; 88 VM_ENTRY_MARK;
89 CompilerThread* compiler_thread = CompilerThread::current(); 89
90 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc. 90 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc.
91 thread->set_env(this); 91 thread->set_env(this);
92 assert(ciEnv::current() == this, "sanity"); 92 assert(ciEnv::current() == this, "sanity");
93 93
94 _oop_recorder = NULL; 94 _oop_recorder = NULL;
102 assert(!firstEnv, "not initialized properly"); 102 assert(!firstEnv, "not initialized properly");
103 #endif /* !PRODUCT */ 103 #endif /* !PRODUCT */
104 104
105 _system_dictionary_modification_counter = system_dictionary_modification_counter; 105 _system_dictionary_modification_counter = system_dictionary_modification_counter;
106 _num_inlined_bytecodes = 0; 106 _num_inlined_bytecodes = 0;
107 assert(task == NULL || compiler_thread->task() == task, "sanity"); 107 assert(task == NULL || thread->task() == task, "sanity");
108 _task = task; 108 _task = task;
109 _log = NULL; 109 _log = NULL;
110 110
111 // Temporary buffer for creating symbols and such. 111 // Temporary buffer for creating symbols and such.
112 _name_buffer = NULL; 112 _name_buffer = NULL;
139 139
140 ciEnv::ciEnv(Arena* arena) { 140 ciEnv::ciEnv(Arena* arena) {
141 ASSERT_IN_VM; 141 ASSERT_IN_VM;
142 142
143 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc. 143 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc.
144 #ifdef GRAAL
145 JavaThread* current_thread = JavaThread::current();
146 #else
147 CompilerThread* current_thread = CompilerThread::current(); 144 CompilerThread* current_thread = CompilerThread::current();
148 #endif
149 assert(current_thread->env() == NULL, "must be"); 145 assert(current_thread->env() == NULL, "must be");
150 current_thread->set_env(this); 146 current_thread->set_env(this);
151 assert(ciEnv::current() == this, "sanity"); 147 assert(ciEnv::current() == this, "sanity");
152 148
153 _oop_recorder = NULL; 149 _oop_recorder = NULL;
156 _failure_reason = NULL; 152 _failure_reason = NULL;
157 _compilable = MethodCompilable_never; 153 _compilable = MethodCompilable_never;
158 _break_at_compile = false; 154 _break_at_compile = false;
159 _compiler_data = NULL; 155 _compiler_data = NULL;
160 #ifndef PRODUCT 156 #ifndef PRODUCT
161 #ifndef GRAAL
162 assert(firstEnv, "must be first"); 157 assert(firstEnv, "must be first");
163 firstEnv = false; 158 firstEnv = false;
164 #endif
165 #endif /* !PRODUCT */ 159 #endif /* !PRODUCT */
166 160
167 _system_dictionary_modification_counter = 0; 161 _system_dictionary_modification_counter = 0;
168 _num_inlined_bytecodes = 0; 162 _num_inlined_bytecodes = 0;
169 _task = NULL; 163 _task = NULL;
192 _the_null_string = NULL; 186 _the_null_string = NULL;
193 _the_min_jint_string = NULL; 187 _the_min_jint_string = NULL;
194 } 188 }
195 189
196 ciEnv::~ciEnv() { 190 ciEnv::~ciEnv() {
197 #ifdef GRAAL
198 _factory->remove_symbols();
199 JavaThread::current()->set_env(NULL);
200 #else
201 CompilerThread* current_thread = CompilerThread::current(); 191 CompilerThread* current_thread = CompilerThread::current();
202 _factory->remove_symbols(); 192 _factory->remove_symbols();
203 // Need safepoint to clear the env on the thread. RedefineClasses might 193 // Need safepoint to clear the env on the thread. RedefineClasses might
204 // be reading it. 194 // be reading it.
205 GUARDED_VM_ENTRY(current_thread->set_env(NULL);) 195 GUARDED_VM_ENTRY(current_thread->set_env(NULL);)
206 #endif
207 } 196 }
208 197
209 // ------------------------------------------------------------------ 198 // ------------------------------------------------------------------
210 // Cache Jvmti state 199 // Cache Jvmti state
211 void ciEnv::cache_jvmti_state() { 200 void ciEnv::cache_jvmti_state() {
778 if (holder_is_accessible) { // Our declared holder is loaded. 767 if (holder_is_accessible) { // Our declared holder is loaded.
779 InstanceKlass* lookup = declared_holder->get_instanceKlass(); 768 InstanceKlass* lookup = declared_holder->get_instanceKlass();
780 Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc); 769 Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc);
781 if (m != NULL && 770 if (m != NULL &&
782 (bc == Bytecodes::_invokestatic 771 (bc == Bytecodes::_invokestatic
783 ? InstanceKlass::cast(m->method_holder())->is_not_initialized() 772 ? m->method_holder()->is_not_initialized()
784 : !InstanceKlass::cast(m->method_holder())->is_loaded())) { 773 : !m->method_holder()->is_loaded())) {
785 m = NULL; 774 m = NULL;
786 } 775 }
787 #ifdef ASSERT 776 #ifdef ASSERT
788 if (m != NULL && ReplayCompiles && !ciReplay::is_loaded(m)) { 777 if (m != NULL && ReplayCompiles && !ciReplay::is_loaded(m)) {
789 m = NULL; 778 m = NULL;
925 } 914 }
926 } 915 }
927 916
928 // ------------------------------------------------------------------ 917 // ------------------------------------------------------------------
929 // ciEnv::register_method 918 // ciEnv::register_method
930 nmethod* ciEnv::register_method(ciMethod* target, 919 void ciEnv::register_method(ciMethod* target,
931 int entry_bci, 920 int entry_bci,
932 CodeOffsets* offsets, 921 CodeOffsets* offsets,
933 int orig_pc_offset, 922 int orig_pc_offset,
934 CodeBuffer* code_buffer, 923 CodeBuffer* code_buffer,
935 int frame_words, 924 int frame_words,
993 982
994 // All buffers in the CodeBuffer are allocated in the CodeCache. 983 // All buffers in the CodeBuffer are allocated in the CodeCache.
995 // If the code buffer is created on each compile attempt 984 // If the code buffer is created on each compile attempt
996 // as in C2, then it must be freed. 985 // as in C2, then it must be freed.
997 code_buffer->free_blob(); 986 code_buffer->free_blob();
998 return NULL; 987 return;
999 } 988 }
1000 989
1001 assert(offsets->value(CodeOffsets::Deopt) != -1, "must have deopt entry"); 990 assert(offsets->value(CodeOffsets::Deopt) != -1, "must have deopt entry");
1002 assert(offsets->value(CodeOffsets::Exceptions) != -1, "must have exception entry"); 991 assert(offsets->value(CodeOffsets::Exceptions) != -1, "must have exception entry");
1003 992
1071 tty->print_cr("Installing osr method (%d) %s @ %d", 1060 tty->print_cr("Installing osr method (%d) %s @ %d",
1072 comp_level, 1061 comp_level,
1073 method_name, 1062 method_name,
1074 entry_bci); 1063 entry_bci);
1075 } 1064 }
1076 InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm); 1065 method->method_holder()->add_osr_nmethod(nm);
1077 1066
1078 } 1067 }
1079 } 1068 }
1080 } 1069 }
1081 // JVMTI -- compiled method notification (must be done outside lock) 1070 // JVMTI -- compiled method notification (must be done outside lock)
1082 if (nm != NULL) { 1071 if (nm != NULL) {
1083 nm->post_compiled_method_load_event(); 1072 nm->post_compiled_method_load_event();
1084 } 1073 }
1085 1074
1086 return nm;
1087 } 1075 }
1088 1076
1089 1077
1090 // ------------------------------------------------------------------ 1078 // ------------------------------------------------------------------
1091 // ciEnv::find_system_klass 1079 // ciEnv::find_system_klass