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

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

Issue 1373013002: VM: Fix bug in the new edge counter code on ARM and MIPS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | runtime/vm/flow_graph_compiler_mips.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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 1181
1182 1182
1183 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) { 1183 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
1184 // We do not check for overflow when incrementing the edge counter. The 1184 // We do not check for overflow when incrementing the edge counter. The
1185 // function should normally be optimized long before the counter can 1185 // function should normally be optimized long before the counter can
1186 // overflow; and though we do not reset the counters when we optimize or 1186 // overflow; and though we do not reset the counters when we optimize or
1187 // deoptimize, there is a bound on the number of 1187 // deoptimize, there is a bound on the number of
1188 // optimization/deoptimization cycles we will attempt. 1188 // optimization/deoptimization cycles we will attempt.
1189 ASSERT(!edge_counters_array_.IsNull()); 1189 ASSERT(!edge_counters_array_.IsNull());
1190 ASSERT(assembler_->constant_pool_allowed()); 1190 ASSERT(assembler_->constant_pool_allowed());
1191 const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld)); 1191 const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld));
rmacnak 2015/09/28 17:15:27 Dead allocation.
Florian Schneider 2015/09/28 17:17:25 Good catch. Done.
1192 counter.SetAt(0, Smi::Handle(zone(), Smi::New(0))); 1192 counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
1193 __ Comment("Edge counter"); 1193 __ Comment("Edge counter");
1194 __ LoadObject(R0, edge_counters_array_); 1194 __ LoadObject(R0, edge_counters_array_);
1195 #if defined(DEBUG) 1195 #if defined(DEBUG)
1196 bool old_use_far_branches = assembler_->use_far_branches(); 1196 bool old_use_far_branches = assembler_->use_far_branches();
1197 assembler_->set_use_far_branches(true); 1197 assembler_->set_use_far_branches(true);
1198 #endif // DEBUG 1198 #endif // DEBUG
1199 __ ldr(IP, FieldAddress(R0, Array::element_offset(edge_id))); 1199 __ LoadFieldFromOffset(kWord, R1, R0, Array::element_offset(edge_id));
1200 __ add(IP, IP, Operand(Smi::RawValue(1))); 1200 __ add(R1, R1, Operand(Smi::RawValue(1)));
1201 __ StoreIntoSmiField(FieldAddress(R0, Array::element_offset(edge_id)), IP); 1201 __ StoreIntoObjectNoBarrierOffset(
1202 R0, Array::element_offset(edge_id), R1, Assembler::kOnlySmi);
1202 #if defined(DEBUG) 1203 #if defined(DEBUG)
1203 assembler_->set_use_far_branches(old_use_far_branches); 1204 assembler_->set_use_far_branches(old_use_far_branches);
1204 #endif // DEBUG 1205 #endif // DEBUG
1205 } 1206 }
1206 1207
1207 1208
1208 void FlowGraphCompiler::EmitOptimizedInstanceCall( 1209 void FlowGraphCompiler::EmitOptimizedInstanceCall(
1209 const StubEntry& stub_entry, 1210 const StubEntry& stub_entry,
1210 const ICData& ic_data, 1211 const ICData& ic_data,
1211 intptr_t argument_count, 1212 intptr_t argument_count,
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 DRegister dreg = EvenDRegisterOf(reg); 1866 DRegister dreg = EvenDRegisterOf(reg);
1866 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1867 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1867 } 1868 }
1868 1869
1869 1870
1870 #undef __ 1871 #undef __
1871 1872
1872 } // namespace dart 1873 } // namespace dart
1873 1874
1874 #endif // defined TARGET_ARCH_ARM 1875 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698