OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "execution.h" | 5 #include "execution.h" |
6 | 6 |
7 #include "bootstrapper.h" | 7 #include "bootstrapper.h" |
8 #include "codegen.h" | 8 #include "codegen.h" |
9 #include "deoptimizer.h" | 9 #include "deoptimizer.h" |
10 #include "isolate-inl.h" | 10 #include "isolate-inl.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 300 } |
301 | 301 |
302 // If the Object doesn't have an instance-call handler we should | 302 // If the Object doesn't have an instance-call handler we should |
303 // throw a non-callable exception. | 303 // throw a non-callable exception. |
304 i::Handle<i::Object> error_obj = isolate->factory()->NewTypeError( | 304 i::Handle<i::Object> error_obj = isolate->factory()->NewTypeError( |
305 "called_non_callable", i::HandleVector<i::Object>(&object, 1)); | 305 "called_non_callable", i::HandleVector<i::Object>(&object, 1)); |
306 return isolate->Throw<Object>(error_obj); | 306 return isolate->Throw<Object>(error_obj); |
307 } | 307 } |
308 | 308 |
309 | 309 |
310 void Execution::RunMicrotasks(Isolate* isolate) { | |
311 ASSERT(isolate->microtask_pending()); | |
312 Execution::Call( | |
313 isolate, | |
314 isolate->run_microtasks(), | |
315 isolate->factory()->undefined_value(), | |
316 0, | |
317 NULL).Check(); | |
318 } | |
319 | |
320 | |
321 void Execution::EnqueueMicrotask(Isolate* isolate, Handle<Object> microtask) { | |
322 Handle<Object> args[] = { microtask }; | |
323 Execution::Call( | |
324 isolate, | |
325 isolate->enqueue_microtask(), | |
326 isolate->factory()->undefined_value(), | |
327 1, | |
328 args).Check(); | |
329 } | |
330 | |
331 | |
332 bool StackGuard::IsStackOverflow() { | 310 bool StackGuard::IsStackOverflow() { |
333 ExecutionAccess access(isolate_); | 311 ExecutionAccess access(isolate_); |
334 return (thread_local_.jslimit_ != kInterruptLimit && | 312 return (thread_local_.jslimit_ != kInterruptLimit && |
335 thread_local_.climit_ != kInterruptLimit); | 313 thread_local_.climit_ != kInterruptLimit); |
336 } | 314 } |
337 | 315 |
338 | 316 |
339 void StackGuard::EnableInterrupts() { | 317 void StackGuard::EnableInterrupts() { |
340 ExecutionAccess access(isolate_); | 318 ExecutionAccess access(isolate_); |
341 if (has_pending_interrupts(access)) { | 319 if (has_pending_interrupts(access)) { |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 747 isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
770 } | 748 } |
771 | 749 |
772 isolate_->counters()->stack_interrupts()->Increment(); | 750 isolate_->counters()->stack_interrupts()->Increment(); |
773 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 751 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
774 isolate_->runtime_profiler()->OptimizeNow(); | 752 isolate_->runtime_profiler()->OptimizeNow(); |
775 return isolate_->heap()->undefined_value(); | 753 return isolate_->heap()->undefined_value(); |
776 } | 754 } |
777 | 755 |
778 } } // namespace v8::internal | 756 } } // namespace v8::internal |
OLD | NEW |