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

Unified Diff: src/arm/lithium-codegen-arm.cc

Issue 6040008: ARM: Support DoCheckInstanceType in lithium codegenerator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 12 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index bac1db4de3f0e09760ec109b86cb912a49c049e7..9670bbb9fb1a1325da72d6d6ce780860d410ee7a 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -2114,7 +2114,28 @@ void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
- Abort("DoCheckInstanceType unimplemented.");
+ Register input = ToRegister(instr->input());
+ Register scratch = scratch0();
Søren Thygesen Gjesse 2011/01/05 20:52:36 It is convenient to use ip as an intermediate regi
Karl Klose 2011/01/06 12:47:14 I remove the second temporary and use only scratch
+ Register type = ip;
+ InstanceType first = instr->hydrogen()->first();
+ InstanceType last = instr->hydrogen()->last();
+
+ __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
Søren Thygesen Gjesse 2011/01/05 20:52:36 Can't you just replace type with scratch here?
Karl Klose 2011/01/06 12:47:14 Done.
+ __ ldrb(type, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
+ __ cmp(type, Operand(first));
+
+ // If there is only one type in the interval check for equality.
+ if (first == last) {
+ DeoptimizeIf(ne, instr->environment());
+ } else {
+ DeoptimizeIf(lo, instr->environment());
+ // Omit check for the last type.
+ if (last != LAST_TYPE) {
Søren Thygesen Gjesse 2011/01/05 20:52:36 No need to reload type - can stay in scratch.
Karl Klose 2011/01/06 12:47:14 Done.
+ __ ldrb(type, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
+ __ cmp(type, Operand(last));
+ DeoptimizeIf(hi, instr->environment());
+ }
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698