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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 thread_local_.real_jslimit_ = jslimit; | 369 thread_local_.real_jslimit_ = jslimit; |
370 } | 370 } |
371 | 371 |
372 | 372 |
373 void StackGuard::DisableInterrupts() { | 373 void StackGuard::DisableInterrupts() { |
374 ExecutionAccess access(isolate_); | 374 ExecutionAccess access(isolate_); |
375 reset_limits(access); | 375 reset_limits(access); |
376 } | 376 } |
377 | 377 |
378 | 378 |
| 379 bool StackGuard::ShouldPostponeInterrupts() { |
| 380 ExecutionAccess access(isolate_); |
| 381 return should_postpone_interrupts(access); |
| 382 } |
| 383 |
| 384 |
379 bool StackGuard::IsInterrupted() { | 385 bool StackGuard::IsInterrupted() { |
380 ExecutionAccess access(isolate_); | 386 ExecutionAccess access(isolate_); |
381 return (thread_local_.interrupt_flags_ & INTERRUPT) != 0; | 387 return (thread_local_.interrupt_flags_ & INTERRUPT) != 0; |
382 } | 388 } |
383 | 389 |
384 | 390 |
385 void StackGuard::Interrupt() { | 391 void StackGuard::Interrupt() { |
386 ExecutionAccess access(isolate_); | 392 ExecutionAccess access(isolate_); |
387 thread_local_.interrupt_flags_ |= INTERRUPT; | 393 thread_local_.interrupt_flags_ |= INTERRUPT; |
388 set_interrupt_limits(access); | 394 set_interrupt_limits(access); |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 // a debug command break. | 873 // a debug command break. |
868 isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(), | 874 isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(), |
869 debug_command_only); | 875 debug_command_only); |
870 } | 876 } |
871 | 877 |
872 | 878 |
873 #endif | 879 #endif |
874 | 880 |
875 MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { | 881 MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { |
876 StackGuard* stack_guard = isolate->stack_guard(); | 882 StackGuard* stack_guard = isolate->stack_guard(); |
| 883 if (stack_guard->ShouldPostponeInterrupts()) { |
| 884 return isolate->heap()->undefined_value(); |
| 885 } |
877 | 886 |
878 if (stack_guard->IsGCRequest()) { | 887 if (stack_guard->IsGCRequest()) { |
879 isolate->heap()->CollectAllGarbage(false, "StackGuard GC request"); | 888 isolate->heap()->CollectAllGarbage(false, "StackGuard GC request"); |
880 stack_guard->Continue(GC_REQUEST); | 889 stack_guard->Continue(GC_REQUEST); |
881 } | 890 } |
882 | 891 |
883 isolate->counters()->stack_interrupts()->Increment(); | 892 isolate->counters()->stack_interrupts()->Increment(); |
884 // If FLAG_count_based_interrupts, every interrupt is a profiler interrupt. | 893 // If FLAG_count_based_interrupts, every interrupt is a profiler interrupt. |
885 if (FLAG_count_based_interrupts || | 894 if (FLAG_count_based_interrupts || |
886 stack_guard->IsRuntimeProfilerTick()) { | 895 stack_guard->IsRuntimeProfilerTick()) { |
(...skipping 13 matching lines...) Expand all Loading... |
900 } | 909 } |
901 if (stack_guard->IsInterrupted()) { | 910 if (stack_guard->IsInterrupted()) { |
902 stack_guard->Continue(INTERRUPT); | 911 stack_guard->Continue(INTERRUPT); |
903 return isolate->StackOverflow(); | 912 return isolate->StackOverflow(); |
904 } | 913 } |
905 return isolate->heap()->undefined_value(); | 914 return isolate->heap()->undefined_value(); |
906 } | 915 } |
907 | 916 |
908 | 917 |
909 } } // namespace v8::internal | 918 } } // namespace v8::internal |
OLD | NEW |