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

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

Powered by Google App Engine
This is Rietveld 408576698