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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 11230034: Fix super ==: Test first for null before call inf super ==. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/flow_graph_compiler_x64.cc
===================================================================
--- runtime/vm/flow_graph_compiler_x64.cc (revision 13897)
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
@@ -1142,6 +1142,34 @@
}
+// Implement equality spec: if any of the arguments is null do identity check.
+// Fallthrough calls super equality.
+void FlowGraphCompiler::EmitSuperEqualityCallPrologue(Register result,
+ Label* skip_call) {
+ const Immediate raw_null =
+ Immediate(reinterpret_cast<intptr_t>(Object::null()));
+ Label check_identity, fall_through;
+ __ cmpq(Address(RSP, 0 * kWordSize), raw_null);
+ __ j(EQUAL, &check_identity, Assembler::kNearJump);
+ __ cmpq(Address(RSP, 1 * kWordSize), raw_null);
+ __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+
+ __ Bind(&check_identity);
+ __ popq(result);
+ __ cmpq(result, Address(RSP, 1 * kWordSize));
+ Label is_false;
+ __ j(NOT_EQUAL, &is_false, Assembler::kNearJump);
+ __ LoadObject(result, bool_true());
+ __ Drop(1);
+ __ jmp(skip_call);
+ __ Bind(&is_false);
+ __ LoadObject(result, bool_false());
+ __ Drop(1);
+ __ jmp(skip_call);
+ __ Bind(&fall_through);
+}
+
+
void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result,
Register reg,
Register temp,

Powered by Google App Engine
This is Rietveld 408576698