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

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

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 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
« no previous file with comments | « runtime/vm/find_code_object_test.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 deopt_infos_.Add(info); 999 deopt_infos_.Add(info);
1000 assembler()->Deopt(0, /*is_eager =*/ 1); 1000 assembler()->Deopt(0, /*is_eager =*/ 1);
1001 info->set_pc_offset(assembler()->CodeSize()); 1001 info->set_pc_offset(assembler()->CodeSize());
1002 } 1002 }
1003 #endif // defined(TARGET_ARCH_DBC) 1003 #endif // defined(TARGET_ARCH_DBC)
1004 1004
1005 1005
1006 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { 1006 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) {
1007 ASSERT(exception_handlers_list_ != NULL); 1007 ASSERT(exception_handlers_list_ != NULL);
1008 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( 1008 const ExceptionHandlers& handlers = ExceptionHandlers::Handle(
1009 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); 1009 exception_handlers_list_->FinalizeExceptionHandlers(code.PayloadStart()));
1010 code.set_exception_handlers(handlers); 1010 code.set_exception_handlers(handlers);
1011 if (FLAG_compiler_stats) { 1011 if (FLAG_compiler_stats) {
1012 Thread* thread = Thread::Current(); 1012 Thread* thread = Thread::Current();
1013 INC_STAT(thread, total_code_size, 1013 INC_STAT(thread, total_code_size,
1014 ExceptionHandlers::InstanceSize(handlers.num_entries())); 1014 ExceptionHandlers::InstanceSize(handlers.num_entries()));
1015 INC_STAT(thread, total_code_size, handlers.num_entries() * sizeof(uword)); 1015 INC_STAT(thread, total_code_size, handlers.num_entries() * sizeof(uword));
1016 } 1016 }
1017 } 1017 }
1018 1018
1019 1019
1020 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { 1020 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) {
1021 ASSERT(pc_descriptors_list_ != NULL); 1021 ASSERT(pc_descriptors_list_ != NULL);
1022 const PcDescriptors& descriptors = PcDescriptors::Handle( 1022 const PcDescriptors& descriptors = PcDescriptors::Handle(
1023 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); 1023 pc_descriptors_list_->FinalizePcDescriptors(code.PayloadStart()));
1024 if (!is_optimizing_) descriptors.Verify(parsed_function_.function()); 1024 if (!is_optimizing_) descriptors.Verify(parsed_function_.function());
1025 code.set_pc_descriptors(descriptors); 1025 code.set_pc_descriptors(descriptors);
1026 code.set_lazy_deopt_pc_offset(lazy_deopt_pc_offset_); 1026 code.set_lazy_deopt_pc_offset(lazy_deopt_pc_offset_);
1027 } 1027 }
1028 1028
1029 1029
1030 RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) { 1030 RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) {
1031 // No deopt information if we precompile (no deoptimization allowed). 1031 // No deopt information if we precompile (no deoptimization allowed).
1032 if (FLAG_precompiled_mode) { 1032 if (FLAG_precompiled_mode) {
1033 return Array::empty_array().raw(); 1033 return Array::empty_array().raw();
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 1995
1996 1996
1997 void FlowGraphCompiler::FrameStateClear() { 1997 void FlowGraphCompiler::FrameStateClear() {
1998 ASSERT(!is_optimizing()); 1998 ASSERT(!is_optimizing());
1999 frame_state_.TruncateTo(0); 1999 frame_state_.TruncateTo(0);
2000 } 2000 }
2001 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) 2001 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
2002 2002
2003 2003
2004 } // namespace dart 2004 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/find_code_object_test.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698