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

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

Issue 501553005: Scale invocation count by the number of BBs in the flow-graph of a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refactor and port to archs. Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
11 #include "vm/compiler.h" 11 #include "vm/compiler.h"
12 #include "vm/cpu.h" 12 #include "vm/cpu.h"
13 #include "vm/dart_entry.h" 13 #include "vm/dart_entry.h"
14 #include "vm/deopt_instructions.h" 14 #include "vm/deopt_instructions.h"
15 #include "vm/il_printer.h" 15 #include "vm/il_printer.h"
16 #include "vm/locations.h" 16 #include "vm/locations.h"
17 #include "vm/object_store.h" 17 #include "vm/object_store.h"
18 #include "vm/parser.h" 18 #include "vm/parser.h"
19 #include "vm/stack_frame.h" 19 #include "vm/stack_frame.h"
20 #include "vm/stub_code.h" 20 #include "vm/stub_code.h"
21 #include "vm/symbols.h" 21 #include "vm/symbols.h"
22 22
23 namespace dart { 23 namespace dart {
24 24
25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); 25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
26 DECLARE_FLAG(int, optimization_counter_threshold);
27 DECLARE_FLAG(int, reoptimization_counter_threshold);
28 DECLARE_FLAG(bool, enable_simd_inline); 26 DECLARE_FLAG(bool, enable_simd_inline);
29 27
30 28
31 FlowGraphCompiler::~FlowGraphCompiler() { 29 FlowGraphCompiler::~FlowGraphCompiler() {
32 // BlockInfos are zone-allocated, so their destructors are not called. 30 // BlockInfos are zone-allocated, so their destructors are not called.
33 // Verify the labels explicitly here. 31 // Verify the labels explicitly here.
34 for (int i = 0; i < block_info_.length(); ++i) { 32 for (int i = 0; i < block_info_.length(); ++i) {
35 ASSERT(!block_info_[i]->jump_label()->IsLinked()); 33 ASSERT(!block_info_[i]->jump_label()->IsLinked());
36 } 34 }
37 } 35 }
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 967
970 // Set up pool pointer in new_pp. 968 // Set up pool pointer in new_pp.
971 __ LoadPoolPointer(new_pp); 969 __ LoadPoolPointer(new_pp);
972 970
973 // Load function object using the callee's pool pointer. 971 // Load function object using the callee's pool pointer.
974 __ LoadObject(function_reg, function, new_pp); 972 __ LoadObject(function_reg, function, new_pp);
975 973
976 // Patch point is after the eventually inlined function object. 974 // Patch point is after the eventually inlined function object.
977 entry_patch_pc_offset_ = assembler()->CodeSize(); 975 entry_patch_pc_offset_ = assembler()->CodeSize();
978 976
979 intptr_t threshold = FLAG_optimization_counter_threshold; 977 const intptr_t threshold = GetOptimizationThreshold();
980 __ LoadFieldFromOffset( 978 __ LoadFieldFromOffset(
981 R7, function_reg, Function::usage_counter_offset(), new_pp, kWord); 979 R7, function_reg, Function::usage_counter_offset(), new_pp, kWord);
982 if (is_optimizing()) { 980 if (is_optimizing()) {
983 // Reoptimization of an optimized function is triggered by counting in 981 // Reoptimization of an optimized function is triggered by counting in
984 // IC stubs, but not at the entry of the function. 982 // IC stubs, but not at the entry of the function.
985 threshold = FLAG_reoptimization_counter_threshold;
986 } else { 983 } else {
Vyacheslav Egorov (Google) 2014/08/29 11:17:18 ditto
Anders Johnsen 2014/08/29 11:56:28 Done.
987 __ add(R7, R7, Operand(1)); 984 __ add(R7, R7, Operand(1));
988 __ StoreFieldToOffset( 985 __ StoreFieldToOffset(
989 R7, function_reg, Function::usage_counter_offset(), new_pp, kWord); 986 R7, function_reg, Function::usage_counter_offset(), new_pp, kWord);
990 } 987 }
991 __ CompareImmediate(R7, threshold, new_pp); 988 __ CompareImmediate(R7, threshold, new_pp);
992 ASSERT(function_reg == R6); 989 ASSERT(function_reg == R6);
993 Label dont_optimize; 990 Label dont_optimize;
994 __ b(&dont_optimize, LT); 991 __ b(&dont_optimize, LT);
995 __ Branch(&stub_code->OptimizeFunctionLabel(), new_pp); 992 __ Branch(&stub_code->OptimizeFunctionLabel(), new_pp);
996 __ Bind(&dont_optimize); 993 __ Bind(&dont_optimize);
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1734 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1738 UNIMPLEMENTED(); 1735 UNIMPLEMENTED();
1739 } 1736 }
1740 1737
1741 1738
1742 #undef __ 1739 #undef __
1743 1740
1744 } // namespace dart 1741 } // namespace dart
1745 1742
1746 #endif // defined TARGET_ARCH_ARM64 1743 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698