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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 ASSERT(default_isolate_ != NULL); | 401 ASSERT(default_isolate_ != NULL); |
402 | 402 |
403 PerIsolateThreadData* data = CurrentPerIsolateThreadData(); | 403 PerIsolateThreadData* data = CurrentPerIsolateThreadData(); |
404 // If not yet in default isolate - enter it. | 404 // If not yet in default isolate - enter it. |
405 if (data == NULL || data->isolate() != default_isolate_) { | 405 if (data == NULL || data->isolate() != default_isolate_) { |
406 default_isolate_->Enter(); | 406 default_isolate_->Enter(); |
407 } | 407 } |
408 } | 408 } |
409 | 409 |
410 | 410 |
411 Isolate* Isolate::GetDefaultIsolateForLocking() { | 411 v8::Isolate* Isolate::GetDefaultIsolateForLocking() { |
412 EnsureDefaultIsolate(); | 412 EnsureDefaultIsolate(); |
413 return default_isolate_; | 413 return reinterpret_cast<v8::Isolate*>(default_isolate_); |
414 } | 414 } |
415 | 415 |
416 | 416 |
417 Address Isolate::get_address_from_id(Isolate::AddressId id) { | 417 Address Isolate::get_address_from_id(Isolate::AddressId id) { |
418 return isolate_addresses_[id]; | 418 return isolate_addresses_[id]; |
419 } | 419 } |
420 | 420 |
421 | 421 |
422 char* Isolate::Iterate(ObjectVisitor* v, char* thread_storage) { | 422 char* Isolate::Iterate(ObjectVisitor* v, char* thread_storage) { |
423 ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(thread_storage); | 423 ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(thread_storage); |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop(); | 1736 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop(); |
1737 | 1737 |
1738 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); | 1738 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); |
1739 | 1739 |
1740 // We must stop the logger before we tear down other components. | 1740 // We must stop the logger before we tear down other components. |
1741 logger_->EnsureTickerStopped(); | 1741 logger_->EnsureTickerStopped(); |
1742 | 1742 |
1743 delete deoptimizer_data_; | 1743 delete deoptimizer_data_; |
1744 deoptimizer_data_ = NULL; | 1744 deoptimizer_data_ = NULL; |
1745 if (FLAG_preemption) { | 1745 if (FLAG_preemption) { |
1746 v8::Locker locker; | 1746 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this)); |
1747 v8::Locker::StopPreemption(); | 1747 v8::Locker::StopPreemption(); |
1748 } | 1748 } |
1749 builtins_.TearDown(); | 1749 builtins_.TearDown(); |
1750 bootstrapper_->TearDown(); | 1750 bootstrapper_->TearDown(); |
1751 | 1751 |
1752 // Remove the external reference to the preallocated stack memory. | 1752 // Remove the external reference to the preallocated stack memory. |
1753 delete preallocated_message_space_; | 1753 delete preallocated_message_space_; |
1754 preallocated_message_space_ = NULL; | 1754 preallocated_message_space_ = NULL; |
1755 PreallocatedMemoryThreadStop(); | 1755 PreallocatedMemoryThreadStop(); |
1756 | 1756 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 // Start the thread which will set aside some memory. | 2027 // Start the thread which will set aside some memory. |
2028 PreallocatedMemoryThreadStart(); | 2028 PreallocatedMemoryThreadStart(); |
2029 preallocated_message_space_ = | 2029 preallocated_message_space_ = |
2030 new NoAllocationStringAllocator( | 2030 new NoAllocationStringAllocator( |
2031 preallocated_memory_thread_->data(), | 2031 preallocated_memory_thread_->data(), |
2032 preallocated_memory_thread_->length()); | 2032 preallocated_memory_thread_->length()); |
2033 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); | 2033 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); |
2034 } | 2034 } |
2035 | 2035 |
2036 if (FLAG_preemption) { | 2036 if (FLAG_preemption) { |
2037 v8::Locker locker; | 2037 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this)); |
2038 v8::Locker::StartPreemption(100); | 2038 v8::Locker::StartPreemption(100); |
2039 } | 2039 } |
2040 | 2040 |
2041 #ifdef ENABLE_DEBUGGER_SUPPORT | 2041 #ifdef ENABLE_DEBUGGER_SUPPORT |
2042 debug_->SetUp(create_heap_objects); | 2042 debug_->SetUp(create_heap_objects); |
2043 #endif | 2043 #endif |
2044 | 2044 |
2045 deoptimizer_data_ = new DeoptimizerData; | 2045 deoptimizer_data_ = new DeoptimizerData; |
2046 | 2046 |
2047 // If we are deserializing, read the state into the now-empty heap. | 2047 // If we are deserializing, read the state into the now-empty heap. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2216 | 2216 |
2217 #ifdef DEBUG | 2217 #ifdef DEBUG |
2218 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2218 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2219 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2219 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2220 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2220 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2221 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2221 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2222 #undef ISOLATE_FIELD_OFFSET | 2222 #undef ISOLATE_FIELD_OFFSET |
2223 #endif | 2223 #endif |
2224 | 2224 |
2225 } } // namespace v8::internal | 2225 } } // namespace v8::internal |
OLD | NEW |