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

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

Issue 1663163003: Initial split of precompilation code from compiler.cc (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 } 927 }
928 928
929 929
930 Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id, 930 Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id,
931 ICData::DeoptReasonId reason, 931 ICData::DeoptReasonId reason,
932 uint32_t flags) { 932 uint32_t flags) {
933 if (intrinsic_mode()) { 933 if (intrinsic_mode()) {
934 return &intrinsic_slow_path_label_; 934 return &intrinsic_slow_path_label_;
935 } 935 }
936 936
937 // No deoptimization allowed when 'always_optimize' is set. 937 // No deoptimization allowed when 'FLAG_precompilation' is set.
938 if (FLAG_precompilation) { 938 if (FLAG_precompilation) {
939 if (FLAG_trace_compiler) { 939 if (FLAG_trace_compiler) {
940 THR_Print( 940 THR_Print(
941 "Retrying compilation %s, suppressing inlining of deopt_id:%" Pd "\n", 941 "Retrying compilation %s, suppressing inlining of deopt_id:%" Pd "\n",
942 parsed_function_.function().ToFullyQualifiedCString(), deopt_id); 942 parsed_function_.function().ToFullyQualifiedCString(), deopt_id);
943 } 943 }
944 ASSERT(deopt_id != 0); // longjmp must return non-zero value. 944 ASSERT(deopt_id != 0); // longjmp must return non-zero value.
945 Thread::Current()->long_jump_base()->Jump( 945 Thread::Current()->long_jump_base()->Jump(
946 deopt_id, Object::speculative_inlining_error()); 946 deopt_id, Object::speculative_inlining_error());
947 } 947 }
(...skipping 27 matching lines...) Expand all
975 ASSERT(pc_descriptors_list_ != NULL); 975 ASSERT(pc_descriptors_list_ != NULL);
976 const PcDescriptors& descriptors = PcDescriptors::Handle( 976 const PcDescriptors& descriptors = PcDescriptors::Handle(
977 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); 977 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint()));
978 if (!is_optimizing_) descriptors.Verify(parsed_function_.function()); 978 if (!is_optimizing_) descriptors.Verify(parsed_function_.function());
979 code.set_pc_descriptors(descriptors); 979 code.set_pc_descriptors(descriptors);
980 code.set_lazy_deopt_pc_offset(lazy_deopt_pc_offset_); 980 code.set_lazy_deopt_pc_offset(lazy_deopt_pc_offset_);
981 } 981 }
982 982
983 983
984 RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) { 984 RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) {
985 // No deopt information if we 'always_optimize' (no deoptimization allowed). 985 // No deopt information if we precompile (no deoptimization allowed).
986 if (FLAG_precompilation) { 986 if (FLAG_precompilation) {
987 return Array::empty_array().raw(); 987 return Array::empty_array().raw();
988 } 988 }
989 // For functions with optional arguments, all incoming arguments are copied 989 // For functions with optional arguments, all incoming arguments are copied
990 // to spill slots. The deoptimization environment does not track them. 990 // to spill slots. The deoptimization environment does not track them.
991 const Function& function = parsed_function().function(); 991 const Function& function = parsed_function().function();
992 const intptr_t incoming_arg_count = 992 const intptr_t incoming_arg_count =
993 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters(); 993 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters();
994 DeoptInfoBuilder builder(zone(), incoming_arg_count, assembler); 994 DeoptInfoBuilder builder(zone(), incoming_arg_count, assembler);
995 995
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 1878
1879 1879
1880 void FlowGraphCompiler::FrameStateClear() { 1880 void FlowGraphCompiler::FrameStateClear() {
1881 ASSERT(!is_optimizing()); 1881 ASSERT(!is_optimizing());
1882 frame_state_.TruncateTo(0); 1882 frame_state_.TruncateTo(0);
1883 } 1883 }
1884 #endif 1884 #endif
1885 1885
1886 1886
1887 } // namespace dart 1887 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698