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

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

Issue 2734883002: ICData::NumberOfChecks is O(n) so don't call it in loops (Closed)
Patch Set: Add const Created 3 years, 9 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/intermediate_language_mips.cc ('k') | runtime/vm/jit_optimizer.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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 5270 matching lines...) Expand 10 before | Expand all | Expand 10 after
5281 Label do_call, done; 5281 Label do_call, done;
5282 // Check for overflow and that it fits into Smi. 5282 // Check for overflow and that it fits into Smi.
5283 __ movq(temp, result); 5283 __ movq(temp, result);
5284 __ shlq(temp, Immediate(1)); 5284 __ shlq(temp, Immediate(1));
5285 __ j(OVERFLOW, &do_call, Assembler::kNearJump); 5285 __ j(OVERFLOW, &do_call, Assembler::kNearJump);
5286 __ SmiTag(result); 5286 __ SmiTag(result);
5287 __ jmp(&done); 5287 __ jmp(&done);
5288 __ Bind(&do_call); 5288 __ Bind(&do_call);
5289 ASSERT(instance_call()->HasICData()); 5289 ASSERT(instance_call()->HasICData());
5290 const ICData& ic_data = *instance_call()->ic_data(); 5290 const ICData& ic_data = *instance_call()->ic_data();
5291 ASSERT((ic_data.NumberOfChecks() == 1)); 5291 ASSERT(ic_data.NumberOfChecksIs(1));
5292 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); 5292 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
5293 5293
5294 const intptr_t kNumberOfArguments = 1; 5294 const intptr_t kNumberOfArguments = 1;
5295 __ pushq(value_obj); 5295 __ pushq(value_obj);
5296 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, 5296 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
5297 kNumberOfArguments, 5297 kNumberOfArguments,
5298 Object::null_array(), // No argument names. 5298 Object::null_array(), // No argument names.
5299 locs(), ICData::Handle()); 5299 locs(), ICData::Handle());
5300 __ Bind(&done); 5300 __ Bind(&done);
5301 } 5301 }
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
6750 __ Drop(1); 6750 __ Drop(1);
6751 __ popq(result); 6751 __ popq(result);
6752 } 6752 }
6753 6753
6754 6754
6755 } // namespace dart 6755 } // namespace dart
6756 6756
6757 #undef __ 6757 #undef __
6758 6758
6759 #endif // defined TARGET_ARCH_X64 6759 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698