| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 isolate, | 361 isolate, |
| 362 isolate->run_microtasks(), | 362 isolate->run_microtasks(), |
| 363 isolate->factory()->undefined_value(), | 363 isolate->factory()->undefined_value(), |
| 364 0, | 364 0, |
| 365 NULL, | 365 NULL, |
| 366 &threw); | 366 &threw); |
| 367 ASSERT(!threw); | 367 ASSERT(!threw); |
| 368 } | 368 } |
| 369 | 369 |
| 370 | 370 |
| 371 void Execution::EnqueueMicrotask(Isolate* isolate, Handle<Object> microtask) { |
| 372 bool threw = false; |
| 373 Handle<Object> args[] = { microtask }; |
| 374 Execution::Call( |
| 375 isolate, |
| 376 isolate->enqueue_external_microtask(), |
| 377 isolate->factory()->undefined_value(), |
| 378 1, |
| 379 args, |
| 380 &threw); |
| 381 ASSERT(!threw); |
| 382 } |
| 383 |
| 384 |
| 371 bool StackGuard::IsStackOverflow() { | 385 bool StackGuard::IsStackOverflow() { |
| 372 ExecutionAccess access(isolate_); | 386 ExecutionAccess access(isolate_); |
| 373 return (thread_local_.jslimit_ != kInterruptLimit && | 387 return (thread_local_.jslimit_ != kInterruptLimit && |
| 374 thread_local_.climit_ != kInterruptLimit); | 388 thread_local_.climit_ != kInterruptLimit); |
| 375 } | 389 } |
| 376 | 390 |
| 377 | 391 |
| 378 void StackGuard::EnableInterrupts() { | 392 void StackGuard::EnableInterrupts() { |
| 379 ExecutionAccess access(isolate_); | 393 ExecutionAccess access(isolate_); |
| 380 if (has_pending_interrupts(access)) { | 394 if (has_pending_interrupts(access)) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 509 } |
| 496 | 510 |
| 497 | 511 |
| 498 void StackGuard::FullDeopt() { | 512 void StackGuard::FullDeopt() { |
| 499 ExecutionAccess access(isolate_); | 513 ExecutionAccess access(isolate_); |
| 500 thread_local_.interrupt_flags_ |= FULL_DEOPT; | 514 thread_local_.interrupt_flags_ |= FULL_DEOPT; |
| 501 set_interrupt_limits(access); | 515 set_interrupt_limits(access); |
| 502 } | 516 } |
| 503 | 517 |
| 504 | 518 |
| 505 bool StackGuard::IsDeoptMarkedCode() { | 519 bool StackGuard::IsDeoptMarkedAllocationSites() { |
| 506 ExecutionAccess access(isolate_); | 520 ExecutionAccess access(isolate_); |
| 507 return (thread_local_.interrupt_flags_ & DEOPT_MARKED_CODE) != 0; | 521 return (thread_local_.interrupt_flags_ & DEOPT_MARKED_ALLOCATION_SITES) != 0; |
| 508 } | 522 } |
| 509 | 523 |
| 510 | 524 |
| 511 void StackGuard::DeoptMarkedCode() { | 525 void StackGuard::DeoptMarkedAllocationSites() { |
| 512 ExecutionAccess access(isolate_); | 526 ExecutionAccess access(isolate_); |
| 513 thread_local_.interrupt_flags_ |= DEOPT_MARKED_CODE; | 527 thread_local_.interrupt_flags_ |= DEOPT_MARKED_ALLOCATION_SITES; |
| 514 set_interrupt_limits(access); | 528 set_interrupt_limits(access); |
| 515 } | 529 } |
| 516 | 530 |
| 517 | 531 |
| 518 #ifdef ENABLE_DEBUGGER_SUPPORT | 532 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 519 bool StackGuard::IsDebugBreak() { | 533 bool StackGuard::IsDebugBreak() { |
| 520 ExecutionAccess access(isolate_); | 534 ExecutionAccess access(isolate_); |
| 521 return thread_local_.interrupt_flags_ & DEBUGBREAK; | 535 return thread_local_.interrupt_flags_ & DEBUGBREAK; |
| 522 } | 536 } |
| 523 | 537 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 return isolate->TerminateExecution(); | 1033 return isolate->TerminateExecution(); |
| 1020 } | 1034 } |
| 1021 if (stack_guard->IsInterrupted()) { | 1035 if (stack_guard->IsInterrupted()) { |
| 1022 stack_guard->Continue(INTERRUPT); | 1036 stack_guard->Continue(INTERRUPT); |
| 1023 return isolate->StackOverflow(); | 1037 return isolate->StackOverflow(); |
| 1024 } | 1038 } |
| 1025 if (stack_guard->IsFullDeopt()) { | 1039 if (stack_guard->IsFullDeopt()) { |
| 1026 stack_guard->Continue(FULL_DEOPT); | 1040 stack_guard->Continue(FULL_DEOPT); |
| 1027 Deoptimizer::DeoptimizeAll(isolate); | 1041 Deoptimizer::DeoptimizeAll(isolate); |
| 1028 } | 1042 } |
| 1029 if (stack_guard->IsDeoptMarkedCode()) { | 1043 if (stack_guard->IsDeoptMarkedAllocationSites()) { |
| 1030 stack_guard->Continue(DEOPT_MARKED_CODE); | 1044 stack_guard->Continue(DEOPT_MARKED_ALLOCATION_SITES); |
| 1031 Deoptimizer::DeoptimizeMarkedCode(isolate); | 1045 isolate->heap()->DeoptMarkedAllocationSites(); |
| 1032 } | 1046 } |
| 1033 if (stack_guard->IsInstallCodeRequest()) { | 1047 if (stack_guard->IsInstallCodeRequest()) { |
| 1034 ASSERT(isolate->concurrent_recompilation_enabled()); | 1048 ASSERT(isolate->concurrent_recompilation_enabled()); |
| 1035 stack_guard->Continue(INSTALL_CODE); | 1049 stack_guard->Continue(INSTALL_CODE); |
| 1036 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| 1037 } | 1051 } |
| 1038 isolate->runtime_profiler()->OptimizeNow(); | 1052 isolate->runtime_profiler()->OptimizeNow(); |
| 1039 return isolate->heap()->undefined_value(); | 1053 return isolate->heap()->undefined_value(); |
| 1040 } | 1054 } |
| 1041 | 1055 |
| 1042 | 1056 |
| 1043 } } // namespace v8::internal | 1057 } } // namespace v8::internal |
| OLD | NEW |