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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 10698128: Improve code for checked instance calls (polymorphic calls) and expand printing of PolymorphicInsta… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | « no previous file | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 9512)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -390,7 +390,7 @@
void FlowGraphCompiler::EmitComment(Instruction* instr) {
- char buffer[80];
+ char buffer[256];
BufferFormatter f(buffer, sizeof(buffer));
instr->PrintTo(&f);
assembler()->Comment("@%d: %s", instr->cid(), buffer);
@@ -427,11 +427,16 @@
intptr_t cid,
intptr_t token_index,
intptr_t try_index) {
- // TODO(srdjan): better loop please!
+ Label match_found;
for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) {
+ const bool is_last_check = (i == (ic_data.NumberOfChecks() - 1));
Label next_test;
assembler()->cmpl(class_id_reg, Immediate(ic_data.GetReceiverClassIdAt(i)));
- assembler()->j(NOT_EQUAL, &next_test);
+ if (is_last_check) {
+ assembler()->j(NOT_EQUAL, deopt);
+ } else {
+ assembler()->j(NOT_EQUAL, &next_test);
+ }
const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i));
GenerateStaticCall(cid,
token_index,
@@ -439,10 +444,15 @@
target,
arg_count,
arg_names);
- assembler()->jmp(done);
+ if (!is_last_check) {
+ assembler()->jmp(&match_found);
+ }
assembler()->Bind(&next_test);
}
- assembler()->jmp(deopt);
+ assembler()->Bind(&match_found);
+ if (done != NULL) {
+ assembler()->jmp(done);
+ }
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698