Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/isolate.h

Issue 6788023: Per-isolate v8::Locker and v8::Unlocker (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes for simulator (arm/mips) Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/simulator-ia32.h ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 inline void set_try_catch_handler_address(Address address) { 217 inline void set_try_catch_handler_address(Address address) {
218 try_catch_handler_address_ = address; 218 try_catch_handler_address_ = address;
219 } 219 }
220 220
221 void Free() { 221 void Free() {
222 ASSERT(!has_pending_message_); 222 ASSERT(!has_pending_message_);
223 ASSERT(!external_caught_exception_); 223 ASSERT(!external_caught_exception_);
224 ASSERT(try_catch_handler_address_ == NULL); 224 ASSERT(try_catch_handler_address_ == NULL);
225 } 225 }
226 226
227 Isolate* isolate_;
227 // The context where the current execution method is created and for variable 228 // The context where the current execution method is created and for variable
228 // lookups. 229 // lookups.
229 Context* context_; 230 Context* context_;
230 ThreadId thread_id_; 231 ThreadId thread_id_;
231 MaybeObject* pending_exception_; 232 MaybeObject* pending_exception_;
232 bool has_pending_message_; 233 bool has_pending_message_;
233 Object* pending_message_obj_; 234 Object* pending_message_obj_;
234 Script* pending_message_script_; 235 Script* pending_message_script_;
235 int pending_message_start_pos_; 236 int pending_message_start_pos_;
236 int pending_message_end_pos_; 237 int pending_message_end_pos_;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 void TearDown(); 481 void TearDown();
481 482
482 bool IsDefaultIsolate() const { return this == default_isolate_; } 483 bool IsDefaultIsolate() const { return this == default_isolate_; }
483 484
484 // Ensures that process-wide resources and the default isolate have been 485 // Ensures that process-wide resources and the default isolate have been
485 // allocated. It is only necessary to call this method in rare casses, for 486 // allocated. It is only necessary to call this method in rare casses, for
486 // example if you are using V8 from within the body of a static initializer. 487 // example if you are using V8 from within the body of a static initializer.
487 // Safe to call multiple times. 488 // Safe to call multiple times.
488 static void EnsureDefaultIsolate(); 489 static void EnsureDefaultIsolate();
489 490
491 // Find the PerThread for this particular (isolate, thread) combination
492 // If one does not yet exist, return null.
493 PerIsolateThreadData* FindPerThreadDataForThisThread();
494
490 #ifdef ENABLE_DEBUGGER_SUPPORT 495 #ifdef ENABLE_DEBUGGER_SUPPORT
491 // Get the debugger from the default isolate. Preinitializes the 496 // Get the debugger from the default isolate. Preinitializes the
492 // default isolate if needed. 497 // default isolate if needed.
493 static Debugger* GetDefaultIsolateDebugger(); 498 static Debugger* GetDefaultIsolateDebugger();
494 #endif 499 #endif
495 500
496 // Get the stack guard from the default isolate. Preinitializes the 501 // Get the stack guard from the default isolate. Preinitializes the
497 // default isolate if needed. 502 // default isolate if needed.
498 static StackGuard* GetDefaultIsolateStackGuard(); 503 static StackGuard* GetDefaultIsolateStackGuard();
499 504
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 EntryStackItem* entry_stack_; 1064 EntryStackItem* entry_stack_;
1060 1065
1061 // Allocate and insert PerIsolateThreadData into the ThreadDataTable 1066 // Allocate and insert PerIsolateThreadData into the ThreadDataTable
1062 // (regardless of whether such data already exists). 1067 // (regardless of whether such data already exists).
1063 PerIsolateThreadData* AllocatePerIsolateThreadData(ThreadId thread_id); 1068 PerIsolateThreadData* AllocatePerIsolateThreadData(ThreadId thread_id);
1064 1069
1065 // Find the PerThread for this particular (isolate, thread) combination. 1070 // Find the PerThread for this particular (isolate, thread) combination.
1066 // If one does not yet exist, allocate a new one. 1071 // If one does not yet exist, allocate a new one.
1067 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread(); 1072 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread();
1068 1073
1069 // PreInits and returns a default isolate. Needed when a new thread tries 1074 // PreInits and returns a default isolate. Needed when a new thread tries
1070 // to create a Locker for the first time (the lock itself is in the isolate). 1075 // to create a Locker for the first time (the lock itself is in the isolate).
1071 static Isolate* GetDefaultIsolateForLocking(); 1076 static Isolate* GetDefaultIsolateForLocking();
1072 1077
1073 // Initializes the current thread to run this Isolate. 1078 // Initializes the current thread to run this Isolate.
1074 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate 1079 // Not thread-safe. Multiple threads should not Enter/Exit the same isolate
1075 // at the same time, this should be prevented using external locking. 1080 // at the same time, this should be prevented using external locking.
1076 void Enter(); 1081 void Enter();
1077 1082
1078 // Exits the current thread. The previosuly entered Isolate is restored 1083 // Exits the current thread. The previosuly entered Isolate is restored
1079 // for the thread. 1084 // for the thread.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 // between compilation units. 1196 // between compilation units.
1192 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 1197 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
1193 static const intptr_t name##_debug_offset_; 1198 static const intptr_t name##_debug_offset_;
1194 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 1199 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
1195 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 1200 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
1196 #undef ISOLATE_FIELD_OFFSET 1201 #undef ISOLATE_FIELD_OFFSET
1197 #endif 1202 #endif
1198 1203
1199 friend class ExecutionAccess; 1204 friend class ExecutionAccess;
1200 friend class IsolateInitializer; 1205 friend class IsolateInitializer;
1206 friend class ThreadManager;
1207 friend class Simulator;
1208 friend class StackGuard;
1201 friend class ThreadId; 1209 friend class ThreadId;
1202 friend class v8::Isolate; 1210 friend class v8::Isolate;
1203 friend class v8::Locker; 1211 friend class v8::Locker;
1212 friend class v8::Unlocker;
1204 1213
1205 DISALLOW_COPY_AND_ASSIGN(Isolate); 1214 DISALLOW_COPY_AND_ASSIGN(Isolate);
1206 }; 1215 };
1207 1216
1208 1217
1209 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the 1218 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the
1210 // class as a work around for a bug in the generated code found with these 1219 // class as a work around for a bug in the generated code found with these
1211 // versions of GCC. See V8 issue 122 for details. 1220 // versions of GCC. See V8 issue 122 for details.
1212 class SaveContext BASE_EMBEDDED { 1221 class SaveContext BASE_EMBEDDED {
1213 public: 1222 public:
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 1383
1375 } } // namespace v8::internal 1384 } } // namespace v8::internal
1376 1385
1377 // TODO(isolates): Get rid of these -inl.h includes and place them only where 1386 // TODO(isolates): Get rid of these -inl.h includes and place them only where
1378 // they're needed. 1387 // they're needed.
1379 #include "allocation-inl.h" 1388 #include "allocation-inl.h"
1380 #include "zone-inl.h" 1389 #include "zone-inl.h"
1381 #include "frames-inl.h" 1390 #include "frames-inl.h"
1382 1391
1383 #endif // V8_ISOLATE_H_ 1392 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/ia32/simulator-ia32.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698