| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/code_generator.h" | 5 #include "vm/code_generator.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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 DEFINE_FLAG(int, stacktrace_every, 0, | 57 DEFINE_FLAG(int, stacktrace_every, 0, |
| 58 "Compute debugger stacktrace on every N stack overflow checks"); | 58 "Compute debugger stacktrace on every N stack overflow checks"); |
| 59 DEFINE_FLAG(charp, stacktrace_filter, NULL, | 59 DEFINE_FLAG(charp, stacktrace_filter, NULL, |
| 60 "Compute stacktrace in named function on stack overflow checks"); | 60 "Compute stacktrace in named function on stack overflow checks"); |
| 61 DEFINE_FLAG(charp, deoptimize_filter, NULL, | 61 DEFINE_FLAG(charp, deoptimize_filter, NULL, |
| 62 "Deoptimize in named function on stack overflow checks"); | 62 "Deoptimize in named function on stack overflow checks"); |
| 63 | 63 |
| 64 DECLARE_FLAG(int, reload_every); | 64 DECLARE_FLAG(int, reload_every); |
| 65 DECLARE_FLAG(bool, reload_every_optimized); | 65 DECLARE_FLAG(bool, reload_every_optimized); |
| 66 DECLARE_FLAG(bool, reload_every_back_off); |
| 66 | 67 |
| 67 #ifdef DEBUG | 68 #ifdef DEBUG |
| 68 DEFINE_FLAG(charp, gc_at_instance_allocation, NULL, | 69 DEFINE_FLAG(charp, gc_at_instance_allocation, NULL, |
| 69 "Perform a GC before allocation of instances of " | 70 "Perform a GC before allocation of instances of " |
| 70 "the specified class"); | 71 "the specified class"); |
| 71 #endif | 72 #endif |
| 72 | 73 |
| 73 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { | 74 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { |
| 74 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); | 75 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
| 75 const String& function_name = String::Handle(function.name()); | 76 const String& function_name = String::Handle(function.name()); |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 OS::PrintErr("*** Computing stacktrace (%s)\n", | 1290 OS::PrintErr("*** Computing stacktrace (%s)\n", |
| 1290 function.ToFullyQualifiedCString()); | 1291 function.ToFullyQualifiedCString()); |
| 1291 do_stacktrace = true; | 1292 do_stacktrace = true; |
| 1292 } | 1293 } |
| 1293 } | 1294 } |
| 1294 if (do_deopt) { | 1295 if (do_deopt) { |
| 1295 // TODO(turnidge): Consider using DeoptimizeAt instead. | 1296 // TODO(turnidge): Consider using DeoptimizeAt instead. |
| 1296 DeoptimizeFunctionsOnStack(); | 1297 DeoptimizeFunctionsOnStack(); |
| 1297 } | 1298 } |
| 1298 if (do_reload) { | 1299 if (do_reload) { |
| 1300 if (FLAG_reload_every_back_off) { |
| 1301 FLAG_reload_every *= 2; |
| 1302 } |
| 1299 NOT_IN_PRODUCT(isolate->ReloadSources();) | 1303 NOT_IN_PRODUCT(isolate->ReloadSources();) |
| 1300 } | 1304 } |
| 1301 if (FLAG_support_debugger && do_stacktrace) { | 1305 if (FLAG_support_debugger && do_stacktrace) { |
| 1302 String& var_name = String::Handle(); | 1306 String& var_name = String::Handle(); |
| 1303 Instance& var_value = Instance::Handle(); | 1307 Instance& var_value = Instance::Handle(); |
| 1304 // Collecting the stack trace and accessing local variables | 1308 // Collecting the stack trace and accessing local variables |
| 1305 // of frames may trigger parsing of functions to compute | 1309 // of frames may trigger parsing of functions to compute |
| 1306 // variable descriptors of functions. Parsing may trigger | 1310 // variable descriptors of functions. Parsing may trigger |
| 1307 // code execution, e.g. to compute compile-time constants. Thus, | 1311 // code execution, e.g. to compute compile-time constants. Thus, |
| 1308 // disable FLAG_stacktrace_every during trace collection to prevent | 1312 // disable FLAG_stacktrace_every during trace collection to prevent |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1882 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
| 1879 const TypedData& new_data = | 1883 const TypedData& new_data = |
| 1880 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1884 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
| 1881 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1885 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
| 1882 typed_data_cell.SetAt(0, new_data); | 1886 typed_data_cell.SetAt(0, new_data); |
| 1883 arguments.SetReturn(new_data); | 1887 arguments.SetReturn(new_data); |
| 1884 } | 1888 } |
| 1885 | 1889 |
| 1886 | 1890 |
| 1887 } // namespace dart | 1891 } // namespace dart |
| OLD | NEW |