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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 set_interrupt_limits(access); | 413 set_interrupt_limits(access); |
414 } | 414 } |
415 | 415 |
416 | 416 |
417 bool StackGuard::IsTerminateExecution() { | 417 bool StackGuard::IsTerminateExecution() { |
418 ExecutionAccess access(isolate_); | 418 ExecutionAccess access(isolate_); |
419 return (thread_local_.interrupt_flags_ & TERMINATE) != 0; | 419 return (thread_local_.interrupt_flags_ & TERMINATE) != 0; |
420 } | 420 } |
421 | 421 |
422 | 422 |
| 423 void StackGuard::ResumeExecution() { |
| 424 ASSERT(thread_local_.interrupt_flags_ & TERMINATE); |
| 425 ExecutionAccess access(isolate_); |
| 426 thread_local_.interrupt_flags_ &= ~static_cast<int>(TERMINATE); |
| 427 if (!should_postpone_interrupts(access) && !has_pending_interrupts(access)) { |
| 428 reset_limits(access); |
| 429 } |
| 430 isolate_->ResumeExecution(); |
| 431 } |
| 432 |
| 433 |
423 void StackGuard::TerminateExecution() { | 434 void StackGuard::TerminateExecution() { |
424 ExecutionAccess access(isolate_); | 435 ExecutionAccess access(isolate_); |
425 thread_local_.interrupt_flags_ |= TERMINATE; | 436 thread_local_.interrupt_flags_ |= TERMINATE; |
426 set_interrupt_limits(access); | 437 set_interrupt_limits(access); |
427 } | 438 } |
428 | 439 |
429 | 440 |
430 bool StackGuard::IsRuntimeProfilerTick() { | 441 bool StackGuard::IsRuntimeProfilerTick() { |
431 ExecutionAccess access(isolate_); | 442 ExecutionAccess access(isolate_); |
432 return (thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK) != 0; | 443 return (thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK) != 0; |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 } | 972 } |
962 if (stack_guard->IsInterrupted()) { | 973 if (stack_guard->IsInterrupted()) { |
963 stack_guard->Continue(INTERRUPT); | 974 stack_guard->Continue(INTERRUPT); |
964 return isolate->StackOverflow(); | 975 return isolate->StackOverflow(); |
965 } | 976 } |
966 return isolate->heap()->undefined_value(); | 977 return isolate->heap()->undefined_value(); |
967 } | 978 } |
968 | 979 |
969 | 980 |
970 } } // namespace v8::internal | 981 } } // namespace v8::internal |
OLD | NEW |