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

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

Issue 1423063005: VM: Speculative inlining in precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 1 month 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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | 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) 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 DECLARE_FLAG(bool, support_debugger); 68 DECLARE_FLAG(bool, support_debugger);
69 DECLARE_FLAG(bool, use_field_guards); 69 DECLARE_FLAG(bool, use_field_guards);
70 DECLARE_FLAG(bool, use_cha_deopt); 70 DECLARE_FLAG(bool, use_cha_deopt);
71 DECLARE_FLAG(bool, use_osr); 71 DECLARE_FLAG(bool, use_osr);
72 DECLARE_FLAG(bool, warn_on_javascript_compatibility); 72 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
73 DECLARE_FLAG(bool, print_stop_message); 73 DECLARE_FLAG(bool, print_stop_message);
74 DECLARE_FLAG(bool, lazy_dispatchers); 74 DECLARE_FLAG(bool, lazy_dispatchers);
75 DECLARE_FLAG(bool, interpret_irregexp); 75 DECLARE_FLAG(bool, interpret_irregexp);
76 DECLARE_FLAG(bool, enable_mirrors); 76 DECLARE_FLAG(bool, enable_mirrors);
77 DECLARE_FLAG(bool, link_natives_lazily); 77 DECLARE_FLAG(bool, link_natives_lazily);
78 DECLARE_FLAG(bool, trace_compiler);
78 79
79 bool FLAG_precompilation = false; 80 bool FLAG_precompilation = false;
80 static void PrecompilationModeHandler(bool value) { 81 static void PrecompilationModeHandler(bool value) {
81 if (value) { 82 if (value) {
82 #if defined(TARGET_ARCH_IA32) 83 #if defined(TARGET_ARCH_IA32)
83 FATAL("Precompilation not supported on IA32"); 84 FATAL("Precompilation not supported on IA32");
84 #endif 85 #endif
85 FLAG_precompilation = true; 86 FLAG_precompilation = true;
86 87
87 FLAG_always_megamorphic_calls = true; 88 FLAG_always_megamorphic_calls = true;
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 910
910 911
911 Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id, 912 Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id,
912 ICData::DeoptReasonId reason, 913 ICData::DeoptReasonId reason,
913 uint32_t flags) { 914 uint32_t flags) {
914 if (intrinsic_mode()) { 915 if (intrinsic_mode()) {
915 return &intrinsic_slow_path_label_; 916 return &intrinsic_slow_path_label_;
916 } 917 }
917 918
918 // No deoptimization allowed when 'always_optimize' is set. 919 // No deoptimization allowed when 'always_optimize' is set.
919 ASSERT(!Compiler::always_optimize()); 920 if (Compiler::always_optimize()) {
921 if (FLAG_trace_compiler) {
922 THR_Print(
923 "Retrying compilation %s, suppressing inlining of deopt_id:%" Pd "\n",
924 parsed_function_.function().ToFullyQualifiedCString(), deopt_id);
925 }
926 ASSERT(deopt_id != 0); // longjmp must return non-zero value.
927 Thread::Current()->long_jump_base()->Jump(
928 deopt_id, Object::speculative_inlining_error());
929 }
930
920 ASSERT(is_optimizing_); 931 ASSERT(is_optimizing_);
921 CompilerDeoptInfoWithStub* stub = 932 CompilerDeoptInfoWithStub* stub =
922 new(zone()) CompilerDeoptInfoWithStub(deopt_id, 933 new(zone()) CompilerDeoptInfoWithStub(deopt_id,
923 reason, 934 reason,
924 flags, 935 flags,
925 pending_deoptimization_env_); 936 pending_deoptimization_env_);
926 deopt_infos_.Add(stub); 937 deopt_infos_.Add(stub);
927 return stub->entry_label(); 938 return stub->entry_label();
928 } 939 }
929 940
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 1857
1847 1858
1848 void FlowGraphCompiler::FrameStateClear() { 1859 void FlowGraphCompiler::FrameStateClear() {
1849 ASSERT(!is_optimizing()); 1860 ASSERT(!is_optimizing());
1850 frame_state_.TruncateTo(0); 1861 frame_state_.TruncateTo(0);
1851 } 1862 }
1852 #endif 1863 #endif
1853 1864
1854 1865
1855 } // namespace dart 1866 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698