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

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

Issue 1259713005: Save a few register moves in function prolog on arm64 by using the same pattern (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 5 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/assembler_arm64.cc ('k') | runtime/vm/intermediate_language_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) 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"
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 } 973 }
974 974
975 975
976 void FlowGraphCompiler::EmitFrameEntry() { 976 void FlowGraphCompiler::EmitFrameEntry() {
977 const Function& function = parsed_function().function(); 977 const Function& function = parsed_function().function();
978 Register new_pp = kNoRegister; 978 Register new_pp = kNoRegister;
979 if (CanOptimizeFunction() && 979 if (CanOptimizeFunction() &&
980 function.IsOptimizable() && 980 function.IsOptimizable() &&
981 (!is_optimizing() || may_reoptimize())) { 981 (!is_optimizing() || may_reoptimize())) {
982 const Register function_reg = R6; 982 const Register function_reg = R6;
983 const Register saved_pp = R7;
984 new_pp = R13; 983 new_pp = R13;
985 // The pool pointer is not setup before entering the Dart frame. 984 // The pool pointer is not setup before entering the Dart frame.
986 // Preserve PP of caller.
987 __ mov(saved_pp, PP);
988
989 // Temporarily setup pool pointer for this dart function. 985 // Temporarily setup pool pointer for this dart function.
990 __ LoadPoolPointer(); 986 __ LoadPoolPointer(new_pp);
991 987
992 // Load function object using the callee's pool pointer. 988 // Load function object using the callee's pool pointer.
993 __ LoadObject(function_reg, function); 989 __ LoadFunctionFromCalleePool(function_reg, function, new_pp);
994 // Preserve new PP and restore PP of caller.
995 __ mov(new_pp, PP);
996 __ mov(PP, saved_pp);
997 __ set_constant_pool_allowed(false);
998 990
999 // Patch point is after the eventually inlined function object. 991 // Patch point is after the eventually inlined function object.
1000 entry_patch_pc_offset_ = assembler()->CodeSize(); 992 entry_patch_pc_offset_ = assembler()->CodeSize();
1001 993
1002 __ LoadFieldFromOffset( 994 __ LoadFieldFromOffset(
1003 R7, function_reg, Function::usage_counter_offset(), kWord); 995 R7, function_reg, Function::usage_counter_offset(), kWord);
1004 // Reoptimization of an optimized function is triggered by counting in 996 // Reoptimization of an optimized function is triggered by counting in
1005 // IC stubs, but not at the entry of the function. 997 // IC stubs, but not at the entry of the function.
1006 if (!is_optimizing()) { 998 if (!is_optimizing()) {
1007 __ add(R7, R7, Operand(1)); 999 __ add(R7, R7, Operand(1));
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1836 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1845 __ PopDouble(reg); 1837 __ PopDouble(reg);
1846 } 1838 }
1847 1839
1848 1840
1849 #undef __ 1841 #undef __
1850 1842
1851 } // namespace dart 1843 } // namespace dart
1852 1844
1853 #endif // defined TARGET_ARCH_ARM64 1845 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698