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

Side by Side Diff: src/execution.cc

Issue 177493002: Introduce SynchronizedScope to allow heap access from compiler thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 void StackGuard::RequestInstallCode() { 496 void StackGuard::RequestInstallCode() {
497 ExecutionAccess access(isolate_); 497 ExecutionAccess access(isolate_);
498 thread_local_.interrupt_flags_ |= INSTALL_CODE; 498 thread_local_.interrupt_flags_ |= INSTALL_CODE;
499 if (thread_local_.postpone_interrupts_nesting_ == 0) { 499 if (thread_local_.postpone_interrupts_nesting_ == 0) {
500 thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit; 500 thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
501 isolate_->heap()->SetStackLimits(); 501 isolate_->heap()->SetStackLimits();
502 } 502 }
503 } 503 }
504 504
505 505
506 bool StackGuard::IsCompilerSyncRequest() {
507 ExecutionAccess access(isolate_);
508 return (thread_local_.interrupt_flags_ & COMPILER_SYNC) != 0;
509 }
510
511
512 void StackGuard::RequestCompilerSync() {
513 ExecutionAccess access(isolate_);
514 thread_local_.interrupt_flags_ |= COMPILER_SYNC;
515 if (thread_local_.postpone_interrupts_nesting_ == 0) {
516 thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
517 isolate_->heap()->SetStackLimits();
518 }
519 }
520
521
506 bool StackGuard::IsFullDeopt() { 522 bool StackGuard::IsFullDeopt() {
507 ExecutionAccess access(isolate_); 523 ExecutionAccess access(isolate_);
508 return (thread_local_.interrupt_flags_ & FULL_DEOPT) != 0; 524 return (thread_local_.interrupt_flags_ & FULL_DEOPT) != 0;
509 } 525 }
510 526
511 527
512 void StackGuard::FullDeopt() { 528 void StackGuard::FullDeopt() {
513 ExecutionAccess access(isolate_); 529 ExecutionAccess access(isolate_);
514 thread_local_.interrupt_flags_ |= FULL_DEOPT; 530 thread_local_.interrupt_flags_ |= FULL_DEOPT;
515 set_interrupt_limits(access); 531 set_interrupt_limits(access);
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 } 1058 }
1043 if (stack_guard->IsDeoptMarkedAllocationSites()) { 1059 if (stack_guard->IsDeoptMarkedAllocationSites()) {
1044 stack_guard->Continue(DEOPT_MARKED_ALLOCATION_SITES); 1060 stack_guard->Continue(DEOPT_MARKED_ALLOCATION_SITES);
1045 isolate->heap()->DeoptMarkedAllocationSites(); 1061 isolate->heap()->DeoptMarkedAllocationSites();
1046 } 1062 }
1047 if (stack_guard->IsInstallCodeRequest()) { 1063 if (stack_guard->IsInstallCodeRequest()) {
1048 ASSERT(isolate->concurrent_recompilation_enabled()); 1064 ASSERT(isolate->concurrent_recompilation_enabled());
1049 stack_guard->Continue(INSTALL_CODE); 1065 stack_guard->Continue(INSTALL_CODE);
1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); 1066 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
1051 } 1067 }
1052 isolate->runtime_profiler()->OptimizeNow(); 1068 if (stack_guard->IsCompilerSyncRequest()) {
1069 ASSERT(isolate->concurrent_recompilation_enabled());
1070 stack_guard->Continue(COMPILER_SYNC);
1071 isolate->optimizing_compiler_thread()->YieldToCompilerThread();
1072 } else {
1073 isolate->runtime_profiler()->OptimizeNow();
1074 }
1053 return isolate->heap()->undefined_value(); 1075 return isolate->heap()->undefined_value();
1054 } 1076 }
1055 1077
1056 1078
1057 } } // namespace v8::internal 1079 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.h ('k') | src/log.h » ('j') | src/optimizing-compiler-thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698