equal
deleted
inserted
replaced
29 #include "interpreter/templateInterpreter.hpp" |
29 #include "interpreter/templateInterpreter.hpp" |
30 #include "interpreter/templateInterpreterGenerator.hpp" |
30 #include "interpreter/templateInterpreterGenerator.hpp" |
31 #include "interpreter/templateTable.hpp" |
31 #include "interpreter/templateTable.hpp" |
32 #include "logging/log.hpp" |
32 #include "logging/log.hpp" |
33 #include "memory/resourceArea.hpp" |
33 #include "memory/resourceArea.hpp" |
|
34 #include "runtime/safepoint.hpp" |
34 #include "runtime/timerTrace.hpp" |
35 #include "runtime/timerTrace.hpp" |
|
36 #include "utilities/copy.hpp" |
35 |
37 |
36 #ifndef CC_INTERP |
38 #ifndef CC_INTERP |
37 |
39 |
38 # define __ _masm-> |
40 # define __ _masm-> |
39 |
41 |
273 return (int)state; |
275 return (int)state; |
274 } |
276 } |
275 |
277 |
276 |
278 |
277 //------------------------------------------------------------------------------------------------------------------------ |
279 //------------------------------------------------------------------------------------------------------------------------ |
278 // Safepoint suppport |
280 // Safepoint support |
279 |
281 |
280 static inline void copy_table(address* from, address* to, int size) { |
282 static inline void copy_table(address* from, address* to, int size) { |
281 // Copy non-overlapping tables. The copy has to occur word wise for MT safety. |
283 // Copy non-overlapping tables. |
282 while (size-- > 0) *to++ = *from++; |
284 if (SafepointSynchronize::is_at_safepoint()) { |
|
285 // Nothing is using the table at a safepoint so skip atomic word copy. |
|
286 Copy::disjoint_words((HeapWord*)from, (HeapWord*)to, (size_t)size); |
|
287 } else { |
|
288 // Use atomic word copy when not at a safepoint for safety. |
|
289 Copy::disjoint_words_atomic((HeapWord*)from, (HeapWord*)to, (size_t)size); |
|
290 } |
283 } |
291 } |
284 |
292 |
285 void TemplateInterpreter::notice_safepoints() { |
293 void TemplateInterpreter::notice_safepoints() { |
286 if (!_notice_safepoints) { |
294 if (!_notice_safepoints) { |
287 log_debug(interpreter, safepoint)("switching active_table to safept_table."); |
295 log_debug(interpreter, safepoint)("switching active_table to safept_table."); |