Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: runtime/vm/runtime_entry.cc

Issue 2997243002: Move all the isolate reload code under !defined(DART_PRECOMPILED_RUNTIME) (Closed)
Patch Set: Fix. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« runtime/vm/isolate_reload.cc ('K') | « runtime/vm/object_reload.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 // time. 1612 // time.
1613 if (IsCalleeFrameOf(thread->saved_stack_limit(), stack_pos)) { 1613 if (IsCalleeFrameOf(thread->saved_stack_limit(), stack_pos)) {
1614 // Use the preallocated stack overflow exception to avoid calling 1614 // Use the preallocated stack overflow exception to avoid calling
1615 // into dart code. 1615 // into dart code.
1616 const Instance& exception = 1616 const Instance& exception =
1617 Instance::Handle(isolate->object_store()->stack_overflow()); 1617 Instance::Handle(isolate->object_store()->stack_overflow());
1618 Exceptions::Throw(thread, exception); 1618 Exceptions::Throw(thread, exception);
1619 UNREACHABLE(); 1619 UNREACHABLE();
1620 } 1620 }
1621 1621
1622 #if !defined(PRODUCT) 1622 #if !defined(PRODUCT)
zra 2017/08/19 02:28:58 Is any of this possible in the precompiled runtime
siva 2017/08/23 20:54:51 They are not used, changed this to #if !defined(PR
1623 // The following code is used to stress test deoptimization and 1623 // The following code is used to stress test deoptimization and
1624 // debugger stack tracing. 1624 // debugger stack tracing.
1625 bool do_deopt = false; 1625 bool do_deopt = false;
1626 bool do_stacktrace = false; 1626 bool do_stacktrace = false;
1627 bool do_reload = false; 1627 bool do_reload = false;
1628 const intptr_t isolate_reload_every = 1628 const intptr_t isolate_reload_every =
1629 isolate->reload_every_n_stack_overflow_checks(); 1629 isolate->reload_every_n_stack_overflow_checks();
1630 if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0) || 1630 if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0) ||
1631 (isolate_reload_every > 0)) { 1631 (isolate_reload_every > 0)) {
1632 // TODO(turnidge): To make --deoptimize_every and 1632 // TODO(turnidge): To make --deoptimize_every and
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 strstr(function_name, FLAG_stacktrace_filter) != NULL) { 1669 strstr(function_name, FLAG_stacktrace_filter) != NULL) {
1670 OS::PrintErr("*** Computing stacktrace (%s)\n", 1670 OS::PrintErr("*** Computing stacktrace (%s)\n",
1671 function.ToFullyQualifiedCString()); 1671 function.ToFullyQualifiedCString());
1672 do_stacktrace = true; 1672 do_stacktrace = true;
1673 } 1673 }
1674 } 1674 }
1675 if (do_deopt) { 1675 if (do_deopt) {
1676 // TODO(turnidge): Consider using DeoptimizeAt instead. 1676 // TODO(turnidge): Consider using DeoptimizeAt instead.
1677 DeoptimizeFunctionsOnStack(); 1677 DeoptimizeFunctionsOnStack();
1678 } 1678 }
1679 #if !defined(DART_PRECOMPILED_RUNTIME)
1679 if (do_reload) { 1680 if (do_reload) {
1680 JSONStream js; 1681 JSONStream js;
1681 // Maybe adjust the rate of future reloads. 1682 // Maybe adjust the rate of future reloads.
1682 isolate->MaybeIncreaseReloadEveryNStackOverflowChecks(); 1683 isolate->MaybeIncreaseReloadEveryNStackOverflowChecks();
1683 // Issue a reload. 1684 // Issue a reload.
1684 bool success = isolate->ReloadSources(&js, true /* force_reload */); 1685 bool success = isolate->ReloadSources(&js, true /* force_reload */);
1685 if (!success) { 1686 if (!success) {
1686 FATAL1("*** Isolate reload failed:\n%s\n", js.ToCString()); 1687 FATAL1("*** Isolate reload failed:\n%s\n", js.ToCString());
1687 } 1688 }
1688 } 1689 }
1690 #endif // !defined(DART_PRECOMPILED_RUNTIME)
1689 if (do_stacktrace) { 1691 if (do_stacktrace) {
1690 String& var_name = String::Handle(); 1692 String& var_name = String::Handle();
1691 Instance& var_value = Instance::Handle(); 1693 Instance& var_value = Instance::Handle();
1692 // Collecting the stack trace and accessing local variables 1694 // Collecting the stack trace and accessing local variables
1693 // of frames may trigger parsing of functions to compute 1695 // of frames may trigger parsing of functions to compute
1694 // variable descriptors of functions. Parsing may trigger 1696 // variable descriptors of functions. Parsing may trigger
1695 // code execution, e.g. to compute compile-time constants. Thus, 1697 // code execution, e.g. to compute compile-time constants. Thus,
1696 // disable FLAG_stacktrace_every during trace collection to prevent 1698 // disable FLAG_stacktrace_every during trace collection to prevent
1697 // recursive stack trace collection. 1699 // recursive stack trace collection.
1698 intptr_t saved_stacktrace_every = FLAG_stacktrace_every; 1700 intptr_t saved_stacktrace_every = FLAG_stacktrace_every;
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2361 true /* is_float */, 2363 true /* is_float */,
2362 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan))); 2364 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan)));
2363 2365
2364 DEFINE_RAW_LEAF_RUNTIME_ENTRY( 2366 DEFINE_RAW_LEAF_RUNTIME_ENTRY(
2365 LibcAtan, 2367 LibcAtan,
2366 1, 2368 1,
2367 true /* is_float */, 2369 true /* is_float */,
2368 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan))); 2370 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan)));
2369 2371
2370 } // namespace dart 2372 } // namespace dart
OLDNEW
« runtime/vm/isolate_reload.cc ('K') | « runtime/vm/object_reload.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698