| 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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 code_stub_interface_descriptor(int index); | 1063 code_stub_interface_descriptor(int index); |
| 1064 | 1064 |
| 1065 void IterateDeferredHandles(ObjectVisitor* visitor); | 1065 void IterateDeferredHandles(ObjectVisitor* visitor); |
| 1066 void LinkDeferredHandles(DeferredHandles* deferred_handles); | 1066 void LinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1067 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); | 1067 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1068 | 1068 |
| 1069 OptimizingCompilerThread* optimizing_compiler_thread() { | 1069 OptimizingCompilerThread* optimizing_compiler_thread() { |
| 1070 return &optimizing_compiler_thread_; | 1070 return &optimizing_compiler_thread_; |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 // PreInits and returns a default isolate. Needed when a new thread tries |
| 1074 // to create a Locker for the first time (the lock itself is in the isolate). |
| 1075 // TODO(svenpanne) This method is on death row... |
| 1076 static v8::Isolate* GetDefaultIsolateForLocking(); |
| 1077 |
| 1073 private: | 1078 private: |
| 1074 Isolate(); | 1079 Isolate(); |
| 1075 | 1080 |
| 1076 friend struct GlobalState; | 1081 friend struct GlobalState; |
| 1077 friend struct InitializeGlobalState; | 1082 friend struct InitializeGlobalState; |
| 1078 | 1083 |
| 1079 enum State { | 1084 enum State { |
| 1080 UNINITIALIZED, // Some components may not have been allocated. | 1085 UNINITIALIZED, // Some components may not have been allocated. |
| 1081 INITIALIZED // All components are fully initialized. | 1086 INITIALIZED // All components are fully initialized. |
| 1082 }; | 1087 }; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 PerIsolateThreadData* data); | 1151 PerIsolateThreadData* data); |
| 1147 | 1152 |
| 1148 // Allocate and insert PerIsolateThreadData into the ThreadDataTable | 1153 // Allocate and insert PerIsolateThreadData into the ThreadDataTable |
| 1149 // (regardless of whether such data already exists). | 1154 // (regardless of whether such data already exists). |
| 1150 PerIsolateThreadData* AllocatePerIsolateThreadData(ThreadId thread_id); | 1155 PerIsolateThreadData* AllocatePerIsolateThreadData(ThreadId thread_id); |
| 1151 | 1156 |
| 1152 // Find the PerThread for this particular (isolate, thread) combination. | 1157 // Find the PerThread for this particular (isolate, thread) combination. |
| 1153 // If one does not yet exist, allocate a new one. | 1158 // If one does not yet exist, allocate a new one. |
| 1154 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread(); | 1159 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread(); |
| 1155 | 1160 |
| 1156 // PreInits and returns a default isolate. Needed when a new thread tries | |
| 1157 // to create a Locker for the first time (the lock itself is in the isolate). | |
| 1158 static Isolate* GetDefaultIsolateForLocking(); | |
| 1159 | |
| 1160 // Initializes the current thread to run this Isolate. | 1161 // Initializes the current thread to run this Isolate. |
| 1161 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate | 1162 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate |
| 1162 // at the same time, this should be prevented using external locking. | 1163 // at the same time, this should be prevented using external locking. |
| 1163 void Enter(); | 1164 void Enter(); |
| 1164 | 1165 |
| 1165 // Exits the current thread. The previosuly entered Isolate is restored | 1166 // Exits the current thread. The previosuly entered Isolate is restored |
| 1166 // for the thread. | 1167 // for the thread. |
| 1167 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate | 1168 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate |
| 1168 // at the same time, this should be prevented using external locking. | 1169 // at the same time, this should be prevented using external locking. |
| 1169 void Exit(); | 1170 void Exit(); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 | 1444 |
| 1444 // Mark the native context with out of memory. | 1445 // Mark the native context with out of memory. |
| 1445 inline void Context::mark_out_of_memory() { | 1446 inline void Context::mark_out_of_memory() { |
| 1446 native_context()->set_out_of_memory(HEAP->true_value()); | 1447 native_context()->set_out_of_memory(HEAP->true_value()); |
| 1447 } | 1448 } |
| 1448 | 1449 |
| 1449 | 1450 |
| 1450 } } // namespace v8::internal | 1451 } } // namespace v8::internal |
| 1451 | 1452 |
| 1452 #endif // V8_ISOLATE_H_ | 1453 #endif // V8_ISOLATE_H_ |
| OLD | NEW |