| 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 23 matching lines...) Expand all Loading... |
| 34 #include "codegen.h" | 34 #include "codegen.h" |
| 35 #include "compilation-cache.h" | 35 #include "compilation-cache.h" |
| 36 #include "debug.h" | 36 #include "debug.h" |
| 37 #include "deoptimizer.h" | 37 #include "deoptimizer.h" |
| 38 #include "heap-profiler.h" | 38 #include "heap-profiler.h" |
| 39 #include "hydrogen.h" | 39 #include "hydrogen.h" |
| 40 #include "isolate.h" | 40 #include "isolate.h" |
| 41 #include "lithium-allocator.h" | 41 #include "lithium-allocator.h" |
| 42 #include "log.h" | 42 #include "log.h" |
| 43 #include "messages.h" | 43 #include "messages.h" |
| 44 #include "optimizing-compiler-thread.h" |
| 44 #include "platform.h" | 45 #include "platform.h" |
| 45 #include "regexp-stack.h" | 46 #include "regexp-stack.h" |
| 46 #include "runtime-profiler.h" | 47 #include "runtime-profiler.h" |
| 47 #include "scopeinfo.h" | 48 #include "scopeinfo.h" |
| 48 #include "serialize.h" | 49 #include "serialize.h" |
| 49 #include "simulator.h" | 50 #include "simulator.h" |
| 50 #include "spaces.h" | 51 #include "spaces.h" |
| 51 #include "stub-cache.h" | 52 #include "stub-cache.h" |
| 52 #include "version.h" | 53 #include "version.h" |
| 53 #include "vm-state-inl.h" | 54 #include "vm-state-inl.h" |
| (...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 SetIsolateThreadLocals(saved_isolate, saved_data); | 1546 SetIsolateThreadLocals(saved_isolate, saved_data); |
| 1546 } | 1547 } |
| 1547 | 1548 |
| 1548 | 1549 |
| 1549 void Isolate::Deinit() { | 1550 void Isolate::Deinit() { |
| 1550 if (state_ == INITIALIZED) { | 1551 if (state_ == INITIALIZED) { |
| 1551 TRACE_ISOLATE(deinit); | 1552 TRACE_ISOLATE(deinit); |
| 1552 | 1553 |
| 1553 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); | 1554 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); |
| 1554 | 1555 |
| 1556 if (FLAG_optimize_in_parallel) { |
| 1557 ASSERT(optimizing_compiler_thread_); |
| 1558 optimizing_compiler_thread_->StopThread(); |
| 1559 delete optimizing_compiler_thread_; |
| 1560 optimizing_compiler_thread_ = NULL; |
| 1561 } |
| 1562 |
| 1555 // We must stop the logger before we tear down other components. | 1563 // We must stop the logger before we tear down other components. |
| 1556 logger_->EnsureTickerStopped(); | 1564 logger_->EnsureTickerStopped(); |
| 1557 | 1565 |
| 1558 delete deoptimizer_data_; | 1566 delete deoptimizer_data_; |
| 1559 deoptimizer_data_ = NULL; | 1567 deoptimizer_data_ = NULL; |
| 1560 if (FLAG_preemption) { | 1568 if (FLAG_preemption) { |
| 1561 v8::Locker locker; | 1569 v8::Locker locker; |
| 1562 v8::Locker::StopPreemption(); | 1570 v8::Locker::StopPreemption(); |
| 1563 } | 1571 } |
| 1564 builtins_.TearDown(); | 1572 builtins_.TearDown(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1585 } | 1593 } |
| 1586 | 1594 |
| 1587 | 1595 |
| 1588 void Isolate::SetIsolateThreadLocals(Isolate* isolate, | 1596 void Isolate::SetIsolateThreadLocals(Isolate* isolate, |
| 1589 PerIsolateThreadData* data) { | 1597 PerIsolateThreadData* data) { |
| 1590 Thread::SetThreadLocal(isolate_key_, isolate); | 1598 Thread::SetThreadLocal(isolate_key_, isolate); |
| 1591 Thread::SetThreadLocal(per_isolate_thread_data_key_, data); | 1599 Thread::SetThreadLocal(per_isolate_thread_data_key_, data); |
| 1592 } | 1600 } |
| 1593 | 1601 |
| 1594 | 1602 |
| 1603 void Isolate::queue_for_optimization(Handle<JSFunction> function) { |
| 1604 ASSERT(FLAG_optimize_in_parallel); |
| 1605 optimizing_compiler_thread_->QueueForOptimization(function); |
| 1606 } |
| 1607 |
| 1608 |
| 1595 Isolate::~Isolate() { | 1609 Isolate::~Isolate() { |
| 1596 TRACE_ISOLATE(destructor); | 1610 TRACE_ISOLATE(destructor); |
| 1597 | 1611 |
| 1598 // Has to be called while counters_ are still alive. | 1612 // Has to be called while counters_ are still alive. |
| 1599 zone_.DeleteKeptSegment(); | 1613 zone_.DeleteKeptSegment(); |
| 1600 | 1614 |
| 1601 delete[] assembler_spare_buffer_; | 1615 delete[] assembler_spare_buffer_; |
| 1602 assembler_spare_buffer_ = NULL; | 1616 assembler_spare_buffer_ = NULL; |
| 1603 | 1617 |
| 1604 delete unicode_cache_; | 1618 delete unicode_cache_; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 LOG(this, LogCompiledFunctions()); | 1871 LOG(this, LogCompiledFunctions()); |
| 1858 } | 1872 } |
| 1859 | 1873 |
| 1860 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)), | 1874 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)), |
| 1861 Internals::kIsolateStateOffset); | 1875 Internals::kIsolateStateOffset); |
| 1862 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)), | 1876 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)), |
| 1863 Internals::kIsolateEmbedderDataOffset); | 1877 Internals::kIsolateEmbedderDataOffset); |
| 1864 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), | 1878 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), |
| 1865 Internals::kIsolateRootsOffset); | 1879 Internals::kIsolateRootsOffset); |
| 1866 | 1880 |
| 1881 if (FLAG_optimize_in_parallel) { |
| 1882 optimizing_compiler_thread_ = new OptimizingCompilerThread(this); |
| 1883 optimizing_compiler_thread_->Start(); |
| 1884 } |
| 1885 |
| 1867 state_ = INITIALIZED; | 1886 state_ = INITIALIZED; |
| 1868 time_millis_at_init_ = OS::TimeCurrentMillis(); | 1887 time_millis_at_init_ = OS::TimeCurrentMillis(); |
| 1869 return true; | 1888 return true; |
| 1870 } | 1889 } |
| 1871 | 1890 |
| 1872 | 1891 |
| 1873 // Initialized lazily to allow early | 1892 // Initialized lazily to allow early |
| 1874 // v8::V8::SetAddHistogramSampleFunction calls. | 1893 // v8::V8::SetAddHistogramSampleFunction calls. |
| 1875 StatsTable* Isolate::stats_table() { | 1894 StatsTable* Isolate::stats_table() { |
| 1876 if (stats_table_ == NULL) { | 1895 if (stats_table_ == NULL) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1951 | 1970 |
| 1952 #ifdef DEBUG | 1971 #ifdef DEBUG |
| 1953 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1972 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 1954 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1973 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 1955 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1974 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 1956 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1975 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 1957 #undef ISOLATE_FIELD_OFFSET | 1976 #undef ISOLATE_FIELD_OFFSET |
| 1958 #endif | 1977 #endif |
| 1959 | 1978 |
| 1960 } } // namespace v8::internal | 1979 } } // namespace v8::internal |
| OLD | NEW |