Chromium Code Reviews

Side by Side Diff: src/isolate.h

Issue 11970009: Make the Isolate parameter mandatory in Locker and Unlocker classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « src/debug.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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...)
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).
Michael Starzinger 2013/01/17 10:53:18 I guess in the long run this method should disappe
Sven Panne 2013/01/18 07:20:04 Done.
1075 static v8::Isolate* GetDefaultIsolateForLocking();
1076
1073 private: 1077 private:
1074 Isolate(); 1078 Isolate();
1075 1079
1076 friend struct GlobalState; 1080 friend struct GlobalState;
1077 friend struct InitializeGlobalState; 1081 friend struct InitializeGlobalState;
1078 1082
1079 enum State { 1083 enum State {
1080 UNINITIALIZED, // Some components may not have been allocated. 1084 UNINITIALIZED, // Some components may not have been allocated.
1081 INITIALIZED // All components are fully initialized. 1085 INITIALIZED // All components are fully initialized.
1082 }; 1086 };
(...skipping 63 matching lines...)
1146 PerIsolateThreadData* data); 1150 PerIsolateThreadData* data);
1147 1151
1148 // Allocate and insert PerIsolateThreadData into the ThreadDataTable 1152 // Allocate and insert PerIsolateThreadData into the ThreadDataTable
1149 // (regardless of whether such data already exists). 1153 // (regardless of whether such data already exists).
1150 PerIsolateThreadData* AllocatePerIsolateThreadData(ThreadId thread_id); 1154 PerIsolateThreadData* AllocatePerIsolateThreadData(ThreadId thread_id);
1151 1155
1152 // Find the PerThread for this particular (isolate, thread) combination. 1156 // Find the PerThread for this particular (isolate, thread) combination.
1153 // If one does not yet exist, allocate a new one. 1157 // If one does not yet exist, allocate a new one.
1154 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread(); 1158 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread();
1155 1159
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. 1160 // Initializes the current thread to run this Isolate.
1161 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate 1161 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate
1162 // at the same time, this should be prevented using external locking. 1162 // at the same time, this should be prevented using external locking.
1163 void Enter(); 1163 void Enter();
1164 1164
1165 // Exits the current thread. The previosuly entered Isolate is restored 1165 // Exits the current thread. The previosuly entered Isolate is restored
1166 // for the thread. 1166 // for the thread.
1167 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate 1167 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate
1168 // at the same time, this should be prevented using external locking. 1168 // at the same time, this should be prevented using external locking.
1169 void Exit(); 1169 void Exit();
(...skipping 273 matching lines...)
1443 1443
1444 // Mark the native context with out of memory. 1444 // Mark the native context with out of memory.
1445 inline void Context::mark_out_of_memory() { 1445 inline void Context::mark_out_of_memory() {
1446 native_context()->set_out_of_memory(HEAP->true_value()); 1446 native_context()->set_out_of_memory(HEAP->true_value());
1447 } 1447 }
1448 1448
1449 1449
1450 } } // namespace v8::internal 1450 } } // namespace v8::internal
1451 1451
1452 #endif // V8_ISOLATE_H_ 1452 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine