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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 10381045: Improve type checking, remove unused stub (removed also in x64 in preparation of porting the better… (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 | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | 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 7391)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1750,74 +1750,6 @@
}
-// 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.
-// Cannot handle Smi instances (must be tested beforehand).
-// 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.
-// Destroys EBX, EDI, ECX.
-void StubCode::GenerateIsRawSubTypeStub(Assembler* assembler) {
- const Immediate raw_null =
- Immediate(reinterpret_cast<intptr_t>(Object::null()));
- Label test_class, not_found, found;
-
- __ movzxb(EBX, FieldAddress(EDX, Class::is_interface_offset()));
- // Check if we are comparing against class or interface.
- __ cmpl(EBX, Immediate(0));
- __ j(EQUAL, &test_class, Assembler::kNearJump);
-
- // Get interfaces array from instance class.
- __ movl(EBX, FieldAddress(ECX, Class::interfaces_offset()));
- __ cmpl(EBX, raw_null);
- __ j(EQUAL, &not_found, Assembler::kNearJump);
- __ movl(EDI, FieldAddress(EBX, Array::length_offset()));
- // EDI: array index.
- // EBX: interface array.
- // EDX: interface searched
- Label array_loop;
- __ Bind(&array_loop);
- __ subl(EDI, Immediate(Smi::RawValue(1)));
- __ j(LESS, &not_found, Assembler::kNearJump);
- // EDI is Smi therefore TIMES_2 instead of TIMES_4.
- // Get type from array.
- __ movl(ECX, FieldAddress(EBX, EDI, TIMES_2, Array::data_offset()));
- __ movl(ECX, FieldAddress(ECX, Type::type_class_offset()));
- __ cmpl(ECX, EDX);
- __ j(EQUAL, &found, Assembler::kNearJump);
- __ jmp(&array_loop, Assembler::kNearJump);
-
- __ Bind(&not_found);
- __ xorl(EBX, EBX);
- __ ret();
-
- __ Bind(&found);
- __ movl(EBX, Immediate(1));
- __ ret();
-
- __ Bind(&test_class);
- // EDX: test class.
- __ cmpl(ECX, EDX);
- __ j(EQUAL, &found, Assembler::kNearJump);
-
- // Check superclasses using a loop (faster than runtime call).
- Label super_loop;
- __ Bind(&super_loop);
- // ECX: class -> super.
- __ movl(ECX, FieldAddress(ECX, Class::super_type_offset()));
- // The supertype of Object is a null object.
- __ cmpl(ECX, raw_null);
- __ j(EQUAL, &not_found, Assembler::kNearJump);
- __ movl(ECX, FieldAddress(ECX, Type::type_class_offset()));
- __ cmpl(EDX, ECX);
- __ j(NOT_EQUAL, &super_loop, Assembler::kNearJump);
- __ jmp(&found, Assembler::kNearJump);
-}
-
-
// Used to check class and type arguments. Arguments passed on stack:
// TOS + 0: return address.
// TOS + 1: instantiator type arguments (can be NULL).
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698