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

Unified Diff: runtime/vm/code_generator_ia32.cc

Issue 10414026: Started porting inlined type checks to x64 (will be the future pattern for other architectures). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_ia32.cc
===================================================================
--- runtime/vm/code_generator_ia32.cc (revision 7823)
+++ runtime/vm/code_generator_ia32.cc (working copy)
@@ -1232,7 +1232,6 @@
const Bool& bool_true = Bool::ZoneHandle(Bool::True());
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
- Label loop, found_in_cache, runtime_call;
// Check immediate equality.
__ movl(ECX, FieldAddress(EAX, Object::class_offset()));
// ECX: instance class.
@@ -1255,6 +1254,7 @@
__ popl(EDX); // Discard.
// Result is in ECX: null -> not found, otherwise Bool::True or Bool::False.
+ Label runtime_call;
__ cmpl(ECX, raw_null);
__ j(EQUAL, &runtime_call, Assembler::kNearJump);
__ CompareObject(ECX, bool_true);
@@ -1455,6 +1455,10 @@
if (is_raw_type) {
// Dynamic type argument, check only classes.
__ movl(ECX, FieldAddress(EAX, Object::class_offset()));
+ if (!type_class.is_interface()) {
+ __ CompareObject(ECX, type_class);
+ __ j(EQUAL, is_instance_lbl);
+ }
if (type.IsListInterface()) {
// TODO(srdjan) also accept List<Object>.
__ CompareObject(ECX, *CoreClass("ObjectArray"));
@@ -1553,6 +1557,7 @@
Isolate::Current()->object_store()->bool_class());
__ CompareObject(ECX, bool_class);
__ j(EQUAL, is_instance_lbl);
+ __ jmp(is_not_instance_lbl);
return;
}
// If type is an interface, we can skip the class equality check,
@@ -1576,12 +1581,16 @@
__ j(EQUAL, is_instance_lbl);
__ CompareObject(ECX, bigint_class);
__ j(EQUAL, is_instance_lbl);
+ if (type.IsIntInterface()) {
+ __ jmp(is_not_instance_lbl);
+ }
}
if (type.IsDoubleInterface() || type.IsNumberInterface()) {
const Class& double_class = Class::ZoneHandle(
Isolate::Current()->object_store()->double_class());
__ CompareObject(ECX, double_class);
__ j(EQUAL, is_instance_lbl);
+ __ jmp(is_not_instance_lbl);
}
} else if (type.IsStringInterface()) {
__ movl(ECX, FieldAddress(EAX, Object::class_offset()));
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698