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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 7191007: Cleanup: use JumpIf[Not]Smi() whenever we can (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: introduced new macro Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 __ cmp(r3, ip); 2579 __ cmp(r3, ip);
2580 __ b(eq, if_false); 2580 __ b(eq, if_false);
2581 __ add(r4, r4, Operand(kPointerSize)); 2581 __ add(r4, r4, Operand(kPointerSize));
2582 __ bind(&entry); 2582 __ bind(&entry);
2583 __ cmp(r4, Operand(r2)); 2583 __ cmp(r4, Operand(r2));
2584 __ b(ne, &loop); 2584 __ b(ne, &loop);
2585 2585
2586 // If a valueOf property is not found on the object check that it's 2586 // If a valueOf property is not found on the object check that it's
2587 // prototype is the un-modified String prototype. If not result is false. 2587 // prototype is the un-modified String prototype. If not result is false.
2588 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); 2588 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset));
2589 __ tst(r2, Operand(kSmiTagMask)); 2589 __ JumpIfSmi(r2, if_false);
2590 __ b(eq, if_false);
2591 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); 2590 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset));
2592 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_INDEX)); 2591 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_INDEX));
2593 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kGlobalContextOffset)); 2592 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kGlobalContextOffset));
2594 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); 2593 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
2595 __ cmp(r2, r3); 2594 __ cmp(r2, r3);
2596 __ b(ne, if_false); 2595 __ b(ne, if_false);
2597 2596
2598 // Set the bit in the map to indicate that it has been checked safe for 2597 // Set the bit in the map to indicate that it has been checked safe for
2599 // default valueOf and set true result. 2598 // default valueOf and set true result.
2600 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); 2599 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset));
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
3336 3335
3337 VisitForStackValue(args->at(0)); 3336 VisitForStackValue(args->at(0));
3338 VisitForAccumulatorValue(args->at(1)); 3337 VisitForAccumulatorValue(args->at(1));
3339 __ pop(left); 3338 __ pop(left);
3340 3339
3341 Label done, fail, ok; 3340 Label done, fail, ok;
3342 __ cmp(left, Operand(right)); 3341 __ cmp(left, Operand(right));
3343 __ b(eq, &ok); 3342 __ b(eq, &ok);
3344 // Fail if either is a non-HeapObject. 3343 // Fail if either is a non-HeapObject.
3345 __ and_(tmp, left, Operand(right)); 3344 __ and_(tmp, left, Operand(right));
3346 __ tst(tmp, Operand(kSmiTagMask)); 3345 __ JumpIfSmi(tmp, &fail);
3347 __ b(eq, &fail);
3348 __ ldr(tmp, FieldMemOperand(left, HeapObject::kMapOffset)); 3346 __ ldr(tmp, FieldMemOperand(left, HeapObject::kMapOffset));
3349 __ ldrb(tmp2, FieldMemOperand(tmp, Map::kInstanceTypeOffset)); 3347 __ ldrb(tmp2, FieldMemOperand(tmp, Map::kInstanceTypeOffset));
3350 __ cmp(tmp2, Operand(JS_REGEXP_TYPE)); 3348 __ cmp(tmp2, Operand(JS_REGEXP_TYPE));
3351 __ b(ne, &fail); 3349 __ b(ne, &fail);
3352 __ ldr(tmp2, FieldMemOperand(right, HeapObject::kMapOffset)); 3350 __ ldr(tmp2, FieldMemOperand(right, HeapObject::kMapOffset));
3353 __ cmp(tmp, Operand(tmp2)); 3351 __ cmp(tmp, Operand(tmp2));
3354 __ b(ne, &fail); 3352 __ b(ne, &fail);
3355 __ ldr(tmp, FieldMemOperand(left, JSRegExp::kDataOffset)); 3353 __ ldr(tmp, FieldMemOperand(left, JSRegExp::kDataOffset));
3356 __ ldr(tmp2, FieldMemOperand(right, JSRegExp::kDataOffset)); 3354 __ ldr(tmp2, FieldMemOperand(right, JSRegExp::kDataOffset));
3357 __ cmp(tmp, tmp2); 3355 __ cmp(tmp, tmp2);
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3765 } 3763 }
3766 __ CallRuntime(Runtime::kTypeof, 1); 3764 __ CallRuntime(Runtime::kTypeof, 1);
3767 context()->Plug(r0); 3765 context()->Plug(r0);
3768 break; 3766 break;
3769 } 3767 }
3770 3768
3771 case Token::ADD: { 3769 case Token::ADD: {
3772 Comment cmt(masm_, "[ UnaryOperation (ADD)"); 3770 Comment cmt(masm_, "[ UnaryOperation (ADD)");
3773 VisitForAccumulatorValue(expr->expression()); 3771 VisitForAccumulatorValue(expr->expression());
3774 Label no_conversion; 3772 Label no_conversion;
3775 __ tst(result_register(), Operand(kSmiTagMask)); 3773 __ JumpIfSmi(result_register(), &no_conversion);
3776 __ b(eq, &no_conversion);
3777 ToNumberStub convert_stub; 3774 ToNumberStub convert_stub;
3778 __ CallStub(&convert_stub); 3775 __ CallStub(&convert_stub);
3779 __ bind(&no_conversion); 3776 __ bind(&no_conversion);
3780 context()->Plug(result_register()); 3777 context()->Plug(result_register());
3781 break; 3778 break;
3782 } 3779 }
3783 3780
3784 case Token::SUB: 3781 case Token::SUB:
3785 EmitUnaryOperation(expr, "[ UnaryOperation (SUB)"); 3782 EmitUnaryOperation(expr, "[ UnaryOperation (SUB)");
3786 break; 3783 break;
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
4228 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); 4225 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
4229 __ LoadRoot(r1, Heap::kNullValueRootIndex); 4226 __ LoadRoot(r1, Heap::kNullValueRootIndex);
4230 __ cmp(r0, r1); 4227 __ cmp(r0, r1);
4231 if (expr->is_strict()) { 4228 if (expr->is_strict()) {
4232 Split(eq, if_true, if_false, fall_through); 4229 Split(eq, if_true, if_false, fall_through);
4233 } else { 4230 } else {
4234 __ b(eq, if_true); 4231 __ b(eq, if_true);
4235 __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); 4232 __ LoadRoot(r1, Heap::kUndefinedValueRootIndex);
4236 __ cmp(r0, r1); 4233 __ cmp(r0, r1);
4237 __ b(eq, if_true); 4234 __ b(eq, if_true);
4238 __ tst(r0, Operand(kSmiTagMask)); 4235 __ JumpIfSmi(r0, if_false);
4239 __ b(eq, if_false);
4240 // It can be an undetectable object. 4236 // It can be an undetectable object.
4241 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); 4237 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
4242 __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset)); 4238 __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset));
4243 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable)); 4239 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable));
4244 __ cmp(r1, Operand(1 << Map::kIsUndetectable)); 4240 __ cmp(r1, Operand(1 << Map::kIsUndetectable));
4245 Split(eq, if_true, if_false, fall_through); 4241 Split(eq, if_true, if_false, fall_through);
4246 } 4242 }
4247 context()->Plug(if_true, if_false); 4243 context()->Plug(if_true, if_false);
4248 } 4244 }
4249 4245
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
4365 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4361 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4366 __ add(pc, r1, Operand(masm_->CodeObject())); 4362 __ add(pc, r1, Operand(masm_->CodeObject()));
4367 } 4363 }
4368 4364
4369 4365
4370 #undef __ 4366 #undef __
4371 4367
4372 } } // namespace v8::internal 4368 } } // namespace v8::internal
4373 4369
4374 #endif // V8_TARGET_ARCH_ARM 4370 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698