Chromium Code Reviews| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 void StackGuard::RequestGC() { | 452 void StackGuard::RequestGC() { |
| 453 ExecutionAccess access(isolate_); | 453 ExecutionAccess access(isolate_); |
| 454 thread_local_.interrupt_flags_ |= GC_REQUEST; | 454 thread_local_.interrupt_flags_ |= GC_REQUEST; |
| 455 if (thread_local_.postpone_interrupts_nesting_ == 0) { | 455 if (thread_local_.postpone_interrupts_nesting_ == 0) { |
| 456 thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit; | 456 thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit; |
| 457 isolate_->heap()->SetStackLimits(); | 457 isolate_->heap()->SetStackLimits(); |
| 458 } | 458 } |
| 459 } | 459 } |
| 460 | 460 |
| 461 | 461 |
| 462 bool StackGuard::IsInstallCodeRequest() { | |
| 463 ExecutionAccess access(isolate_); | |
| 464 return (thread_local_.interrupt_flags_ & INSTALL_CODE) != 0; | |
| 465 } | |
| 466 | |
| 467 | |
| 468 void StackGuard::RequestInstallCode() { | |
| 469 ExecutionAccess access(isolate_); | |
| 470 thread_local_.interrupt_flags_ |= INSTALL_CODE; | |
| 471 if (thread_local_.postpone_interrupts_nesting_ == 0) { | |
| 472 thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit; | |
| 473 isolate_->heap()->SetStackLimits(); | |
| 474 } | |
| 475 } | |
| 476 | |
| 477 | |
| 462 bool StackGuard::IsFullDeopt() { | 478 bool StackGuard::IsFullDeopt() { |
| 463 ExecutionAccess access(isolate_); | 479 ExecutionAccess access(isolate_); |
| 464 return (thread_local_.interrupt_flags_ & FULL_DEOPT) != 0; | 480 return (thread_local_.interrupt_flags_ & FULL_DEOPT) != 0; |
| 465 } | 481 } |
| 466 | 482 |
| 467 | 483 |
| 468 void StackGuard::FullDeopt() { | 484 void StackGuard::FullDeopt() { |
| 469 ExecutionAccess access(isolate_); | 485 ExecutionAccess access(isolate_); |
| 470 thread_local_.interrupt_flags_ |= FULL_DEOPT; | 486 thread_local_.interrupt_flags_ |= FULL_DEOPT; |
| 471 set_interrupt_limits(access); | 487 set_interrupt_limits(access); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 909 } | 925 } |
| 910 | 926 |
| 911 if (stack_guard->IsGCRequest()) { | 927 if (stack_guard->IsGCRequest()) { |
| 912 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 928 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 913 "StackGuard GC request"); | 929 "StackGuard GC request"); |
| 914 stack_guard->Continue(GC_REQUEST); | 930 stack_guard->Continue(GC_REQUEST); |
| 915 } | 931 } |
| 916 | 932 |
| 917 isolate->counters()->stack_interrupts()->Increment(); | 933 isolate->counters()->stack_interrupts()->Increment(); |
| 918 isolate->counters()->runtime_profiler_ticks()->Increment(); | 934 isolate->counters()->runtime_profiler_ticks()->Increment(); |
| 919 isolate->runtime_profiler()->OptimizeNow(); | |
| 920 #ifdef ENABLE_DEBUGGER_SUPPORT | 935 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 921 if (stack_guard->IsDebugBreak() || stack_guard->IsDebugCommand()) { | 936 if (stack_guard->IsDebugBreak() || stack_guard->IsDebugCommand()) { |
| 922 DebugBreakHelper(isolate); | 937 DebugBreakHelper(isolate); |
| 923 } | 938 } |
| 924 #endif | 939 #endif |
| 925 if (stack_guard->IsPreempted()) RuntimePreempt(isolate); | 940 if (stack_guard->IsPreempted()) RuntimePreempt(isolate); |
| 926 if (stack_guard->IsTerminateExecution()) { | 941 if (stack_guard->IsTerminateExecution()) { |
| 927 stack_guard->Continue(TERMINATE); | 942 stack_guard->Continue(TERMINATE); |
| 928 return isolate->TerminateExecution(); | 943 return isolate->TerminateExecution(); |
| 929 } | 944 } |
| 930 if (stack_guard->IsInterrupted()) { | 945 if (stack_guard->IsInterrupted()) { |
| 931 stack_guard->Continue(INTERRUPT); | 946 stack_guard->Continue(INTERRUPT); |
| 932 return isolate->StackOverflow(); | 947 return isolate->StackOverflow(); |
| 933 } | 948 } |
| 934 if (stack_guard->IsFullDeopt()) { | 949 if (stack_guard->IsFullDeopt()) { |
| 935 stack_guard->Continue(FULL_DEOPT); | 950 stack_guard->Continue(FULL_DEOPT); |
| 936 Deoptimizer::DeoptimizeAll(isolate); | 951 Deoptimizer::DeoptimizeAll(isolate); |
| 937 } | 952 } |
| 953 if (FLAG_concurrent_recompilation && stack_guard->IsInstallCodeRequest()) { | |
|
Michael Starzinger
2013/09/12 10:53:10
We should only receive this stack guard request of
| |
| 954 stack_guard->Continue(INSTALL_CODE); | |
| 955 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | |
| 956 } | |
| 957 isolate->runtime_profiler()->OptimizeNow(); | |
| 938 return isolate->heap()->undefined_value(); | 958 return isolate->heap()->undefined_value(); |
| 939 } | 959 } |
| 940 | 960 |
| 941 | 961 |
| 942 } } // namespace v8::internal | 962 } } // namespace v8::internal |
| OLD | NEW |