Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: src/isolate.cc

Issue 10807024: Optimize functions on a second thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 write_input_buffer_(NULL), 1486 write_input_buffer_(NULL),
1487 global_handles_(NULL), 1487 global_handles_(NULL),
1488 context_switcher_(NULL), 1488 context_switcher_(NULL),
1489 thread_manager_(NULL), 1489 thread_manager_(NULL),
1490 fp_stubs_generated_(false), 1490 fp_stubs_generated_(false),
1491 has_installed_extensions_(false), 1491 has_installed_extensions_(false),
1492 string_tracker_(NULL), 1492 string_tracker_(NULL),
1493 regexp_stack_(NULL), 1493 regexp_stack_(NULL),
1494 date_cache_(NULL), 1494 date_cache_(NULL),
1495 context_exit_happened_(false), 1495 context_exit_happened_(false),
1496 deferred_handles_head_(NULL) { 1496 deferred_handles_head_(NULL),
1497 optimizing_compiler_thread_(this) {
1497 TRACE_ISOLATE(constructor); 1498 TRACE_ISOLATE(constructor);
1498 1499
1499 memset(isolate_addresses_, 0, 1500 memset(isolate_addresses_, 0,
1500 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); 1501 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1));
1501 1502
1502 heap_.isolate_ = this; 1503 heap_.isolate_ = this;
1503 stack_guard_.isolate_ = this; 1504 stack_guard_.isolate_ = this;
1504 1505
1505 // ThreadManager is initialized early to support locking an isolate 1506 // ThreadManager is initialized early to support locking an isolate
1506 // before it is entered. 1507 // before it is entered.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 1568
1568 // Restore the previous current isolate. 1569 // Restore the previous current isolate.
1569 SetIsolateThreadLocals(saved_isolate, saved_data); 1570 SetIsolateThreadLocals(saved_isolate, saved_data);
1570 } 1571 }
1571 1572
1572 1573
1573 void Isolate::Deinit() { 1574 void Isolate::Deinit() {
1574 if (state_ == INITIALIZED) { 1575 if (state_ == INITIALIZED) {
1575 TRACE_ISOLATE(deinit); 1576 TRACE_ISOLATE(deinit);
1576 1577
1578 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop();
1579
1577 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); 1580 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print();
1578 1581
1579 // We must stop the logger before we tear down other components. 1582 // We must stop the logger before we tear down other components.
1580 logger_->EnsureTickerStopped(); 1583 logger_->EnsureTickerStopped();
1581 1584
1582 delete deoptimizer_data_; 1585 delete deoptimizer_data_;
1583 deoptimizer_data_ = NULL; 1586 deoptimizer_data_ = NULL;
1584 if (FLAG_preemption) { 1587 if (FLAG_preemption) {
1585 v8::Locker locker; 1588 v8::Locker locker;
1586 v8::Locker::StopPreemption(); 1589 v8::Locker::StopPreemption();
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 1911
1909 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)), 1912 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)),
1910 Internals::kIsolateStateOffset); 1913 Internals::kIsolateStateOffset);
1911 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)), 1914 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)),
1912 Internals::kIsolateEmbedderDataOffset); 1915 Internals::kIsolateEmbedderDataOffset);
1913 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), 1916 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)),
1914 Internals::kIsolateRootsOffset); 1917 Internals::kIsolateRootsOffset);
1915 1918
1916 state_ = INITIALIZED; 1919 state_ = INITIALIZED;
1917 time_millis_at_init_ = OS::TimeCurrentMillis(); 1920 time_millis_at_init_ = OS::TimeCurrentMillis();
1921 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start();
1918 return true; 1922 return true;
1919 } 1923 }
1920 1924
1921 1925
1922 // Initialized lazily to allow early 1926 // Initialized lazily to allow early
1923 // v8::V8::SetAddHistogramSampleFunction calls. 1927 // v8::V8::SetAddHistogramSampleFunction calls.
1924 StatsTable* Isolate::stats_table() { 1928 StatsTable* Isolate::stats_table() {
1925 if (stats_table_ == NULL) { 1929 if (stats_table_ == NULL) {
1926 stats_table_ = new StatsTable; 1930 stats_table_ = new StatsTable;
1927 } 1931 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 2034
2031 #ifdef DEBUG 2035 #ifdef DEBUG
2032 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2036 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2033 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2037 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2034 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2038 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2035 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2039 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2036 #undef ISOLATE_FIELD_OFFSET 2040 #undef ISOLATE_FIELD_OFFSET
2037 #endif 2041 #endif
2038 2042
2039 } } // namespace v8::internal 2043 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698