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" |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 // recursive stack trace collection. | 1742 // recursive stack trace collection. |
1743 intptr_t saved_stacktrace_every = FLAG_stacktrace_every; | 1743 intptr_t saved_stacktrace_every = FLAG_stacktrace_every; |
1744 FLAG_stacktrace_every = 0; | 1744 FLAG_stacktrace_every = 0; |
1745 DebuggerStackTrace* stack = isolate->debugger()->StackTrace(); | 1745 DebuggerStackTrace* stack = isolate->debugger()->StackTrace(); |
1746 intptr_t num_frames = stack->Length(); | 1746 intptr_t num_frames = stack->Length(); |
1747 for (intptr_t i = 0; i < num_frames; i++) { | 1747 for (intptr_t i = 0; i < num_frames; i++) { |
1748 ActivationFrame* frame = stack->FrameAt(i); | 1748 ActivationFrame* frame = stack->FrameAt(i); |
1749 #ifndef DART_PRECOMPILED_RUNTIME | 1749 #ifndef DART_PRECOMPILED_RUNTIME |
1750 // Ensure that we have unoptimized code. | 1750 // Ensure that we have unoptimized code. |
1751 frame->function().EnsureHasCompiledUnoptimizedCode(); | 1751 frame->function().EnsureHasCompiledUnoptimizedCode(); |
| 1752 const int num_vars = frame->NumLocalVariables(); |
| 1753 #else |
| 1754 // Variable locations and number are unknown when precompiling. |
| 1755 const int num_vars = 0; |
1752 #endif | 1756 #endif |
1753 // Variable locations and number are unknown when precompiling. | |
1754 const int num_vars = | |
1755 FLAG_precompiled_runtime ? 0 : frame->NumLocalVariables(); | |
1756 TokenPosition unused = TokenPosition::kNoSource; | 1757 TokenPosition unused = TokenPosition::kNoSource; |
1757 for (intptr_t v = 0; v < num_vars; v++) { | 1758 for (intptr_t v = 0; v < num_vars; v++) { |
1758 frame->VariableAt(v, &var_name, &unused, &unused, &unused, &var_value); | 1759 frame->VariableAt(v, &var_name, &unused, &unused, &unused, &var_value); |
1759 } | 1760 } |
1760 } | 1761 } |
1761 if (FLAG_stress_async_stacks) { | 1762 if (FLAG_stress_async_stacks) { |
1762 Debugger::CollectAwaiterReturnStackTrace(); | 1763 Debugger::CollectAwaiterReturnStackTrace(); |
1763 } | 1764 } |
1764 FLAG_stacktrace_every = saved_stacktrace_every; | 1765 FLAG_stacktrace_every = saved_stacktrace_every; |
1765 } | 1766 } |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 const Object& value = Object::Handle(arguments.ArgAt(1)); | 2335 const Object& value = Object::Handle(arguments.ArgAt(1)); |
2335 field.RecordStore(value); | 2336 field.RecordStore(value); |
2336 } | 2337 } |
2337 | 2338 |
2338 | 2339 |
2339 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { | 2340 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { |
2340 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 2341 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
2341 field.EvaluateInitializer(); | 2342 field.EvaluateInitializer(); |
2342 } | 2343 } |
2343 | 2344 |
| 2345 |
| 2346 // Print the stop message. |
| 2347 DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) { |
| 2348 OS::Print("Stop message: %s\n", message); |
| 2349 } |
| 2350 END_LEAF_RUNTIME_ENTRY |
| 2351 |
| 2352 |
2344 // Use expected function signatures to help MSVC compiler resolve overloading. | 2353 // Use expected function signatures to help MSVC compiler resolve overloading. |
2345 typedef double (*UnaryMathCFunction)(double x); | 2354 typedef double (*UnaryMathCFunction)(double x); |
2346 typedef double (*BinaryMathCFunction)(double x, double y); | 2355 typedef double (*BinaryMathCFunction)(double x, double y); |
2347 | 2356 |
2348 DEFINE_RAW_LEAF_RUNTIME_ENTRY( | 2357 DEFINE_RAW_LEAF_RUNTIME_ENTRY( |
2349 LibcPow, | 2358 LibcPow, |
2350 2, | 2359 2, |
2351 true /* is_float */, | 2360 true /* is_float */, |
2352 reinterpret_cast<RuntimeFunction>(static_cast<BinaryMathCFunction>(&pow))); | 2361 reinterpret_cast<RuntimeFunction>(static_cast<BinaryMathCFunction>(&pow))); |
2353 | 2362 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2419 true /* is_float */, | 2428 true /* is_float */, |
2420 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan))); | 2429 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan))); |
2421 | 2430 |
2422 DEFINE_RAW_LEAF_RUNTIME_ENTRY( | 2431 DEFINE_RAW_LEAF_RUNTIME_ENTRY( |
2423 LibcAtan, | 2432 LibcAtan, |
2424 1, | 2433 1, |
2425 true /* is_float */, | 2434 true /* is_float */, |
2426 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan))); | 2435 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan))); |
2427 | 2436 |
2428 } // namespace dart | 2437 } // namespace dart |
OLD | NEW |