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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 10209002: Progress toward inlined type checks for classes with type arguments: factor out code, optimize typ… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 6912)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1759,7 +1759,8 @@
// Check if an instance class is a subtype of class/interface using simple
// superchain and interface array traversal. Does not take type parameters into
// account.
regis 2012/04/25 01:53:53 Should you mention that instances of type Smi cann
srdjan 2012/04/25 16:38:01 Done.
-// EAX: instance (preserved)
+// EAX: instance (to be preserved).
+// ECX: class to test.
// EDX: class/interface to test against (is class of instance a subtype of it).
// (preserved).
// Result in EBX: 1 is subtype, 0 maybe not.
@@ -1767,17 +1768,7 @@
void StubCode::GenerateIsRawSubTypeStub(Assembler* assembler) {
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
- Label test_class, not_found, found, class_loaded_in_ECX, smi_value;
- __ EnterFrame(0);
- __ testl(EAX, Immediate(kSmiTagMask));
- __ j(ZERO, &smi_value, Assembler::kNearJump);
- __ movl(ECX, FieldAddress(EAX, Object::class_offset()));
- __ jmp(&class_loaded_in_ECX, Assembler::kNearJump);
- __ Bind(&smi_value);
- __ movl(ECX, FieldAddress(CTX, Context::isolate_offset()));
- __ movl(ECX, Address(ECX, Isolate::object_store_offset()));
- __ movl(ECX, Address(ECX, ObjectStore::smi_class_offset()));
- __ Bind(&class_loaded_in_ECX);
+ Label test_class, not_found, found;
__ movzxb(EBX, FieldAddress(EDX, Class::is_interface_offset()));
// Check if we are comparing against class or interface.
@@ -1795,7 +1786,6 @@
Label array_loop;
__ Bind(&array_loop);
__ subl(EDI, Immediate(Smi::RawValue(1)));
- // __ cmpl(EDI, Immediate(0));
__ j(LESS, &not_found, Assembler::kNearJump);
// EDI is Smi therefore TIMES_2 instead of TIMES_4.
// Get type from array.
@@ -1807,12 +1797,10 @@
__ Bind(&not_found);
__ xorl(EBX, EBX);
- __ LeaveFrame();
__ ret();
__ Bind(&found);
__ movl(EBX, Immediate(1));
- __ LeaveFrame();
__ ret();
__ Bind(&test_class);
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698