OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ExecutionAccess access; | 132 ExecutionAccess access; |
133 | 133 |
134 // If there is another thread that was lazily archived then we have to really | 134 // If there is another thread that was lazily archived then we have to really |
135 // archive it now. | 135 // archive it now. |
136 if (lazily_archived_thread_.IsValid()) { | 136 if (lazily_archived_thread_.IsValid()) { |
137 EagerlyArchiveThread(); | 137 EagerlyArchiveThread(); |
138 } | 138 } |
139 ThreadState* state = | 139 ThreadState* state = |
140 reinterpret_cast<ThreadState*>(Thread::GetThreadLocal(thread_state_key)); | 140 reinterpret_cast<ThreadState*>(Thread::GetThreadLocal(thread_state_key)); |
141 if (state == NULL) { | 141 if (state == NULL) { |
| 142 // This is a new thread. |
| 143 StackGuard::InitThread(access); |
142 return false; | 144 return false; |
143 } | 145 } |
144 char* from = state->data(); | 146 char* from = state->data(); |
145 from = HandleScopeImplementer::RestoreThread(from); | 147 from = HandleScopeImplementer::RestoreThread(from); |
146 from = Top::RestoreThread(from); | 148 from = Top::RestoreThread(from); |
147 #ifdef ENABLE_DEBUGGER_SUPPORT | 149 #ifdef ENABLE_DEBUGGER_SUPPORT |
148 from = Debug::RestoreDebug(from); | 150 from = Debug::RestoreDebug(from); |
149 #endif | 151 #endif |
150 from = StackGuard::RestoreStackGuard(from); | 152 from = StackGuard::RestoreStackGuard(from); |
151 from = RegExpStack::RestoreStack(from); | 153 from = RegExpStack::RestoreStack(from); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // Acknowledge the preemption by the receiving thread. | 413 // Acknowledge the preemption by the receiving thread. |
412 void ContextSwitcher::PreemptionReceived() { | 414 void ContextSwitcher::PreemptionReceived() { |
413 ASSERT(Locker::IsLocked()); | 415 ASSERT(Locker::IsLocked()); |
414 // There is currently no accounting being done for this. But could be in the | 416 // There is currently no accounting being done for this. But could be in the |
415 // future, which is why we leave this in. | 417 // future, which is why we leave this in. |
416 } | 418 } |
417 | 419 |
418 | 420 |
419 } // namespace internal | 421 } // namespace internal |
420 } // namespace v8 | 422 } // namespace v8 |
OLD | NEW |