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::EnqueueExternalMicrotask(Isolate* isolate, |
| 372 v8::MicrotaskCallback callback) { |
| 373 bool threw = false; |
| 374 Handle<Object> handler = v8::FromCData(isolate, callback); |
| 375 Handle<Object> args[] = { handler }; |
| 376 Execution::Call( |
| 377 isolate, |
| 378 isolate->enqueue_external_microtask(), |
| 379 isolate->factory()->undefined_value(), |
| 380 1, |
| 381 args, |
| 382 &threw); |
| 383 ASSERT(!threw); |
| 384 } |
| 385 |
| 386 |
371 bool StackGuard::IsStackOverflow() { | 387 bool StackGuard::IsStackOverflow() { |
372 ExecutionAccess access(isolate_); | 388 ExecutionAccess access(isolate_); |
373 return (thread_local_.jslimit_ != kInterruptLimit && | 389 return (thread_local_.jslimit_ != kInterruptLimit && |
374 thread_local_.climit_ != kInterruptLimit); | 390 thread_local_.climit_ != kInterruptLimit); |
375 } | 391 } |
376 | 392 |
377 | 393 |
378 void StackGuard::EnableInterrupts() { | 394 void StackGuard::EnableInterrupts() { |
379 ExecutionAccess access(isolate_); | 395 ExecutionAccess access(isolate_); |
380 if (has_pending_interrupts(access)) { | 396 if (has_pending_interrupts(access)) { |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 ASSERT(isolate->concurrent_recompilation_enabled()); | 1050 ASSERT(isolate->concurrent_recompilation_enabled()); |
1035 stack_guard->Continue(INSTALL_CODE); | 1051 stack_guard->Continue(INSTALL_CODE); |
1036 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 1052 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
1037 } | 1053 } |
1038 isolate->runtime_profiler()->OptimizeNow(); | 1054 isolate->runtime_profiler()->OptimizeNow(); |
1039 return isolate->heap()->undefined_value(); | 1055 return isolate->heap()->undefined_value(); |
1040 } | 1056 } |
1041 | 1057 |
1042 | 1058 |
1043 } } // namespace v8::internal | 1059 } } // namespace v8::internal |
OLD | NEW |