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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 10594002: More ICData cleanups: try to use ICData instead of converting it to another intermediate representa… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
===================================================================
--- runtime/vm/flow_graph_compiler_x64.cc (revision 8852)
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
@@ -1022,21 +1022,21 @@
// Checks class id of instance against all 'class_ids'. Jump to 'deopt' label
// if no match or instance is Smi.
-void FlowGraphCompiler::EmitClassChecksNoSmi(
- const ZoneGrowableArray<intptr_t>& class_ids,
- Register instance_reg,
- Register temp_reg,
- Label* deopt) {
+void FlowGraphCompiler::EmitClassChecksNoSmi(const ICData& ic_data,
+ Register instance_reg,
+ Register temp_reg,
+ Label* deopt) {
Label ok;
- ASSERT(class_ids[0] != kSmi);
+ ASSERT(ic_data.GetReceiverClassIdAt(0) != kSmi);
__ testq(instance_reg, Immediate(kSmiTagMask));
__ j(ZERO, deopt);
Label is_ok;
- bool use_near_jump = class_ids.length() < 5;
+ const intptr_t num_checks = ic_data.NumberOfChecks();
+ const bool use_near_jump = num_checks < 5;
__ LoadClassId(temp_reg, instance_reg);
- for (intptr_t i = 0; i < class_ids.length(); i++) {
- __ cmpl(temp_reg, Immediate(class_ids[i]));
- if (i == (class_ids.length() - 1)) {
+ for (intptr_t i = 0; i < num_checks; i++) {
+ __ cmpl(temp_reg, Immediate(ic_data.GetReceiverClassIdAt(i)));
+ if (i == (num_checks - 1)) {
__ j(NOT_EQUAL, deopt);
} else {
if (use_near_jump) {
regis 2012/06/19 21:14:18 Since Assembler::kNearJump is bool true, you could
srdjan 2012/06/19 21:28:17 Leaving it as it is.
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698