| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 4607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4618 ASSERT(max_size >= kMinimumSizeForLogLinesBuffer); | 4618 ASSERT(max_size >= kMinimumSizeForLogLinesBuffer); |
| 4619 return LOGGER->GetLogLines(from_pos, dest_buf, max_size); | 4619 return LOGGER->GetLogLines(from_pos, dest_buf, max_size); |
| 4620 #endif | 4620 #endif |
| 4621 return 0; | 4621 return 0; |
| 4622 } | 4622 } |
| 4623 | 4623 |
| 4624 | 4624 |
| 4625 int V8::GetCurrentThreadId() { | 4625 int V8::GetCurrentThreadId() { |
| 4626 i::Isolate* isolate = i::Isolate::Current(); | 4626 i::Isolate* isolate = i::Isolate::Current(); |
| 4627 EnsureInitializedForIsolate(isolate, "V8::GetCurrentThreadId()"); | 4627 EnsureInitializedForIsolate(isolate, "V8::GetCurrentThreadId()"); |
| 4628 return isolate->thread_id(); | 4628 return isolate->thread_id().ToInteger(); |
| 4629 } | 4629 } |
| 4630 | 4630 |
| 4631 | 4631 |
| 4632 void V8::TerminateExecution(int thread_id) { | 4632 void V8::TerminateExecution(int thread_id) { |
| 4633 i::Isolate* isolate = i::Isolate::Current(); | 4633 i::Isolate* isolate = i::Isolate::Current(); |
| 4634 if (!isolate->IsInitialized()) return; | 4634 if (!isolate->IsInitialized()) return; |
| 4635 API_ENTRY_CHECK("V8::TerminateExecution()"); | 4635 API_ENTRY_CHECK("V8::TerminateExecution()"); |
| 4636 // If the thread_id identifies the current thread just terminate | 4636 // If the thread_id identifies the current thread just terminate |
| 4637 // execution right away. Otherwise, ask the thread manager to | 4637 // execution right away. Otherwise, ask the thread manager to |
| 4638 // terminate the thread with the given id if any. | 4638 // terminate the thread with the given id if any. |
| 4639 if (thread_id == isolate->thread_id()) { | 4639 i::ThreadId internal_tid = i::ThreadId::FromInteger(thread_id); |
| 4640 if (isolate->thread_id().Equals(internal_tid)) { |
| 4640 isolate->stack_guard()->TerminateExecution(); | 4641 isolate->stack_guard()->TerminateExecution(); |
| 4641 } else { | 4642 } else { |
| 4642 isolate->thread_manager()->TerminateExecution(thread_id); | 4643 isolate->thread_manager()->TerminateExecution(internal_tid); |
| 4643 } | 4644 } |
| 4644 } | 4645 } |
| 4645 | 4646 |
| 4646 | 4647 |
| 4647 void V8::TerminateExecution(Isolate* isolate) { | 4648 void V8::TerminateExecution(Isolate* isolate) { |
| 4648 // If no isolate is supplied, use the default isolate. | 4649 // If no isolate is supplied, use the default isolate. |
| 4649 if (isolate != NULL) { | 4650 if (isolate != NULL) { |
| 4650 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution(); | 4651 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution(); |
| 4651 } else { | 4652 } else { |
| 4652 i::Isolate::GetDefaultIsolateStackGuard()->TerminateExecution(); | 4653 i::Isolate::GetDefaultIsolateStackGuard()->TerminateExecution(); |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5672 | 5673 |
| 5673 | 5674 |
| 5674 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5675 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 5675 HandleScopeImplementer* scope_implementer = | 5676 HandleScopeImplementer* scope_implementer = |
| 5676 reinterpret_cast<HandleScopeImplementer*>(storage); | 5677 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 5677 scope_implementer->IterateThis(v); | 5678 scope_implementer->IterateThis(v); |
| 5678 return storage + ArchiveSpacePerThread(); | 5679 return storage + ArchiveSpacePerThread(); |
| 5679 } | 5680 } |
| 5680 | 5681 |
| 5681 } } // namespace v8::internal | 5682 } } // namespace v8::internal |
| OLD | NEW |