Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1025 return date_cache_; | 1025 return date_cache_; |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 void set_date_cache(DateCache* date_cache) { | 1028 void set_date_cache(DateCache* date_cache) { |
| 1029 if (date_cache != date_cache_) { | 1029 if (date_cache != date_cache_) { |
| 1030 delete date_cache_; | 1030 delete date_cache_; |
| 1031 } | 1031 } |
| 1032 date_cache_ = date_cache; | 1032 date_cache_ = date_cache; |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 bool to_delete() { return to_delete_; } | |
| 1036 | |
| 1035 private: | 1037 private: |
| 1036 Isolate(); | 1038 Isolate(); |
| 1037 | 1039 |
| 1038 friend struct GlobalState; | 1040 friend struct GlobalState; |
| 1039 friend struct InitializeGlobalState; | 1041 friend struct InitializeGlobalState; |
| 1040 | 1042 |
| 1041 enum State { | 1043 enum State { |
| 1042 UNINITIALIZED, // Some components may not have been allocated. | 1044 UNINITIALIZED, // Some components may not have been allocated. |
| 1043 INITIALIZED // All components are fully initialized. | 1045 INITIALIZED // All components are fully initialized. |
| 1044 }; | 1046 }; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1121 | 1123 |
| 1122 // Initializes the current thread to run this Isolate. | 1124 // Initializes the current thread to run this Isolate. |
| 1123 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate | 1125 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate |
| 1124 // at the same time, this should be prevented using external locking. | 1126 // at the same time, this should be prevented using external locking. |
| 1125 void Enter(); | 1127 void Enter(); |
| 1126 | 1128 |
| 1127 // Exits the current thread. The previosuly entered Isolate is restored | 1129 // Exits the current thread. The previosuly entered Isolate is restored |
| 1128 // for the thread. | 1130 // for the thread. |
| 1129 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate | 1131 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate |
| 1130 // at the same time, this should be prevented using external locking. | 1132 // at the same time, this should be prevented using external locking. |
| 1131 void Exit(); | 1133 // When using --concurrent_crankshaft, the Entry and Exit methods |
| 1134 // need to automatically lock and unlock the isolate, except in one | |
| 1135 // edge-case, when we call Exit(false) | |
|
danno
2012/05/22 10:32:19
Can you be more explicit why this case happens?
| |
| 1136 void Exit(bool auto_unlock = true); | |
| 1132 | 1137 |
| 1133 void PreallocatedMemoryThreadStart(); | 1138 void PreallocatedMemoryThreadStart(); |
| 1134 void PreallocatedMemoryThreadStop(); | 1139 void PreallocatedMemoryThreadStop(); |
| 1135 void InitializeThreadLocal(); | 1140 void InitializeThreadLocal(); |
| 1136 | 1141 |
| 1137 void PrintStackTrace(FILE* out, ThreadLocalTop* thread); | 1142 void PrintStackTrace(FILE* out, ThreadLocalTop* thread); |
| 1138 void MarkCompactPrologue(bool is_compacting, | 1143 void MarkCompactPrologue(bool is_compacting, |
| 1139 ThreadLocalTop* archived_thread_data); | 1144 ThreadLocalTop* archived_thread_data); |
| 1140 void MarkCompactEpilogue(bool is_compacting, | 1145 void MarkCompactEpilogue(bool is_compacting, |
| 1141 ThreadLocalTop* archived_thread_data); | 1146 ThreadLocalTop* archived_thread_data); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1208 DateCache* date_cache_; | 1213 DateCache* date_cache_; |
| 1209 unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_; | 1214 unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_; |
| 1210 | 1215 |
| 1211 // The garbage collector should be a little more aggressive when it knows | 1216 // The garbage collector should be a little more aggressive when it knows |
| 1212 // that a context was recently exited. | 1217 // that a context was recently exited. |
| 1213 bool context_exit_happened_; | 1218 bool context_exit_happened_; |
| 1214 | 1219 |
| 1215 // Time stamp at initialization. | 1220 // Time stamp at initialization. |
| 1216 double time_millis_at_init_; | 1221 double time_millis_at_init_; |
| 1217 | 1222 |
| 1223 // The crankshaft thread should delete this isolate when it sees it | |
| 1224 // next (and also not compile anything in it). | |
| 1225 bool to_delete_; | |
| 1226 | |
| 1227 List<bool> lock_history_; | |
| 1228 | |
| 1218 #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ | 1229 #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ |
| 1219 defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) | 1230 defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) |
| 1220 bool simulator_initialized_; | 1231 bool simulator_initialized_; |
| 1221 HashMap* simulator_i_cache_; | 1232 HashMap* simulator_i_cache_; |
| 1222 Redirection* simulator_redirection_; | 1233 Redirection* simulator_redirection_; |
| 1223 #endif | 1234 #endif |
| 1224 | 1235 |
| 1225 #ifdef DEBUG | 1236 #ifdef DEBUG |
| 1226 // A static array of histogram info for each type. | 1237 // A static array of histogram info for each type. |
| 1227 HistogramInfo heap_histograms_[LAST_TYPE + 1]; | 1238 HistogramInfo heap_histograms_[LAST_TYPE + 1]; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1248 // This class is huge and has a number of fields controlled by | 1259 // This class is huge and has a number of fields controlled by |
| 1249 // preprocessor defines. Make sure the offsets of these fields agree | 1260 // preprocessor defines. Make sure the offsets of these fields agree |
| 1250 // between compilation units. | 1261 // between compilation units. |
| 1251 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1262 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 1252 static const intptr_t name##_debug_offset_; | 1263 static const intptr_t name##_debug_offset_; |
| 1253 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1264 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 1254 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1265 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 1255 #undef ISOLATE_FIELD_OFFSET | 1266 #undef ISOLATE_FIELD_OFFSET |
| 1256 #endif | 1267 #endif |
| 1257 | 1268 |
| 1269 friend class CrankshaftThread; | |
| 1258 friend class ExecutionAccess; | 1270 friend class ExecutionAccess; |
| 1259 friend class IsolateInitializer; | 1271 friend class IsolateInitializer; |
| 1260 friend class ThreadManager; | 1272 friend class ThreadManager; |
| 1261 friend class Simulator; | 1273 friend class Simulator; |
| 1262 friend class StackGuard; | 1274 friend class StackGuard; |
| 1263 friend class ThreadId; | 1275 friend class ThreadId; |
| 1264 friend class TestMemoryAllocatorScope; | 1276 friend class TestMemoryAllocatorScope; |
| 1265 friend class v8::Isolate; | 1277 friend class v8::Isolate; |
| 1266 friend class v8::Locker; | 1278 friend class v8::Locker; |
| 1267 friend class v8::Unlocker; | 1279 friend class v8::Unlocker; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1406 | 1418 |
| 1407 // Mark the global context with out of memory. | 1419 // Mark the global context with out of memory. |
| 1408 inline void Context::mark_out_of_memory() { | 1420 inline void Context::mark_out_of_memory() { |
| 1409 global_context()->set_out_of_memory(HEAP->true_value()); | 1421 global_context()->set_out_of_memory(HEAP->true_value()); |
| 1410 } | 1422 } |
| 1411 | 1423 |
| 1412 | 1424 |
| 1413 } } // namespace v8::internal | 1425 } } // namespace v8::internal |
| 1414 | 1426 |
| 1415 #endif // V8_ISOLATE_H_ | 1427 #endif // V8_ISOLATE_H_ |
| OLD | NEW |