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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 2748073002: Revert "VM: Simplify lowering of is-tests." (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm64.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 86cfb8cc4276c4ab7c7ff056fbec7a9ef8399429..88d95b9268e71d34bb778d850afe17f929bf173a 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -561,6 +561,7 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof(
void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos,
intptr_t deopt_id,
const AbstractType& type,
+ bool negate_result,
LocationSummary* locs) {
ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded());
ASSERT(!type.IsObjectType() && !type.IsDynamicType());
@@ -603,15 +604,23 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos,
// Pop the parameters supplied to the runtime entry. The result of the
// instanceof runtime call will be left as the result of the operation.
__ Drop(4);
- __ popl(EAX);
+ if (negate_result) {
+ __ popl(EDX);
+ __ LoadObject(EAX, Bool::True());
+ __ cmpl(EDX, EAX);
+ __ j(NOT_EQUAL, &done, Assembler::kNearJump);
+ __ LoadObject(EAX, Bool::False());
+ } else {
+ __ popl(EAX);
+ }
__ jmp(&done, Assembler::kNearJump);
}
__ Bind(&is_not_instance);
- __ LoadObject(EAX, Bool::Get(false));
+ __ LoadObject(EAX, Bool::Get(negate_result));
__ jmp(&done, Assembler::kNearJump);
__ Bind(&is_instance);
- __ LoadObject(EAX, Bool::Get(true));
+ __ LoadObject(EAX, Bool::Get(!negate_result));
__ Bind(&done);
__ popl(EDX); // Remove pushed instantiator type arguments.
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm64.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698