| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/runtime_entry.h" | 5 #include "vm/runtime_entry.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| 11 #include "vm/dart_api_impl.h" | 11 #include "vm/dart_api_impl.h" |
| 12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
| 13 #include "vm/debugger.h" | 13 #include "vm/debugger.h" |
| 14 #include "vm/deopt_instructions.h" | 14 #include "vm/deopt_instructions.h" |
| 15 #include "vm/exceptions.h" | 15 #include "vm/exceptions.h" |
| 16 #include "vm/flags.h" | 16 #include "vm/flags.h" |
| 17 #include "vm/kernel_isolate.h" |
| 17 #include "vm/message.h" | 18 #include "vm/message.h" |
| 18 #include "vm/message_handler.h" | 19 #include "vm/message_handler.h" |
| 19 #include "vm/object_store.h" | 20 #include "vm/object_store.h" |
| 20 #include "vm/parser.h" | 21 #include "vm/parser.h" |
| 21 #include "vm/resolver.h" | 22 #include "vm/resolver.h" |
| 22 #include "vm/service_isolate.h" | 23 #include "vm/service_isolate.h" |
| 23 #include "vm/stack_frame.h" | 24 #include "vm/stack_frame.h" |
| 24 #include "vm/symbols.h" | 25 #include "vm/symbols.h" |
| 25 #include "vm/thread_registry.h" | 26 #include "vm/thread_registry.h" |
| 26 #include "vm/verifier.h" | 27 #include "vm/verifier.h" |
| (...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 #if !defined(PRODUCT) | 1623 #if !defined(PRODUCT) |
| 1623 // The following code is used to stress test deoptimization and | 1624 // The following code is used to stress test deoptimization and |
| 1624 // debugger stack tracing. | 1625 // debugger stack tracing. |
| 1625 bool do_deopt = false; | 1626 bool do_deopt = false; |
| 1626 bool do_stacktrace = false; | 1627 bool do_stacktrace = false; |
| 1627 bool do_reload = false; | 1628 bool do_reload = false; |
| 1628 const intptr_t isolate_reload_every = | 1629 const intptr_t isolate_reload_every = |
| 1629 isolate->reload_every_n_stack_overflow_checks(); | 1630 isolate->reload_every_n_stack_overflow_checks(); |
| 1630 if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0) || | 1631 if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0) || |
| 1631 (isolate_reload_every > 0)) { | 1632 (isolate_reload_every > 0)) { |
| 1632 // TODO(turnidge): To make --deoptimize_every and | 1633 bool is_auxiliary_isolate = ServiceIsolate::IsServiceIsolate(isolate); |
| 1633 // --stacktrace-every faster we could move this increment/test to | 1634 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 1634 // the generated code. | 1635 // Certain flags should not effect the kernel isolate itself. They might be |
| 1635 int32_t count = thread->IncrementAndGetStackOverflowCount(); | 1636 // used by tests via the "VMOptions=--..." annotation to test VM |
| 1636 if (FLAG_deoptimize_every > 0 && (count % FLAG_deoptimize_every) == 0) { | 1637 // functionality in the main isolate. |
| 1637 do_deopt = true; | 1638 is_auxiliary_isolate = |
| 1638 } | 1639 is_auxiliary_isolate || KernelIsolate::IsKernelIsolate(isolate); |
| 1639 if (FLAG_stacktrace_every > 0 && (count % FLAG_stacktrace_every) == 0) { | 1640 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 1640 do_stacktrace = true; | 1641 if (!is_auxiliary_isolate) { |
| 1641 } | 1642 // TODO(turnidge): To make --deoptimize_every and |
| 1642 if ((isolate_reload_every > 0) && (count % isolate_reload_every) == 0) { | 1643 // --stacktrace-every faster we could move this increment/test to |
| 1643 do_reload = isolate->CanReload(); | 1644 // the generated code. |
| 1645 int32_t count = thread->IncrementAndGetStackOverflowCount(); |
| 1646 if (FLAG_deoptimize_every > 0 && (count % FLAG_deoptimize_every) == 0) { |
| 1647 do_deopt = true; |
| 1648 } |
| 1649 if (FLAG_stacktrace_every > 0 && (count % FLAG_stacktrace_every) == 0) { |
| 1650 do_stacktrace = true; |
| 1651 } |
| 1652 if ((isolate_reload_every > 0) && (count % isolate_reload_every) == 0) { |
| 1653 do_reload = isolate->CanReload(); |
| 1654 } |
| 1644 } | 1655 } |
| 1645 } | 1656 } |
| 1646 if ((FLAG_deoptimize_filter != NULL) || (FLAG_stacktrace_filter != NULL) || | 1657 if ((FLAG_deoptimize_filter != NULL) || (FLAG_stacktrace_filter != NULL) || |
| 1647 FLAG_reload_every_optimized) { | 1658 FLAG_reload_every_optimized) { |
| 1648 DartFrameIterator iterator(thread, | 1659 DartFrameIterator iterator(thread, |
| 1649 StackFrameIterator::kNoCrossThreadIteration); | 1660 StackFrameIterator::kNoCrossThreadIteration); |
| 1650 StackFrame* frame = iterator.NextFrame(); | 1661 StackFrame* frame = iterator.NextFrame(); |
| 1651 ASSERT(frame != NULL); | 1662 ASSERT(frame != NULL); |
| 1652 const Code& code = Code::Handle(frame->LookupDartCode()); | 1663 const Code& code = Code::Handle(frame->LookupDartCode()); |
| 1653 ASSERT(!code.IsNull()); | 1664 ASSERT(!code.IsNull()); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2361 true /* is_float */, | 2372 true /* is_float */, |
| 2362 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan))); | 2373 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan))); |
| 2363 | 2374 |
| 2364 DEFINE_RAW_LEAF_RUNTIME_ENTRY( | 2375 DEFINE_RAW_LEAF_RUNTIME_ENTRY( |
| 2365 LibcAtan, | 2376 LibcAtan, |
| 2366 1, | 2377 1, |
| 2367 true /* is_float */, | 2378 true /* is_float */, |
| 2368 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan))); | 2379 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan))); |
| 2369 | 2380 |
| 2370 } // namespace dart | 2381 } // namespace dart |
| OLD | NEW |