| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 has_pending_message_ = false; | 109 has_pending_message_ = false; |
| 110 pending_message_obj_ = NULL; | 110 pending_message_obj_ = NULL; |
| 111 pending_message_script_ = NULL; | 111 pending_message_script_ = NULL; |
| 112 scheduled_exception_ = NULL; | 112 scheduled_exception_ = NULL; |
| 113 } | 113 } |
| 114 | 114 |
| 115 | 115 |
| 116 void ThreadLocalTop::Initialize() { | 116 void ThreadLocalTop::Initialize() { |
| 117 InitializeInternal(); | 117 InitializeInternal(); |
| 118 #ifdef USE_SIMULATOR | 118 #ifdef USE_SIMULATOR |
| 119 #ifdef V8_TARGET_ARCH_ARM | 119 #if V8_TARGET_ARCH_ARM |
| 120 simulator_ = Simulator::current(isolate_); | 120 simulator_ = Simulator::current(isolate_); |
| 121 #elif V8_TARGET_ARCH_MIPS | 121 #elif V8_TARGET_ARCH_MIPS |
| 122 simulator_ = Simulator::current(isolate_); | 122 simulator_ = Simulator::current(isolate_); |
| 123 #endif | 123 #endif |
| 124 #endif | 124 #endif |
| 125 thread_id_ = ThreadId::Current(); | 125 thread_id_ = ThreadId::Current(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 v8::TryCatch* ThreadLocalTop::TryCatchHandler() { | 129 v8::TryCatch* ThreadLocalTop::TryCatchHandler() { |
| (...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1618 return to + sizeof(ThreadLocalTop); | 1618 return to + sizeof(ThreadLocalTop); |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 | 1621 |
| 1622 char* Isolate::RestoreThread(char* from) { | 1622 char* Isolate::RestoreThread(char* from) { |
| 1623 OS::MemCopy(reinterpret_cast<char*>(thread_local_top()), from, | 1623 OS::MemCopy(reinterpret_cast<char*>(thread_local_top()), from, |
| 1624 sizeof(ThreadLocalTop)); | 1624 sizeof(ThreadLocalTop)); |
| 1625 // This might be just paranoia, but it seems to be needed in case a | 1625 // This might be just paranoia, but it seems to be needed in case a |
| 1626 // thread_local_top_ is restored on a separate OS thread. | 1626 // thread_local_top_ is restored on a separate OS thread. |
| 1627 #ifdef USE_SIMULATOR | 1627 #ifdef USE_SIMULATOR |
| 1628 #ifdef V8_TARGET_ARCH_ARM | 1628 #if V8_TARGET_ARCH_ARM |
| 1629 thread_local_top()->simulator_ = Simulator::current(this); | 1629 thread_local_top()->simulator_ = Simulator::current(this); |
| 1630 #elif V8_TARGET_ARCH_MIPS | 1630 #elif V8_TARGET_ARCH_MIPS |
| 1631 thread_local_top()->simulator_ = Simulator::current(this); | 1631 thread_local_top()->simulator_ = Simulator::current(this); |
| 1632 #endif | 1632 #endif |
| 1633 #endif | 1633 #endif |
| 1634 ASSERT(context() == NULL || context()->IsContext()); | 1634 ASSERT(context() == NULL || context()->IsContext()); |
| 1635 return from + sizeof(ThreadLocalTop); | 1635 return from + sizeof(ThreadLocalTop); |
| 1636 } | 1636 } |
| 1637 | 1637 |
| 1638 | 1638 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); | 1767 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); |
| 1768 | 1768 |
| 1769 heap_.isolate_ = this; | 1769 heap_.isolate_ = this; |
| 1770 stack_guard_.isolate_ = this; | 1770 stack_guard_.isolate_ = this; |
| 1771 | 1771 |
| 1772 // ThreadManager is initialized early to support locking an isolate | 1772 // ThreadManager is initialized early to support locking an isolate |
| 1773 // before it is entered. | 1773 // before it is entered. |
| 1774 thread_manager_ = new ThreadManager(); | 1774 thread_manager_ = new ThreadManager(); |
| 1775 thread_manager_->isolate_ = this; | 1775 thread_manager_->isolate_ = this; |
| 1776 | 1776 |
| 1777 #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ | 1777 #if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ |
| 1778 defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) | 1778 V8_TARGET_ARCH_MIPS && !defined(__mips__) |
| 1779 simulator_initialized_ = false; | 1779 simulator_initialized_ = false; |
| 1780 simulator_i_cache_ = NULL; | 1780 simulator_i_cache_ = NULL; |
| 1781 simulator_redirection_ = NULL; | 1781 simulator_redirection_ = NULL; |
| 1782 #endif | 1782 #endif |
| 1783 | 1783 |
| 1784 #ifdef DEBUG | 1784 #ifdef DEBUG |
| 1785 // heap_histograms_ initializes itself. | 1785 // heap_histograms_ initializes itself. |
| 1786 memset(&js_spill_information_, 0, sizeof(js_spill_information_)); | 1786 memset(&js_spill_information_, 0, sizeof(js_spill_information_)); |
| 1787 memset(code_kind_statistics_, 0, | 1787 memset(code_kind_statistics_, 0, |
| 1788 sizeof(code_kind_statistics_[0]) * Code::NUMBER_OF_KINDS); | 1788 sizeof(code_kind_statistics_[0]) * Code::NUMBER_OF_KINDS); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2117 code_stub_interface_descriptors_ = | 2117 code_stub_interface_descriptors_ = |
| 2118 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; | 2118 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; |
| 2119 cpu_profiler_ = new CpuProfiler(this); | 2119 cpu_profiler_ = new CpuProfiler(this); |
| 2120 heap_profiler_ = new HeapProfiler(heap()); | 2120 heap_profiler_ = new HeapProfiler(heap()); |
| 2121 | 2121 |
| 2122 // Enable logging before setting up the heap | 2122 // Enable logging before setting up the heap |
| 2123 logger_->SetUp(this); | 2123 logger_->SetUp(this); |
| 2124 | 2124 |
| 2125 // Initialize other runtime facilities | 2125 // Initialize other runtime facilities |
| 2126 #if defined(USE_SIMULATOR) | 2126 #if defined(USE_SIMULATOR) |
| 2127 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) | 2127 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS |
| 2128 Simulator::Initialize(this); | 2128 Simulator::Initialize(this); |
| 2129 #endif | 2129 #endif |
| 2130 #endif | 2130 #endif |
| 2131 | 2131 |
| 2132 { // NOLINT | 2132 { // NOLINT |
| 2133 // Ensure that the thread has a valid stack guard. The v8::Locker object | 2133 // Ensure that the thread has a valid stack guard. The v8::Locker object |
| 2134 // will ensure this too, but we don't have to use lockers if we are only | 2134 // will ensure this too, but we don't have to use lockers if we are only |
| 2135 // using one thread. | 2135 // using one thread. |
| 2136 ExecutionAccess lock(this); | 2136 ExecutionAccess lock(this); |
| 2137 stack_guard_.InitThread(lock); | 2137 stack_guard_.InitThread(lock); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2439 | 2439 |
| 2440 #ifdef DEBUG | 2440 #ifdef DEBUG |
| 2441 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2441 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2442 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2442 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2443 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2443 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2444 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2444 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2445 #undef ISOLATE_FIELD_OFFSET | 2445 #undef ISOLATE_FIELD_OFFSET |
| 2446 #endif | 2446 #endif |
| 2447 | 2447 |
| 2448 } } // namespace v8::internal | 2448 } } // namespace v8::internal |
| OLD | NEW |