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

Side by Side Diff: src/isolate.cc

Issue 12832002: Parallel recompilation: fewer handle dereferences and tighter checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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
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 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 simulator_i_cache_ = NULL; 1706 simulator_i_cache_ = NULL;
1707 simulator_redirection_ = NULL; 1707 simulator_redirection_ = NULL;
1708 #endif 1708 #endif
1709 1709
1710 #ifdef DEBUG 1710 #ifdef DEBUG
1711 // heap_histograms_ initializes itself. 1711 // heap_histograms_ initializes itself.
1712 memset(&js_spill_information_, 0, sizeof(js_spill_information_)); 1712 memset(&js_spill_information_, 0, sizeof(js_spill_information_));
1713 memset(code_kind_statistics_, 0, 1713 memset(code_kind_statistics_, 0,
1714 sizeof(code_kind_statistics_[0]) * Code::NUMBER_OF_KINDS); 1714 sizeof(code_kind_statistics_[0]) * Code::NUMBER_OF_KINDS);
1715 1715
1716 allow_handle_deref_ = true; 1716 allow_compiler_thread_handle_deref_ = true;
1717 allow_execution_thread_handle_deref_ = true;
1717 #endif 1718 #endif
1718 1719
1719 #ifdef ENABLE_DEBUGGER_SUPPORT 1720 #ifdef ENABLE_DEBUGGER_SUPPORT
1720 debug_ = NULL; 1721 debug_ = NULL;
1721 debugger_ = NULL; 1722 debugger_ = NULL;
1722 #endif 1723 #endif
1723 1724
1724 handle_scope_data_.Initialize(); 1725 handle_scope_data_.Initialize();
1725 1726
1726 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \ 1727 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
2314 } 2315 }
2315 if (deferred->next_ != NULL) { 2316 if (deferred->next_ != NULL) {
2316 deferred->next_->previous_ = deferred->previous_; 2317 deferred->next_->previous_ = deferred->previous_;
2317 } 2318 }
2318 if (deferred->previous_ != NULL) { 2319 if (deferred->previous_ != NULL) {
2319 deferred->previous_->next_ = deferred->next_; 2320 deferred->previous_->next_ = deferred->next_;
2320 } 2321 }
2321 } 2322 }
2322 2323
2323 2324
2325 #ifdef DEBUG
2326 bool Isolate::AllowHandleDereference() {
2327 if (allow_execution_thread_handle_deref_ &&
2328 allow_compiler_thread_handle_deref_) {
2329 // Short-cut to avoid polling thread id.
2330 return true;
2331 }
2332 if (FLAG_parallel_recompilation &&
2333 optimizing_compiler_thread()->IsOptimizerThread()) {
2334 return allow_compiler_thread_handle_deref_;
2335 } else {
2336 return allow_execution_thread_handle_deref_;
2337 }
2338 }
2339
2340
2341 void Isolate::SetAllowHandleDereference(bool allow) {
2342 if (FLAG_parallel_recompilation &&
2343 optimizing_compiler_thread()->IsOptimizerThread()) {
2344 allow_compiler_thread_handle_deref_ = allow;
2345 } else {
2346 allow_execution_thread_handle_deref_ = allow;
2347 }
2348 }
2349 #endif
2350
2351
2324 HStatistics* Isolate::GetHStatistics() { 2352 HStatistics* Isolate::GetHStatistics() {
2325 if (hstatistics() == NULL) set_hstatistics(new HStatistics()); 2353 if (hstatistics() == NULL) set_hstatistics(new HStatistics());
2326 return hstatistics(); 2354 return hstatistics();
2327 } 2355 }
2328 2356
2329 2357
2330 HTracer* Isolate::GetHTracer() { 2358 HTracer* Isolate::GetHTracer() {
2331 if (htracer() == NULL) set_htracer(new HTracer(id())); 2359 if (htracer() == NULL) set_htracer(new HTracer(id()));
2332 return htracer(); 2360 return htracer();
2333 } 2361 }
2334 2362
2335 2363
2336 CodeStubInterfaceDescriptor* 2364 CodeStubInterfaceDescriptor*
2337 Isolate::code_stub_interface_descriptor(int index) { 2365 Isolate::code_stub_interface_descriptor(int index) {
2338 return code_stub_interface_descriptors_ + index; 2366 return code_stub_interface_descriptors_ + index;
2339 } 2367 }
2340 2368
2341 2369
2342 #ifdef DEBUG 2370 #ifdef DEBUG
2343 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2371 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2344 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2372 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2345 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2373 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2346 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2374 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2347 #undef ISOLATE_FIELD_OFFSET 2375 #undef ISOLATE_FIELD_OFFSET
2348 #endif 2376 #endif
2349 2377
2350 } } // namespace v8::internal 2378 } } // namespace v8::internal
OLDNEW
« src/hydrogen-instructions.cc ('K') | « src/isolate.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698